fix(测试跟踪): 脑图添两级临时节点后,修改第一级为模块,保存后第二级丢失

--bug=1024774 --user=陈建星 【测试跟踪】github#23044,功能用例-脑图模式下,添加多级临时节点,修改第一级临时节点为模块,保存后,该节点下数据丢失 https://www.tapd.cn/55049933/s/1357891
This commit is contained in:
chenjianxing 2023-03-30 20:19:07 +08:00 committed by jianxing
parent 02d528b559
commit 366a5a4826
3 changed files with 32 additions and 3 deletions

View File

@ -482,7 +482,7 @@ export default {
if (this.$refs.testCaseList) {
this.$refs.testCaseList.initTableData();
}
this.$refs.nodeTree.list();
this.$refs.nodeTree.list({ isForceSetCurrentKey: true });
},
toggleMinderFullScreen(isFullScreen) {
this.enableAsideHidden = isFullScreen;

View File

@ -102,6 +102,7 @@ export default {
needRefresh: false,
noRefresh: false,
noRefreshMinder: false,
noRefreshMinderForSelectNode: false,
saveCases: [],
saveModules: [],
saveModuleNodeMap: new Map(),
@ -143,6 +144,11 @@ export default {
},
watch: {
selectNode() {
if (this.noRefreshMinderForSelectNode) {
//
this.noRefreshMinderForSelectNode = false;
return;
}
if (this.$refs.minder) {
this.caseNum = this.selectNode.data.caseNum;
this.$refs.minder.handleNodeSelect(this.selectNode);
@ -340,6 +346,10 @@ export default {
//
//
this.noRefreshMinder = true;
if (this.selectNode && this.selectNode.data) {
// watch -> selectNode
this.noRefreshMinderForSelectNode = true;
}
}
//
this.noRefresh = false;
@ -418,6 +428,15 @@ export default {
this.pushDeleteNode(data);
module.id = null;
this.extraNodeChanged.push(data);
if (node.children) {
//
node.children.forEach((child) => {
if (child.data.isExtraNode) {
child.data.changed = true;
child.data.id = null;
}
});
}
}
if (data.type === 'case') {

View File

@ -166,7 +166,7 @@ export default {
this.$emit('enablePublic', this.condition.publicEnable);
this.$emit('toPublic', 'public');
},
list() {
list({ isForceSetCurrentKey } = {}) {
if (this.projectId) {
this.caseCondition.casePublic = false;
this.loading = true;
@ -193,7 +193,11 @@ export default {
});
}
} else {
this.setCurrentKey();
if (isForceSetCurrentKey) {
this.forceSetCurrentKey();
} else {
this.setCurrentKey();
}
}
});
}
@ -223,6 +227,12 @@ export default {
this.$refs.nodeTree.setCurrentKey(this.currentNode);
}
},
// currentNode currentNode
forceSetCurrentKey() {
if (this.$refs.nodeTree && this.currentNode) {
this.$refs.nodeTree.setCurrentKeyById(this.currentNode.data.id);
}
},
increase(id) {
this.$refs.nodeTree.increase(id);
},