fix(场景自动化): 运行环境显示问题

This commit is contained in:
shiziyuan9527 2021-03-31 12:12:13 +08:00
parent a555ddd334
commit a21c611d35
1 changed files with 17 additions and 14 deletions

View File

@ -54,20 +54,23 @@
methods: {
init() {
this.projectIds.forEach(id => {
let item = {id: id, envs: [], selectEnv: ""};
this.data.push(item);
this.result = this.$get('/api/environment/list/' + id, res => {
let envs = res.data;
envs.forEach(environment => {
parseEnvironment(environment);
});
//
let temp = this.data.find(dt => dt.id === id);
temp.envs = envs;
let envId = this.envMap.get(id);
//
temp.selectEnv = envs.filter(e => e.id === envId).length === 0 ? null : envId;
})
const project = this.projectList.find(p => p.id === id);
if (project) {
let item = {id: id, envs: [], selectEnv: ""};
this.data.push(item);
this.result = this.$get('/api/environment/list/' + id, res => {
let envs = res.data;
envs.forEach(environment => {
parseEnvironment(environment);
});
//
let temp = this.data.find(dt => dt.id === id);
temp.envs = envs;
let envId = this.envMap.get(id);
//
temp.selectEnv = envs.filter(e => e.id === envId).length === 0 ? null : envId;
})
}
})
},
open() {