fix(接口测试): 修复环境配置复制环境,复制成功后页面关闭的缺陷 (#16828)

--bug=1015758 --user=王孝刚 【接口测试】github#16797,环境配置,点击复制环境,复制成功,但环境配置窗口关闭了
https://www.tapd.cn/55049933/s/1222041

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-08-12 15:25:27 +08:00 committed by GitHub
parent 2d2b56767a
commit fd270db2ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View File

@ -67,7 +67,8 @@ export default {
selectEnvironmentId: '',
ifCreate: false, //
delDialogVisible: false,
currentIndex: -1
currentIndex: -1,
isCopy: false
}
},
computed: {
@ -103,6 +104,7 @@ export default {
},
copyEnvironment(environment) {
this.ifCreate = false;
this.isCopy = true;
this.currentEnvironment = environment;
if (!environment.id) {
this.$warning(this.$t('commons.please_save'));
@ -116,7 +118,7 @@ export default {
return;
}
this.$refs.environmentEdit._save(newEnvironment);
this.environments.push(newEnvironment);
this.environments.unshift(newEnvironment);
this.$refs.environmentItems.itemSelected(this.environments.length - 1, newEnvironment);
},
validateEnvironment(environment) {
@ -179,9 +181,12 @@ export default {
},
close() {
this.$emit('close');
this.visible = false;
if (!this.isCopy) {
this.visible = false;
}
this.$refs.environmentEdit.clearValidate();
removeGoBackListener(this.close);
this.isCopy = false;
},
openDelEnv(environment, index) {
this.currentEnvironment = environment;

View File

@ -72,7 +72,8 @@ export default {
selectEnvironmentId: '',
ifCreate: false, //
delDialogVisible: false,
currentIndex: -1
currentIndex: -1,
isCopy: false
}
},
props: {
@ -129,6 +130,7 @@ export default {
},
copyEnvironment(environment) {
this.ifCreate = false;
this.isCopy = true;
//
this.environmentSelected(environment);
this.currentEnvironment = environment;
@ -144,7 +146,7 @@ export default {
return;
}
this.$refs.environmentEdit._save(newEnvironment);
this.environments.push(newEnvironment);
this.environments.unshift(newEnvironment);
this.$refs.environmentItems.itemSelected(this.environments.length - 1, newEnvironment);
},
validateEnvironment(environment) {
@ -210,9 +212,12 @@ export default {
},
close() {
this.$emit('close');
this.visible = false;
if (!this.isCopy) {
this.visible = false;
}
this.$refs.environmentEdit.clearValidate();
removeGoBackListener(this.close);
this.isCopy = false;
},
openDelEnv(environment, index) {
this.currentEnvironment = environment;