From 2e4f6561b5a5b7b7ab9657ddb05a03605d161aa5 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 23 Jun 2022 17:20:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=88=B7=E6=96=B0=E5=90=8E=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E9=80=89=E6=8B=A9=E7=9A=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014311 --user=陈建星 【测试跟踪】测试计划功能用例选中某一模块,批量更改用例属性后,未选中该模块 https://www.tapd.cn/55049933/s/1189515 --- .../track/case/components/TestCaseList.vue | 3 +-- .../functional/FunctionalTestCaseList.vue | 16 +++++----------- .../comonents/functional/TestPlanFunctional.vue | 14 +++++++++++++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index a18c270ab5..06303da869 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -990,8 +990,7 @@ export default { }, refresh() { this.$refs.table.clear(); - this.condition.selectAll = false; - this.$emit('refresh'); + this.$emit('refreshAll'); }, refreshAll() { this.$refs.table.clear(); diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index e37403b5a4..cad1899e7c 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -631,13 +631,9 @@ export default { this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row, this.tableData); }, refresh() { - this.condition = {components: TEST_PLAN_TEST_CASE_CONFIGS}; this.$refs.table.clear(); - this.$emit('refresh'); - }, - breadcrumbRefresh() { - this.showMyTestCase = false; - this.refresh(); + this.search(); + this.$emit('refreshTree'); }, refreshTableAndPlan() { if (this.$refs.tableHeader) { @@ -683,8 +679,7 @@ export default { if (action === 'confirm') { let param = buildBatchParam(this, this.$refs.table.selectIds); this.$post('/test/plan/case/batch/delete', param, () => { - this.$refs.table.clear(); - this.$emit("refresh"); + this.refresh(); this.$success(this.$t('test_track.cancel_relevance_success')); }); } @@ -694,7 +689,7 @@ export default { _handleDelete(testCase) { let testCaseId = testCase.id; this.result = this.$post('/test/plan/case/delete/' + testCaseId, {}, () => { - this.$emit("refresh"); + this.refresh(); this.$success(this.$t('test_track.cancel_relevance_success')); }); }, @@ -738,11 +733,10 @@ export default { } param.ids = this.$refs.table.selectIds; this.$post('/test/plan/case/batch/edit', param, () => { - this.$refs.table.clear(); this.status = ''; this.$post('/test/plan/edit/status/' + this.planId); this.$success(this.$t('commons.save_success')); - this.$emit('refresh'); + this.refresh(); }); }, handleBatchEdit() { diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue b/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue index ad4dd21599..422dc35cd0 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/TestPlanFunctional.vue @@ -25,6 +25,7 @@ v-if="activeDom === 'left'" @openTestCaseRelevanceDialog="openTestCaseRelevanceDialog" @refresh="refresh" + @refreshTree="refreshTree" @setCondition="setCondition" :plan-id="planId" :plan-status="planStatus " @@ -90,7 +91,8 @@ export default { selectNode: {}, condition: {}, tmpActiveDom: null, - tmpPath: null + tmpPath: null, + currentNode: null }; }, props: [ @@ -128,6 +130,9 @@ export default { this.$refs.testCaseRelevance.search(); this.getNodeTreeByPlanId(); }, + refreshTree() { + this.getNodeTreeByPlanId(); + }, clearSelectNode() { this.selectNodeIds = []; this.$store.commit('setTestPlanViewSelectNode', {}); @@ -141,6 +146,7 @@ export default { nodeChange(node, nodeIds, pNodes) { this.selectNodeIds = nodeIds; this.$store.commit('setTestPlanViewSelectNode', node); + this.currentNode = node; // 切换node后,重置分页数 if (this.$refs.testPlanTestCaseList) { this.$refs.testPlanTestCaseList.currentPage = 1; @@ -155,9 +161,15 @@ export default { } this.result = this.$get(url, response => { this.treeNodes = response.data; + this.setCurrentKey(); }); } }, + setCurrentKey() { + if (this.$refs.nodeTree) { + this.$refs.nodeTree.setCurrentKey(this.currentNode); + } + }, setCondition(data) { this.condition = data; },