fix(测试计划): 关联接口用例问题#1005504

--bug=1005504 --user=lyh
【github#5051】测试计划>>关联接口测试用例>>跨项目选择接口测试用例,运行环境指定,确定。运行时多个项目的接口运行环境异常
https://www.tapd.cn/55049933/s/1035737
This commit is contained in:
shiziyuan9527 2021-08-17 16:53:45 +08:00 committed by 刘瑞斌
parent ff1ac93fa3
commit 5c5a834c4f
3 changed files with 23 additions and 2 deletions

View File

@ -5,7 +5,7 @@
@isApiListEnableChange="isApiListEnableChange"> @isApiListEnableChange="isApiListEnableChange">
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly" <ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment"/> @setEnvironment="setEnvironment" ref="msEnvironmentSelect"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable" class="search-input" size="small" <el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable" class="search-input" size="small"
@keyup.enter.native="initTable" v-model="condition.name"/> @keyup.enter.native="initTable" v-model="condition.name"/>
@ -374,6 +374,13 @@
if (this.$refs.apitable) { if (this.$refs.apitable) {
this.$refs.apitable.clear(); this.$refs.apitable.clear();
} }
},
clearEnvAndSelect() {
this.environmentId = "";
if (this.$refs.msEnvironmentSelect) {
this.$refs.msEnvironmentSelect.environmentId = "";
}
this.clear();
} }
}, },
} }

View File

@ -5,7 +5,7 @@
@isApiListEnableChange="isApiListEnableChange"> @isApiListEnableChange="isApiListEnableChange">
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly" <ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment"/> @setEnvironment="setEnvironment" ref="msEnvironmentSelect"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable" <el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/> @keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
@ -241,6 +241,13 @@ export default {
this.$refs.table.clear(); this.$refs.table.clear();
} }
}, },
clearEnvAndSelect() {
this.environmentId = "";
if (this.$refs.msEnvironmentSelect) {
this.$refs.msEnvironmentSelect.environmentId = "";
}
this.clear();
},
showExecResult(row) { showExecResult(row) {
this.visible = false; this.visible = false;
this.$emit('showExecResult', row); this.$emit('showExecResult', row);

View File

@ -105,6 +105,13 @@
} }
}, },
setProject(projectId) { setProject(projectId) {
//
if (this.$refs.apiList) {
this.$refs.apiList.clearEnvAndSelect();
}
if (this.$refs.apiCaseList) {
this.$refs.apiCaseList.clearEnvAndSelect();
}
this.projectId = projectId; this.projectId = projectId;
}, },
isApiListEnableChange(data) { isApiListEnableChange(data) {