This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/mixin/beforeMeta2d.js

45 lines
973 B
JavaScript

export default {
data () {
return {
topoData: {},
querysArray: [],
meta2dType: '',
params: {},
iconArray: []
}
},
watch: {
currentProject: {
handler (n) {
this.reload()
}
},
chart: {}
},
methods: {
reload () {
if (this.currentProject.id) {
this.$get('monitor/project/topo', { projectId: this.currentProject.id }).then(res => {
if (res.data && res.data.topo) {
this.topoData = res.data.topo || {}
if (res.data.topo.topo) {
this.topoData = res.data.topo.topo || {}
}
this.querysArray = res.data.topo.elements || []
this.params = {
timeType: res.data.topo.timeType || 5
}
} else {
this.topoData = {}
this.querysArray = []
this.params = {
timeType: 5
}
}
})
}
}
}
}