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

36 lines
774 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-20 14:25:09 +08:00
timeType: 1
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) {
this.topoData = res.data.topo.topo || {}
this.querysArray = res.data.topo.elements || []
this.timeType = res.data.topo.timeType || 1
} else {
this.topoData = {}
this.querysArray = []
this.timeType = 1
}
})
}
2023-02-16 16:33:20 +08:00
}
}
}