From 9d0ba758de13d897c05a93abb24c8204828a0076 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 19 Jan 2022 17:10:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=94=A8=E4=BE=8B=E5=90=8E=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E5=9C=A8=E5=BD=93=E5=89=8D=E5=88=A0=E9=99=A4=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009751 --user=lyh 【测试跟踪】github#9467,删除用例页面进行了整体刷新未定位在当前删除目录 https://www.tapd.cn/55049933/s/1094528 Closes #9467 --- .../business/components/track/common/NodeTree.vue | 8 ++++++++ .../components/track/common/TestCaseNodeTree.vue | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index facbe23c9c..f958be13bd 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -464,6 +464,14 @@ export default { pNodes.push(rootNode.data); } }, + setCurrentKey(currentNode) { + if (currentNode && currentNode.data) { + this.$nextTick(() => { + this.handleNodeSelect(currentNode); + this.$refs.tree.setCurrentKey(currentNode.data.id); + }) + } + } } }; diff --git a/frontend/src/business/components/track/common/TestCaseNodeTree.vue b/frontend/src/business/components/track/common/TestCaseNodeTree.vue index 56c646ebb8..2fe920c686 100644 --- a/frontend/src/business/components/track/common/TestCaseNodeTree.vue +++ b/frontend/src/business/components/track/common/TestCaseNodeTree.vue @@ -94,7 +94,8 @@ export default { callback: this.handleExport, permissions: ['PROJECT_TRACK_CASE:READ+EXPORT'] } - ] + ], + currentNode: {} }; }, props: { @@ -147,11 +148,14 @@ export default { }, enableTrash() { this.condition.trashEnable = true; + // 隐藏公共用例库背景色 + this.condition.publicEnable = false; this.$emit('enableTrash', this.condition.trashEnable); this.$emit('toPublic', 'trash'); }, enablePublic() { this.condition.publicEnable = true; + this.condition.trashEnable = false; this.$emit('enablePublic', this.condition.publicEnable); this.$emit('toPublic', 'public'); }, @@ -166,9 +170,13 @@ export default { if (this.$refs.nodeTree) { this.$refs.nodeTree.filter(this.condition.filterText); } + this.setCurrentKey(); }); } }, + setCurrentKey() { + this.$refs.nodeTree.setCurrentKey(this.currentNode); + }, increase(id) { this.$refs.nodeTree.increase(id); }, @@ -238,9 +246,12 @@ export default { this.$store.commit('setTestCaseSelectNode', node); this.$store.commit('setTestCaseSelectNodeIds', nodeIds); + this.condition.trashEnable = false; + this.condition.publicEnable = false; this.$emit("nodeSelectEvent", node, nodeIds, pNodes); this.currentModule = node.data; + this.currentNode = node; if (node.data.id === 'root') { this.$emit("nodeSelectEvent", node, [], pNodes); } else {