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) {