diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 48562d87a0..dc7ef2dc44 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -109,7 +109,7 @@ :project-id="projectId" :condition="condition" v-if="activeDom === 'right'" - @refresh="refreshTable" + @refresh="refreshAll" ref="minder"/> @@ -123,7 +123,7 @@ 0) { + this.$store.commit('setTestCaseSelectNode', {}); + this.$store.commit('setTestCaseSelectNodeIds', []); + } + this.refreshAll(data); }, setTable(data) { if (data) { @@ -630,24 +625,12 @@ export default { } } }, - refreshAll() { - this.$refs.nodeTree.list(); - }, - openRecentTestCaseEditDialog(caseId) { - if (caseId) { - // this.getProjectByCaseId(caseId); - this.$get('/test/case/get/' + caseId, response => { - if (response.data) { - /* - this.$refs.testCaseEditDialog.open(response.data); - */ - } - }); - } else { - /* - this.$refs.testCaseEditDialog.open(); - */ + refreshAll(data) { + if (this.$refs.testCaseList) { + this.$refs.testCaseList.initTableData(); } + this.$refs.nodeTree.list(); + this.setTable(data); }, setTreeNodes(data) { this.treeNodes = data; diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 71c382fbc9..04bd48cfea 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -512,6 +512,9 @@ export default { selectNodeIds() { return this.$store.state.testCaseSelectNodeIds; }, + selectNode() { + return this.$store.state.testCaseSelectNode; + }, moduleOptions() { return this.$store.state.testCaseModuleOptions; }, @@ -712,20 +715,21 @@ export default { initTableData() { this.condition.planId = ""; this.condition.nodeIds = []; - //initCondition(this.condition); initCondition(this.condition, this.condition.selectAll); this.condition.orders = getLastTableSortField(this.tableHeaderKey); this.condition.versionId = this.currentVersion || null; this.enableOrderDrag = this.condition.orders.length > 0 ? false : true; if (this.planId) { - // param.planId = this.planId; this.condition.planId = this.planId; } + if (!this.trashEnable && !this.publicEnable) { if (this.selectNodeIds && this.selectNodeIds.length > 0) { - // param.nodeIds = this.selectNodeIds; - this.condition.nodeIds = this.selectNodeIds; + if (!this.selectNode || this.selectNode.data.id !== 'root') { + // 优化:如果当前选中节点是root节点,则不添加过滤条件 + this.condition.nodeIds = this.selectNodeIds; + } } } this.getData();