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) {
this.forceSetCurrentKey();
} else {
this.setCurrentKey();
// , Key, Tree
this.justSetCurrentKey();
}
}
});
@ -245,6 +246,11 @@ export default {
this.$refs.nodeTree.setCurrentKey(this.currentNode);
}
},
justSetCurrentKey() {
if (this.$refs.nodeTree) {
this.$refs.nodeTree.justSetCurrentKey(this.currentNode.data.id)
}
},
// currentNode currentNode
forceSetCurrentKey() {
if (this.$refs.nodeTree && this.currentNode && this.currentNode.data) {

View File

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