fix(接口测试): 修复环境下拉框数据没有刷新的缺陷

--bug=1021366 --user=王孝刚 【接口测试】在接口TEST/CASE等页面更新环境后,接口定义右上角的环境下拉框没更新
https://www.tapd.cn/55049933/s/1321539
This commit is contained in:
wxg0103 2022-12-30 14:54:13 +08:00 committed by fit2-zhao
parent 648cc80439
commit 6ab04cef70
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,7 @@
:placeholder="$t('api_test.definition.request.run_env')" :placeholder="$t('api_test.definition.request.run_env')"
clearable clearable
filterable filterable
@click.native="refreshEnv"
@clear="clear"> @clear="clear">
<el-option <el-option
v-for="(environment, key) in environments" v-for="(environment, key) in environments"
@ -66,6 +67,9 @@ export default {
}, },
}, },
methods: { methods: {
refreshEnv() {
this.getEnvironments();
},
refreshEnvironment() { refreshEnvironment() {
this.$emit('setEnvironment', this.environment); this.$emit('setEnvironment', this.environment);
}, },

View File

@ -6,6 +6,7 @@
class="ms-htt-width" class="ms-htt-width"
:placeholder="$t('api_test.definition.request.run_env')" :placeholder="$t('api_test.definition.request.run_env')"
filterable filterable
@click.native="refreshEnv"
@change="environmentChange" @change="environmentChange"
clearable> clearable>
<el-option <el-option
@ -54,6 +55,9 @@ export default {
this.getEnvironments(); this.getEnvironments();
}, },
methods: { methods: {
refreshEnv() {
this.getEnvironments();
},
getEnvironments() { getEnvironments() {
if (this.projectId) { if (this.projectId) {
getEnvironmentByProjectId(this.projectId).then((response) => { getEnvironmentByProjectId(this.projectId).then((response) => {