From a8fcadbd1d1e3117b9659d1eea6cac82ea022487 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 25 May 2021 20:50:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/api/RelevanceApiList.vue | 8 +- .../scenario/api/RelevanceCaseList.vue | 93 ++++++------------- .../comonents/api/RelevanceScenarioList.vue | 3 + .../comonents/api/TestCaseApiRelevance.vue | 6 ++ .../api/TestCaseScenarioRelevance.vue | 1 + 5 files changed, 42 insertions(+), 69 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue index 1bbf85857f..40bab5edd2 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue @@ -165,7 +165,6 @@ import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn"; import MsBatchEdit from "../../../definition/components/basis/BatchEdit"; import {API_METHOD_COLOUR, CASE_PRIORITY} from "../../../definition/model/JsonData"; - import {getCurrentProjectID} from "@/common/js/utils"; import ApiListContainer from "../../../definition/components/list/ApiListContainer"; import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem"; import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect"; @@ -319,7 +318,7 @@ if (item.tags && item.tags.length > 0) { item.tags = JSON.parse(item.tags); } - }); + }); this.genProtocalFilter(this.condition.protocol); this.$nextTick(function () { if (this.$refs.apitable) { @@ -419,6 +418,11 @@ let param = buildBatchParam(this); param.ids = Array.from(sampleSelectRows).map(row => row.id); return param; + }, + clear() { + if (this.$refs.apitable) { + this.$refs.apitable.clear(); + } } }, } diff --git a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue index 45d027508f..e8a109ff2a 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue @@ -99,51 +99,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -302,28 +257,32 @@ export default { }); }); getLabel(this, API_CASE_LIST); - }, - - showExecResult(row) { - this.visible = false; - this.$emit('showExecResult', row); - }, - filter(filters) { - _filter(filters, this.condition); - this.initTable(); - }, - sort(column) { - // 每次只对一个字段排序 - if (this.condition.orders) { - this.condition.orders = []; - } - _sort(column, this.condition); - this.initTable(); - }, - buildPagePath(path) { - return path + "/" + this.currentPage + "/" + this.pageSize; - }, - handleTestCase(testCase) { + }, + clear() { + if (this.$refs.table) { + this.$refs.table.clear(); + } + }, + showExecResult(row) { + this.visible = false; + this.$emit('showExecResult', row); + }, + filter(filters) { + _filter(filters, this.condition); + this.initTable(); + }, + sort(column) { + // 每次只对一个字段排序 + if (this.condition.orders) { + this.condition.orders = []; + } + _sort(column, this.condition); + this.initTable(); + }, + buildPagePath(path) { + return path + "/" + this.currentPage + "/" + this.pageSize; + }, + handleTestCase(testCase) { this.$get('/api/definition/get/' + testCase.apiDefinitionId, (response) => { let api = response.data; let selectApi = api; diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue index fbe1616f55..32f7bd3474 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue @@ -156,6 +156,9 @@ }); }); }, + clear() { + this.selectRows.clear(); + }, handleSelectAll(selection) { _handleSelectAll(this, selection, this.tableData, this.selectRows); this.initProjectIds(); diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue index c277f8183d..3792f6b15d 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue @@ -86,6 +86,12 @@ open() { this.init(); this.$refs.baseRelevance.open(); + if (this.$refs.apiList) { + this.$refs.apiList.clear(); + } + if (this.$refs.apiCaseList) { + this.$refs.apiCaseList.clear(); + } }, init() { if (this.$refs.apiList) { diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue index 5dcf7a01a2..77d8d85357 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue @@ -76,6 +76,7 @@ open() { this.$refs.baseRelevance.open(); if (this.$refs.apiScenarioList) { + this.$refs.apiScenarioList.clear(); this.$refs.apiScenarioList.search(); } },