fix(测试跟踪): 点击左侧树节点, 刷新多次并导致重定向问题

This commit is contained in:
song-cc-rock 2023-11-20 17:12:10 +08:00 committed by Craftsman
parent 8647eaaecb
commit 57821854f6
2 changed files with 10 additions and 1 deletions

View File

@ -210,7 +210,8 @@ export default {
if (this.isMinderMode) { if (this.isMinderMode) {
this.forceSetCurrentKey(); this.forceSetCurrentKey();
} else { } else {
this.setCurrentKey(); // , Key, Tree
this.justSetCurrentKey();
} }
} }
}); });
@ -245,6 +246,11 @@ export default {
this.$refs.nodeTree.setCurrentKey(this.currentNode); this.$refs.nodeTree.setCurrentKey(this.currentNode);
} }
}, },
justSetCurrentKey() {
if (this.$refs.nodeTree) {
this.$refs.nodeTree.justSetCurrentKey(this.currentNode.data.id)
}
},
// currentNode currentNode // currentNode currentNode
forceSetCurrentKey() { forceSetCurrentKey() {
if (this.$refs.nodeTree && this.currentNode && this.currentNode.data) { if (this.$refs.nodeTree && this.currentNode && this.currentNode.data) {

View File

@ -65,6 +65,9 @@ export default {
if (this.$refs.publicNodeTree) { if (this.$refs.publicNodeTree) {
this.publicTreeNodes.forEach(firstLevel => { this.publicTreeNodes.forEach(firstLevel => {
this.$refs.publicNodeTree.nodeExpand(firstLevel); this.$refs.publicNodeTree.nodeExpand(firstLevel);
if (this.$refs.publicNodeTree) {
this.$refs.publicNodeTree.justSetCurrentKey(store.testCasePublicSelectNode.data.id);
}
}) })
} }
}); });