From 5c5a834c4f99986c0022c863ca3870b3f0039014 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 17 Aug 2021 16:53:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98#1005504?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005504 --user=lyh 【github#5051】测试计划>>关联接口测试用例>>跨项目选择接口测试用例,运行环境指定,确定。运行时多个项目的接口运行环境异常 https://www.tapd.cn/55049933/s/1035737 --- .../api/automation/scenario/api/RelevanceApiList.vue | 9 ++++++++- .../api/automation/scenario/api/RelevanceCaseList.vue | 9 ++++++++- .../plan/view/comonents/api/TestCaseApiRelevance.vue | 7 +++++++ 3 files changed, 23 insertions(+), 2 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 72a4b258fa..30f1efcaf8 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceApiList.vue @@ -5,7 +5,7 @@ @isApiListEnableChange="isApiListEnableChange"> + @setEnvironment="setEnvironment" ref="msEnvironmentSelect"/> @@ -374,6 +374,13 @@ if (this.$refs.apitable) { this.$refs.apitable.clear(); } + }, + clearEnvAndSelect() { + this.environmentId = ""; + if (this.$refs.msEnvironmentSelect) { + this.$refs.msEnvironmentSelect.environmentId = ""; + } + this.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 21d90fd9d4..2b46b5a39e 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue @@ -5,7 +5,7 @@ @isApiListEnableChange="isApiListEnableChange"> + @setEnvironment="setEnvironment" ref="msEnvironmentSelect"/> @@ -241,6 +241,13 @@ export default { this.$refs.table.clear(); } }, + clearEnvAndSelect() { + this.environmentId = ""; + if (this.$refs.msEnvironmentSelect) { + this.$refs.msEnvironmentSelect.environmentId = ""; + } + this.clear(); + }, showExecResult(row) { this.visible = false; this.$emit('showExecResult', row); 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 3792f6b15d..6d6628320d 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 @@ -105,6 +105,13 @@ } }, setProject(projectId) { + // 切换项目 清空环境和选中行 + if (this.$refs.apiList) { + this.$refs.apiList.clearEnvAndSelect(); + } + if (this.$refs.apiCaseList) { + this.$refs.apiCaseList.clearEnvAndSelect(); + } this.projectId = projectId; }, isApiListEnableChange(data) {