fix(接口测试): 修复编辑环境信息未更新的缺陷

--bug=1031139 --user=王孝刚 【接口测试】case-运行环境配置修改通用配置参数-返回test运行环境配置查看-未更新
https://www.tapd.cn/55049933/s/1423466
This commit is contained in:
wxg0103 2023-10-08 18:43:52 +08:00 committed by fit2-zhao
parent 4059568c67
commit f6c4c989cc
1 changed files with 5 additions and 2 deletions

View File

@ -190,14 +190,15 @@ export default {
this.$refs.environmentItems.itemSelected(this.environments.length - 1, newEnvironment);
},
environmentSelected(environment) {
this.$refs.environmentEdit.clearValidate();
if (this.$refs.environmentEdit) {
this.$refs.environmentEdit.clearValidate();
}
this.getEnvironment(environment);
},
getEnvironments() {
if (this.projectId) {
this.result = getEnvironmentByProjectId(this.projectId).then(response => {
this.environments = response.data;
this.currentEnvironment.id = null;
if (this.environments.length > 0) {
if (this.selectEnvironmentId) {
const index = this.environments.findIndex(e => e.id === this.selectEnvironmentId);
@ -228,6 +229,7 @@ export default {
},
save() {
this.$refs.environmentEdit.save();
this.currentEnvironment = null;
},
close() {
this.$emit('close');
@ -235,6 +237,7 @@ export default {
this.visible = false;
}
this.$refs.environmentEdit.clearValidate();
this.currentEnvironment = null;
removeGoBackListener(this.close);
this.isCopy = false;
},