fix(测试跟踪): 脑图添两级临时节点后,修改第一级为模块,保存后第二级丢失
--bug=1024774 --user=陈建星 【测试跟踪】github#23044,功能用例-脑图模式下,添加多级临时节点,修改第一级临时节点为模块,保存后,该节点下数据丢失 https://www.tapd.cn/55049933/s/1357891
This commit is contained in:
parent
3889c2c330
commit
773f4359c5
|
@ -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;
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue