fix:修改首页topology图不显示的问题

This commit is contained in:
zhangyu
2021-06-03 10:02:45 +08:00
parent ae7368a4c5
commit c003467c3a
2 changed files with 44 additions and 36 deletions

View File

@@ -1710,15 +1710,18 @@ export default {
}) })
} else { } else {
this.imgageLoading = true this.imgageLoading = true
this.$get('monitor/project/topo/icon').then((imageAllId) => {
const promiseArr = [] const promiseArr = []
imgidList.forEach((item, index) => { imgidList.forEach((item, index) => {
if (item.data.imageId) { if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`)) promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`))
} else if (item.data.imageId) {
promiseArr.push(imgDefault)
} else { } else {
promiseArr.push('') promiseArr.push('')
} }
}) })
Promise.all(promiseArr).then(res2 => { Promise.all(promiseArr).then((res2) => {
this.iconArray = imgidList.map(item => { this.iconArray = imgidList.map(item => {
return { return {
id: item.data.imageId id: item.data.imageId
@@ -1732,6 +1735,7 @@ export default {
this.imgInit = true this.imgInit = true
this.imgageLoading = false this.imgageLoading = false
}) })
})
} }
}, },

View File

@@ -1710,15 +1710,18 @@ export default {
}) })
} else { } else {
this.imgageLoading = true this.imgageLoading = true
this.$get('monitor/project/topo/icon').then((imageAllId) => {
const promiseArr = [] const promiseArr = []
imgidList.forEach((item, index) => { imgidList.forEach((item, index) => {
if (item.data.imageId) { if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`)) promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`))
} else if (item.data.imageId) {
promiseArr.push(imgDefault)
} else { } else {
promiseArr.push('') promiseArr.push('')
} }
}) })
Promise.all(promiseArr).then(res2 => { Promise.all(promiseArr).then((res2) => {
this.iconArray = imgidList.map(item => { this.iconArray = imgidList.map(item => {
return { return {
id: item.data.imageId id: item.data.imageId
@@ -1732,6 +1735,7 @@ export default {
this.imgInit = true this.imgInit = true
this.imgageLoading = false this.imgageLoading = false
}) })
})
} }
}, },