NEZ-3180 fix:Dashboard 页面 query_range 时间参数与上方时间选择器展示不一致
This commit is contained in:
@@ -18,7 +18,7 @@ export default {
|
||||
chart: {}
|
||||
},
|
||||
methods: {
|
||||
reload () {
|
||||
reload (isRefresh) {
|
||||
if (this.currentProject && this.currentProject.id) {
|
||||
this.$get('monitor/project/topo', { projectId: this.currentProject.id }).then(res => {
|
||||
if (res.data && res.data.topo) {
|
||||
@@ -42,21 +42,34 @@ export default {
|
||||
const res = {
|
||||
data: this.chartInfo.param
|
||||
}
|
||||
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
|
||||
}
|
||||
if (isRefresh) {
|
||||
this.$get('/visual/dashboard/chart/' + this.chartInfo.id).then(response => {
|
||||
res.data = JSON.parse(response.data.param)
|
||||
console.log(res.data)
|
||||
this.topoInit(res)
|
||||
this.chartInfo.param.topo = res.data.topo
|
||||
this.$refs.diagram && this.$refs.diagram.reload()
|
||||
})
|
||||
} else {
|
||||
this.topoData = {}
|
||||
this.querysArray = []
|
||||
this.params = {
|
||||
timeType: 5
|
||||
}
|
||||
this.topoInit(res)
|
||||
}
|
||||
}
|
||||
},
|
||||
topoInit (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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user