fix(测试跟踪): 脑图保存用例丢失

--bug=1011813 --user=陈建星 【测试跟踪】-github#12143 脑图新增标题后,点击报存,在设置为用例后,多次点击保存,新增的用例出现丢失 https://www.tapd.cn/55049933/s/1128031
This commit is contained in:
chenjianxing 2022-03-31 11:53:28 +08:00 committed by 刘瑞斌
parent 3ff123f425
commit ae85956bd1
1 changed files with 8 additions and 1 deletions

View File

@ -75,7 +75,8 @@ name: "TestCaseMinder",
saveModules: [], saveModules: [],
saveModuleNodeMap: new Map(), saveModuleNodeMap: new Map(),
deleteNodes: [], // deleteNodes: [], //
saveExtraNode: {} saveExtraNode: {},
extraNodeChanged: [] //
} }
}, },
props: { props: {
@ -215,6 +216,10 @@ name: "TestCaseMinder",
this.result = this.$post('/test/case/minder/edit', param, () => { this.result = this.$post('/test/case/minder/edit', param, () => {
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
handleAfterSave(window.minder.getRoot()); handleAfterSave(window.minder.getRoot());
this.extraNodeChanged.forEach(item => {
item.isExtraNode = false;
});
this.extraNodeChanged = [];
this.$emit('refresh'); this.$emit('refresh');
this.setIsChange(false); this.setIsChange(false);
}); });
@ -285,6 +290,7 @@ name: "TestCaseMinder",
// //
this.pushDeleteNode(data); this.pushDeleteNode(data);
module.id = null; module.id = null;
this.extraNodeChanged.push(data);
} }
if (data.type === 'case') { if (data.type === 'case') {
@ -410,6 +416,7 @@ name: "TestCaseMinder",
// //
this.pushDeleteNode(data); this.pushDeleteNode(data);
testCase.id = null; testCase.id = null;
this.extraNodeChanged.push(data);
} }
if (isChange) { if (isChange) {