style(接口自动化): 修复数据源被删除显示问题

This commit is contained in:
fit2-zhao 2021-01-28 13:47:42 +08:00
parent 50ea7f76bf
commit 04e30ba664
1 changed files with 7 additions and 0 deletions

View File

@ -235,15 +235,22 @@
this.$refs.environmentConfig.open(getCurrentProjectID());
},
initDataSource() {
let flag = false;
for (let i in this.environments) {
if (this.environments[i].id === this.request.environmentId) {
this.databaseConfigsOptions = [];
this.environments[i].config.databaseConfigs.forEach(item => {
if (item.id === this.request.dataSourceId) {
flag = true;
}
this.databaseConfigsOptions.push(item);
});
break;
}
}
if (!flag) {
this.request.dataSourceId = undefined;
}
},
setDataSource() {
for (let item of this.databaseConfigsOptions) {