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()); this.$refs.environmentConfig.open(getCurrentProjectID());
}, },
initDataSource() { initDataSource() {
let flag = false;
for (let i in this.environments) { for (let i in this.environments) {
if (this.environments[i].id === this.request.environmentId) { if (this.environments[i].id === this.request.environmentId) {
this.databaseConfigsOptions = []; this.databaseConfigsOptions = [];
this.environments[i].config.databaseConfigs.forEach(item => { this.environments[i].config.databaseConfigs.forEach(item => {
if (item.id === this.request.dataSourceId) {
flag = true;
}
this.databaseConfigsOptions.push(item); this.databaseConfigsOptions.push(item);
}); });
break; break;
} }
} }
if (!flag) {
this.request.dataSourceId = undefined;
}
}, },
setDataSource() { setDataSource() {
for (let item of this.databaseConfigsOptions) { for (let item of this.databaseConfigsOptions) {