NEZ-2756 fix: 修改首页topo 图片较少不加载的问题

This commit is contained in:
zhangyu
2023-04-07 15:13:37 +08:00
parent fb110fd083
commit 83fff0a369
5 changed files with 18 additions and 7 deletions

View File

@@ -17,6 +17,7 @@
:show-zoom="false"
class="meta2d-chart"
:is-chart="true"
:iconArray="iconArray"
:ref="'topology' + index"
/>
</el-carousel-item>
@@ -37,7 +38,8 @@ export default {
data () {
return {
topologyLoading: false,
allProject: []
allProject: [],
iconArray: []
}
},
mixins: [chartMixin],
@@ -136,6 +138,9 @@ export default {
},
mounted () {
// this.queryAllProjectData()
this.$get('/topology/icon').then(res => {
this.iconArray = [...res.data.list]
})
},
beforeDestroy () {
this.allProject = []

View File

@@ -4,7 +4,8 @@ export default {
topoData: {},
querysArray: [],
meta2dType: '',
params: {}
params: {},
iconArray: []
}
},
watch: {

View File

@@ -74,7 +74,6 @@ export default {
offsetX: 0,
offsetY: 0,
moduleId: '',
iconArray: []
}
},
mixins: [topoUtil],
@@ -121,9 +120,6 @@ export default {
// meta2d.on('add', this.appPen) // 添加新画笔·
meta2d.on('click', this.topoClick) // click画笔·
setTopology(this.meta2dId, meta2d)
this.$get('/topology/icon').then(res => {
this.iconArray = [...res.data.list]
})
this.reload()
},
reload () {

View File

@@ -126,6 +126,12 @@ export default {
mixins: [meta2dMain, topoUtil],
props: {
meta2dId: {}, // 唯一id 不可重复
iconArray: {
type: Array,
default: () => {
return []
}
},
topoData: {}, // topo图数据
isChart: {
type: Boolean,

View File

@@ -57,6 +57,7 @@
:querysArray="isPreview.querysArray"
:project="isPreview.currentProject"
:params="isPreview.params"
:iconArray="iconArray"
/>
</div>
</el-dialog>
@@ -620,7 +621,9 @@ export default {
setTimeout(() => {
this.ready = true
}, 300)
this.$get('/topology/icon').then(res => {
this.iconArray = [...res.data.list]
})
this.initEvent()
},
computed: {