fix(项目管理): 修复应用管理保存传参
This commit is contained in:
parent
6fa3e4ad0f
commit
f1e566062a
|
@ -167,14 +167,16 @@ export function getDeleteFake(data: FakeTableOperationParams) {
|
|||
|
||||
// JIRA插件key校验
|
||||
export function validateJIRAKey(data: object, pluginId: string) {
|
||||
return MSR.post<FakeTableListItem[]>({ url: `${Url.postValidateJiraKeyUrl}${pluginId}`, data });
|
||||
return MSR.post<MenuTableConfigItem>({ url: `${Url.postValidateJiraKeyUrl}${pluginId}`, data });
|
||||
}
|
||||
// 缺陷管理-获取同步信息
|
||||
export function getBugSyncInfo(projectId: string) {
|
||||
return MSR.get<FakeTableListItem[]>({ url: `${Url.getBugSyncInfoUrl}${projectId}` });
|
||||
return MSR.get<MenuTableConfigItem>({ url: `${Url.getBugSyncInfoUrl}${projectId}` });
|
||||
}
|
||||
|
||||
// 用例管理-获取关联需求信息
|
||||
export function getCaseRelatedInfo(projectId: string) {
|
||||
return MSR.get<FakeTableListItem[]>({ url: `${Url.getCaseRelatedInfoUrl}${projectId}` });
|
||||
return MSR.get<{ demand_platform_config: string; platform_key: string; case_enable: string }>({
|
||||
url: `${Url.getCaseRelatedInfoUrl}${projectId}`,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<template>
|
||||
<a-input
|
||||
:value="props.modelValue"
|
||||
v-model:model-value="inputValue"
|
||||
:placeholder="t('project.menu.pleaseInputJiraKey')"
|
||||
v-bind="attrs"
|
||||
:max-length="255"
|
||||
@change="(v: string) => emit('update:modelValue', v)"
|
||||
@blur="handleBlur"
|
||||
/>
|
||||
<div class="flex flex-row items-center gap-[10px] text-[12px] leading-[16px]">
|
||||
|
@ -22,6 +21,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineModel } from 'vue';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
import { validateJIRAKey } from '@/api/modules/project-management/menuManagement';
|
||||
|
@ -29,16 +29,15 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
const attrs = useAttrs();
|
||||
const { formCreateInject } = attrs;
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: string;
|
||||
instructionsIcon: string;
|
||||
value?: string;
|
||||
}>();
|
||||
const previewIcon = ref<string>('');
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: string): void;
|
||||
}>();
|
||||
const inputValue = defineModel<string>();
|
||||
|
||||
const { t } = useI18n();
|
||||
onMounted(() => {
|
||||
|
@ -53,13 +52,18 @@
|
|||
const pluginId = sessionStorage.getItem('platformKey') || '';
|
||||
if (pluginId) {
|
||||
try {
|
||||
await validateJIRAKey({ name: '1231' }, pluginId);
|
||||
await validateJIRAKey({ [(formCreateInject as { [key: string]: string }).field]: inputValue.value }, pluginId);
|
||||
Message.success('common.validateSuccess');
|
||||
} catch {
|
||||
Message.error('common.validateFaild');
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (props.value) {
|
||||
inputValue.value = props.value;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
import { FormRuleItem } from './types';
|
||||
import formCreate, { Rule } from '@form-create/arco-design';
|
||||
|
||||
defineOptions({ name: 'MsFormCreate' });
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
formCreate.component('PassWord', PassWord);
|
||||
|
|
|
@ -83,7 +83,14 @@
|
|||
<a-tooltip v-if="okDisabled" :content="t('project.menu.defect.enableAfterConfig')">
|
||||
<a-switch size="small" type="line" disabled />
|
||||
</a-tooltip>
|
||||
<a-switch v-else v-model="form.SYNC_ENABLE" size="small" type="line" />
|
||||
<a-switch
|
||||
v-else
|
||||
v-model="form.SYNC_ENABLE"
|
||||
checked-value="true"
|
||||
unchecked-value="false"
|
||||
size="small"
|
||||
type="line"
|
||||
/>
|
||||
<span class="text-[var(--color-text-1)]">
|
||||
{{ t('project.menu.status') }}
|
||||
</span>
|
||||
|
@ -111,6 +118,7 @@
|
|||
import type { FormItem, FormRuleItem } from '@/components/pure/ms-form-create/types';
|
||||
|
||||
import {
|
||||
getBugSyncInfo,
|
||||
getPlatformInfo,
|
||||
getPlatformOptions,
|
||||
postSaveDefectSync,
|
||||
|
@ -129,6 +137,8 @@
|
|||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const formCreateValue = ref<Record<string, any>>({});
|
||||
const currentVisible = ref<boolean>(props.visible);
|
||||
const platformOption = ref<PoolOption[]>([]);
|
||||
const frequencyOption = ref([
|
||||
|
@ -171,6 +181,13 @@
|
|||
try {
|
||||
if (value) {
|
||||
const res = await getPlatformInfo(value as string, MenuEnum.bugManagement);
|
||||
if (formCreateValue.value) {
|
||||
res.formItems.forEach((item) => {
|
||||
if (formCreateValue.value[item.name]) {
|
||||
item.value = formCreateValue.value[item.name];
|
||||
}
|
||||
});
|
||||
}
|
||||
platformRules.value = res.formItems;
|
||||
sessionStorage.setItem('platformKey', value as string);
|
||||
} else {
|
||||
|
@ -210,12 +227,30 @@
|
|||
}
|
||||
};
|
||||
|
||||
// 获取关联需求信息
|
||||
const initDetailInfo = async () => {
|
||||
try {
|
||||
await initPlatformOption();
|
||||
const res = await getBugSyncInfo(currentProjectId.value);
|
||||
if (res && res.platform_key) {
|
||||
form.SYNC_ENABLE = res.sync_enable;
|
||||
form.PLATFORM_KEY = res.platform_key;
|
||||
formCreateValue.value = JSON.parse(res.bug_platform_config);
|
||||
// 如果平台key存在调用平台change拉取插件字段
|
||||
await handlePlatformChange(res.platform_key);
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
currentVisible.value = val;
|
||||
if (val) {
|
||||
initPlatformOption();
|
||||
initDetailInfo();
|
||||
} else {
|
||||
formRef.value?.resetFields();
|
||||
platformRules.value = [];
|
||||
|
|
|
@ -40,7 +40,14 @@
|
|||
<a-tooltip v-if="okDisabled" :content="t('project.menu.defect.enableAfterConfig')">
|
||||
<a-switch size="small" type="line" disabled />
|
||||
</a-tooltip>
|
||||
<a-switch v-else v-model="form.SYNC_ENABLE" size="small" type="line" />
|
||||
<a-switch
|
||||
v-else
|
||||
v-model="form.CASE_ENABLE"
|
||||
checked-value="true"
|
||||
unchecked-value="false"
|
||||
size="small"
|
||||
type="line"
|
||||
/>
|
||||
<span class="text-[var(--color-text-1)]">
|
||||
{{ t('project.menu.status') }}
|
||||
</span>
|
||||
|
@ -68,6 +75,7 @@
|
|||
import type { FormItem, FormRuleItem } from '@/components/pure/ms-form-create/types';
|
||||
|
||||
import {
|
||||
getCaseRelatedInfo,
|
||||
getPlatformInfo,
|
||||
getPlatformOptions,
|
||||
postSaveRelatedCase,
|
||||
|
@ -98,9 +106,11 @@
|
|||
|
||||
const form = reactive({
|
||||
PLATFORM_KEY: '',
|
||||
SYNC_ENABLE: 'false', // 同步开关
|
||||
CASE_ENABLE: 'false', // 同步开关
|
||||
});
|
||||
|
||||
const formCreateValue = ref<Record<string, any>>({});
|
||||
|
||||
const okDisabled = computed(() => !form.PLATFORM_KEY);
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
@ -116,6 +126,13 @@
|
|||
try {
|
||||
if (value) {
|
||||
const res = await getPlatformInfo(value as string, MenuEnum.caseManagement);
|
||||
if (formCreateValue.value) {
|
||||
res.formItems.forEach((item) => {
|
||||
if (formCreateValue.value[item.name]) {
|
||||
item.value = formCreateValue.value[item.name];
|
||||
}
|
||||
});
|
||||
}
|
||||
platformRules.value = res.formItems;
|
||||
} else {
|
||||
platformRules.value = [];
|
||||
|
@ -156,13 +173,30 @@
|
|||
console.log(error);
|
||||
}
|
||||
};
|
||||
// 获取关联需求信息
|
||||
const initDetailInfo = async () => {
|
||||
try {
|
||||
await initPlatformOption();
|
||||
const res = await getCaseRelatedInfo(currentProjectId.value);
|
||||
if (res && res.platform_key) {
|
||||
form.CASE_ENABLE = res.case_enable;
|
||||
form.PLATFORM_KEY = res.platform_key;
|
||||
formCreateValue.value = JSON.parse(res.demand_platform_config);
|
||||
// 如果平台key存在调用平台change拉取插件字段
|
||||
await handlePlatformChange(res.platform_key);
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
currentVisible.value = val;
|
||||
if (val) {
|
||||
initPlatformOption();
|
||||
initDetailInfo();
|
||||
} else {
|
||||
formRef.value?.resetFields();
|
||||
platformRules.value = [];
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
(e: 'cancel', shouldSearch: boolean): void;
|
||||
}>();
|
||||
|
||||
const allModuleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
const allModuleIds = ['bugManagement', 'caseManagement', 'apiTest'];
|
||||
|
||||
const showPoolModuleIds = ['uiTest', 'apiTest', 'loadTest'];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
}}</a-button>
|
||||
<a-input-search
|
||||
v-model="keyword"
|
||||
:placeholder="t('system.user.searchUser')"
|
||||
:placeholder="t('system.organization.searchIndexPlaceholder')"
|
||||
class="w-[240px]"
|
||||
allow-clear
|
||||
@press-enter="fetchData"
|
||||
|
|
|
@ -60,7 +60,11 @@
|
|||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="showPool" field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<MsSystemPool v-model:modelValue="form.resourcePoolIds" :organization-id="form.organizationId" />
|
||||
<MsSystemPool
|
||||
v-model:modelValue="form.resourcePoolIds"
|
||||
:module-ids="form.moduleIds"
|
||||
:organization-id="form.organizationId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item field="description" :label="t('system.organization.description')">
|
||||
<a-textarea
|
||||
|
@ -138,7 +142,7 @@
|
|||
(e: 'cancel', shouldSearch: boolean): void;
|
||||
}>();
|
||||
|
||||
const allModuleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
const allModuleIds = ['bugManagement', 'caseManagement', 'apiTest'];
|
||||
|
||||
const showPoolModuleIds = ['uiTest', 'apiTest', 'loadTest'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue