mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(测试规划脑图): 打开配置抽屉更改内容时点击脑图的保存未将配置表单内容提交问题修复
This commit is contained in:
parent
42954c609c
commit
e6fae5ddb0
@ -23,14 +23,12 @@
|
||||
import MsCaseAssociate from '@/components/business/ms-associate-case/index.vue';
|
||||
import type { saveParams } from '@/components/business/ms-associate-case/types';
|
||||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
import type { AssociateCaseRequestParams } from '@/models/testPlan/testPlan';
|
||||
import { CaseCountApiTypeEnum, CaseModulesApiTypeEnum, CasePageApiTypeEnum } from '@/enums/associateCaseEnum';
|
||||
import { CaseLinkEnum } from '@/enums/caseEnum';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps<{
|
||||
associationType: CaseLinkEnum;
|
||||
modulesMaps?: Record<string, saveParams>;
|
||||
|
@ -805,6 +805,25 @@
|
||||
deletedIds: [],
|
||||
});
|
||||
|
||||
/**
|
||||
* 保存测试点配置
|
||||
*/
|
||||
function handleConfigSave() {
|
||||
configFormRef.value?.validate((errors) => {
|
||||
if (!errors) {
|
||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||
if (node && node?.data && configForm.value) {
|
||||
node.data = {
|
||||
...node.data,
|
||||
...cloneDeep(configForm.value),
|
||||
};
|
||||
}
|
||||
// 派发SAVE_MINDER事件触发脑图的保存处理
|
||||
minderStore.dispatchEvent(MinderEventName.SAVE_MINDER);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成脑图保存的入参
|
||||
*/
|
||||
@ -831,8 +850,25 @@
|
||||
|
||||
async function handleMinderSave(fullJson: MinderJson, callback: () => void) {
|
||||
try {
|
||||
let configFormValidResult = false;
|
||||
if (extraVisible.value) {
|
||||
// 如果此时配置抽屉是打开状态,则校验配置表单并写入最新表单数据
|
||||
await configFormRef.value?.validate((errors) => {
|
||||
if (!errors) {
|
||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||
if (node && node?.data && configForm.value) {
|
||||
node.data = {
|
||||
...node.data,
|
||||
...cloneDeep(configForm.value),
|
||||
};
|
||||
}
|
||||
configFormValidResult = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!configFormValidResult) return;
|
||||
loading.value = true;
|
||||
await editPlanMinder(makeMinderParams(fullJson));
|
||||
await editPlanMinder(makeMinderParams(extraVisible.value ? window.minder.exportJson() : fullJson));
|
||||
Message.success(t('common.saveSuccess'));
|
||||
emit('save');
|
||||
clearSelectedCases();
|
||||
@ -853,25 +889,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存测试点配置
|
||||
*/
|
||||
function handleConfigSave() {
|
||||
configFormRef.value?.validate((errors) => {
|
||||
if (!errors) {
|
||||
const node: MinderJsonNode = window.minder.getSelectedNode();
|
||||
if (node && node?.data && configForm.value) {
|
||||
node.data = {
|
||||
...node.data,
|
||||
...cloneDeep(configForm.value),
|
||||
};
|
||||
}
|
||||
// 派发SAVE_MINDER事件触发脑图的保存处理
|
||||
minderStore.dispatchEvent(MinderEventName.SAVE_MINDER);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function initResourcePoolList() {
|
||||
try {
|
||||
const res = await getPoolOption(appStore.currentProjectId);
|
||||
|
Loading…
Reference in New Issue
Block a user