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

43 lines
951 B
JavaScript
Raw Normal View History

2023-02-16 16:33:20 +08:00
export default {
data () {
return {
topoData: {},
2023-02-20 14:25:09 +08:00
querysArray: [],
2023-02-16 18:13:14 +08:00
meta2dType: '',
2023-02-21 19:05:49 +08:00
params: {}
2023-02-16 16:33:20 +08:00
}
},
2023-02-20 14:25:09 +08:00
watch: {
currentProject: {
handler (n) {
this.reload()
}
},
chart: {}
},
methods: {
reload () {
2023-02-20 19:11:10 +08:00
if (this.currentProject.id) {
this.$get('monitor/project/topo', { projectId: this.currentProject.id }).then(res => {
if (res.data && res.data.topo) {
2023-03-14 18:13:54 +08:00
this.topoData = res.data.topo || {}
if (res.data.topo.topo) {
this.topoData = res.data.topo.topo || {}
}
2023-02-20 19:11:10 +08:00
this.querysArray = res.data.topo.elements || []
2023-02-21 19:05:49 +08:00
this.params = {
2023-03-14 18:13:54 +08:00
timeType: res.data.topo.timeType || 5
2023-02-21 19:05:49 +08:00
}
2023-02-20 19:11:10 +08:00
} else {
this.topoData = {}
this.querysArray = []
2023-02-21 19:05:49 +08:00
this.params = {
2023-03-14 18:13:54 +08:00
timeType: 5
2023-02-21 19:05:49 +08:00
}
2023-02-20 19:11:10 +08:00
}
})
}
2023-02-16 16:33:20 +08:00
}
}
}