From 8d8292227fe531370dbb2d2e78d6b89f2fe5ae23 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 29 Dec 2020 14:15:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../automation/scenario/api/ApiCaseList.vue | 337 -------------- .../automation/scenario/api/ApiDefinition.vue | 150 ------- .../api/automation/scenario/api/ApiList.vue | 412 ------------------ .../automation/scenario/api/ApiRelevance.vue | 4 +- ...evanceApiList.vue => RelevanceApiList.vue} | 21 +- ...anceCaseList.vue => RelevanceCaseList.vue} | 24 +- .../scenario/api/ScenarioRelevance.vue | 4 +- .../components/list/ApiCaseSimpleList.vue | 133 +----- .../definition/components/list/ApiList.vue | 25 +- .../comonents/api/TestCaseApiRelevance.vue | 38 +- .../comonents/base/TestCaseRelevanceBase.vue | 110 ++--- frontend/src/common/js/tableUtils.js | 11 +- 13 files changed, 97 insertions(+), 1174 deletions(-) delete mode 100644 frontend/src/business/components/api/automation/scenario/api/ApiCaseList.vue delete mode 100644 frontend/src/business/components/api/automation/scenario/api/ApiDefinition.vue delete mode 100644 frontend/src/business/components/api/automation/scenario/api/ApiList.vue rename frontend/src/business/components/api/automation/scenario/api/{ScenarioRelevanceApiList.vue => RelevanceApiList.vue} (93%) rename frontend/src/business/components/api/automation/scenario/api/{ScenarioRelevanceCaseList.vue => RelevanceCaseList.vue} (91%) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index c10b11f224..f27d1609d7 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit c10b11f224e4186306e6ae3a3976e29a42af96a5 +Subproject commit f27d1609d77f7d6c988d37d709466e844d350e17 diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/ApiCaseList.vue deleted file mode 100644 index 85bca98545..0000000000 --- a/frontend/src/business/components/api/automation/scenario/api/ApiCaseList.vue +++ /dev/null @@ -1,337 +0,0 @@ - - - - diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiDefinition.vue b/frontend/src/business/components/api/automation/scenario/api/ApiDefinition.vue deleted file mode 100644 index 3dec4fafcb..0000000000 --- a/frontend/src/business/components/api/automation/scenario/api/ApiDefinition.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiList.vue b/frontend/src/business/components/api/automation/scenario/api/ApiList.vue deleted file mode 100644 index f0951dcf9f..0000000000 --- a/frontend/src/business/components/api/automation/scenario/api/ApiList.vue +++ /dev/null @@ -1,412 +0,0 @@ - - - - - diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue index 27ceb47950..9bf29fdb91 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue @@ -36,12 +36,12 @@ diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue similarity index 91% rename from frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue rename to frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue index 546abcf4d2..5eea52ad38 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue @@ -4,6 +4,8 @@ :is-api-list-enable="isApiListEnable" @isApiListEnableChange="isApiListEnableChange"> + + { this.total = response.data.itemCount; this.tableData = response.data.listObject; @@ -209,6 +222,9 @@ this.$refs.caseList.open(selectApi, testCase.id); }); }, + setEnvironment(data) { + this.environmentId = data.id; + } }, } diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue index 42df3555c8..2cf19af777 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue @@ -27,12 +27,12 @@ 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 57693c9f1a..a4d9f046f4 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 @@ -12,42 +12,30 @@ @protocolChange="handleProtocolChange" @refreshTable="refresh" @setModuleOptions="setModuleOptions" - :relevance-project-id="projectId" :is-read-only="true" - :type="'edit'" ref="nodeTree"/> - - - - - @@ -56,15 +44,14 @@ import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase"; import MsApiModule from "../../../../../api/definition/components/module/ApiModule"; - import {getCurrentProjectID} from "../../../../../../../common/js/utils"; - import ApiList from "../../../../../api/definition/components/list/ApiList"; - import ApiCaseSimpleList from "../../../../../api/definition/components/list/ApiCaseSimpleList"; + import RelevanceApiList from "../../../../../api/automation/scenario/api/RelevanceApiList"; + import RelevanceCaseList from "../../../../../api/automation/scenario/api/RelevanceCaseList"; export default { name: "TestCaseApiRelevance", components: { - ApiCaseSimpleList, - ApiList, + RelevanceCaseList, + RelevanceApiList, MsApiModule, TestCaseRelevanceBase, }, @@ -145,11 +132,6 @@ param.planId = this.planId; param.selectIds = selectIds; param.environmentId = environmentId; - // param.request = this.condition; - // 选择全选则全部加入到评审,无论是否加载完全部 - // if (this.testCases.length === param.testCaseIds.length) { - // param.testCaseIds = ['all']; - // } this.result = this.$post(url, param, () => { this.$success(this.$t('commons.save_success')); diff --git a/frontend/src/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase.vue b/frontend/src/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase.vue index 6be80f9c4e..e2a3f23ffc 100644 --- a/frontend/src/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase.vue +++ b/frontend/src/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase.vue @@ -1,55 +1,45 @@ diff --git a/frontend/src/common/js/tableUtils.js b/frontend/src/common/js/tableUtils.js index 44ed9b0cfa..fcd06333bd 100644 --- a/frontend/src/common/js/tableUtils.js +++ b/frontend/src/common/js/tableUtils.js @@ -29,12 +29,7 @@ export function _handleSelect(component, selection, row, selectRows) { selectRows.add(row); } let arr = Array.from(selectRows); - // 选中1个以上的用例时显示更多操作 - if (selectRows.size === 1) { - component.$set(arr[0], "showMore", false); - } else if (selectRows.size === 2) { - arr.forEach(row => { - component.$set(row, "showMore", true); - }) - } + arr.forEach(row => { + component.$set(row, "showMore", true); + }) }