From 62c7c00c0493d2f2132dc6f77c61806a0b3e6219 Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Thu, 24 Dec 2020 10:36:32 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E6=8E=A5=E5=8F=A3/=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=9F=A5=E7=9C=8B=E5=BC=95=E7=94=A8=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=AE=A1=E5=88=92=E6=98=BE=E7=A4=BA=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复接口/场景查看引用的测试计划显示重复的问题的问题 --- .../java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml index e3dbb2b706..9b757043a1 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml @@ -231,6 +231,7 @@ + + \ No newline at end of file diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index c9bb269508..564b195bff 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -201,11 +201,7 @@ - - - {{$t('api_test.scenario.reference')}} - {{ $t('commons.copy') }} - + @@ -260,6 +256,7 @@ import ApiImport from "../../definition/components/import/ApiImport"; import InputTag from 'vue-input-tag' import "@/common/css/material-icons.css" + import ScenarioApiRelevance from "./api/ScenarioApiRelevance"; export default { name: "EditApiScenario", @@ -268,6 +265,7 @@ currentScenario: {}, }, components: { + ScenarioApiRelevance, ApiEnvironmentConfig, MsScenarioParameters, MsApiReportDetail, @@ -279,7 +277,6 @@ MsIfController, MsApiAssertions, MsApiExtract, - MsApiDefinition, MsApiComponent, MsApiCustomize, ApiImport, @@ -323,7 +320,6 @@ debugData: {}, reportId: "", projectId: "", - visibleRef: "", enableCookieShare: false, } } @@ -518,8 +514,7 @@ } , apiListImport() { - this.visibleRef = getUUID(); - this.apiListVisible = true; + this.$refs.scenarioApiRelevance.open(); } , recursiveSorting(arr) { @@ -599,20 +594,10 @@ } } , - pushApiOrCase(referenced) { - if (this.currentRow.cases.length === 0 && this.currentRow.apis.length === 0) { - this.$warning(this.$t('api_test.automation.reference_info')); - return; - } - this.currentRow.cases.forEach(item => { - this.setApiParameter(item, "CASE", referenced); - }) - this.currentRow.apis.forEach(item => { - this.setApiParameter(item, "API", referenced); - }) - this.apiListVisible = false; - this.currentRow.cases = []; - this.currentRow.apis = []; + pushApiOrCase(data, refType, referenced) { + data.forEach(item => { + this.setApiParameter(item, refType, referenced); + }); this.sort(); this.reload(); } diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioApiRelevance.vue new file mode 100644 index 0000000000..185fc3df58 --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioApiRelevance.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceApiList.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceApiList.vue new file mode 100644 index 0000000000..83a0c956ca --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceApiList.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue new file mode 100644 index 0000000000..b4452b8964 --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevanceCaseList.vue @@ -0,0 +1,239 @@ + + + + + From 54247fc15cf0304de4a5d69cab9efe3df3f23e28 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 24 Dec 2020 11:40:41 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../api/definition/components/list/ApiCaseSimpleList.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 79343a2763..9f4a9bbf46 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 79343a2763b014355f91fc21b2356a95ae437973 +Subproject commit 9f4a9bbf46fc1333dbcccea21f83e27e3ec10b1f diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index 787c5053ff..811a046091 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -273,7 +273,7 @@ } else if (this.isRelevanceModel) { return '/api/testcase/delete/' + apiCase.id; } else { - return '/api/testcase/delete/' + +apiCase.id; + return '/api/testcase/delete/' + apiCase.id; } }, // getMaintainerOptions() { From 611b1e3c972cec56f4e5aa375c85fd9101dcb5e2 Mon Sep 17 00:00:00 2001 From: q4speed Date: Thu, 24 Dec 2020 11:45:15 +0800 Subject: [PATCH 7/8] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=92=8CFAB=E6=8C=89=E9=92=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 1574 +++++++++-------- frontend/src/common/js/outside-click.js | 31 + 2 files changed, 837 insertions(+), 768 deletions(-) create mode 100644 frontend/src/common/js/outside-click.js diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index c9bb269508..18d04c2c67 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1,41 +1,42 @@ diff --git a/frontend/src/common/js/outside-click.js b/frontend/src/common/js/outside-click.js new file mode 100644 index 0000000000..7431be960d --- /dev/null +++ b/frontend/src/common/js/outside-click.js @@ -0,0 +1,31 @@ +const OutsideClick = { + // 初始化指令 + bind(el, binding, vnode) { + function documentHandler(e) { + // 这里判断点击的元素是否是本身,是本身,则返回 + if (el.contains(e.target)) { + return false; + } + // 判断指令中是否绑定了函数 + if (binding.expression) { + // 如果绑定了函数 则调用那个函数,此处binding.value就是handleClose方法 + binding.value(e); + } + } + + // 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听 + el.__vueClickOutside__ = documentHandler; + document.addEventListener('click', documentHandler); + }, + update() { + }, + unbind(el, binding) { + // 解除事件监听 + document.removeEventListener('click', el.__vueClickOutside__); + delete el.__vueClickOutside__; + }, +}; + +export default OutsideClick; + + From 79d38eb9d8d0ecc06879ea058b9ef5a497f01c22 Mon Sep 17 00:00:00 2001 From: q4speed Date: Thu, 24 Dec 2020 12:09:18 +0800 Subject: [PATCH 8/8] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96):=20=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 564b195bff..5b8acd388c 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1,6 +1,6 @@