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