NEZ-723 feat:chart编辑时调用请求接口获取最新数据
This commit is contained in:
@@ -324,13 +324,28 @@ export default {
|
|||||||
},
|
},
|
||||||
// 编辑图表信息,打开编辑弹窗
|
// 编辑图表信息,打开编辑弹窗
|
||||||
editChart (data) {
|
editChart (data) {
|
||||||
if (!data.param) {
|
this.$get('visual/panel/chart/' + data.id).then(res => {
|
||||||
data.param = { url: '', threshold: '' }
|
if (res.code === 200) {
|
||||||
}
|
const chartData = res.data.data
|
||||||
this.chart = JSON.parse(JSON.stringify(data))
|
console.log(typeof chartData.param);
|
||||||
this.chart.panelId = this.showPanel.id
|
if (typeof chartData.param === 'string') {
|
||||||
this.chart.panelName = this.showPanel.name
|
chartData.param = JSON.parse(chartData.param)
|
||||||
this.rightBox.chart.show = true
|
}
|
||||||
|
if (!chartData.param) {
|
||||||
|
chartData.param = { url: '', threshold: '' }
|
||||||
|
} else if (!chartData.param.threshold) {
|
||||||
|
chartData.param.threshold = ''
|
||||||
|
} else if (!chartData.param.url) {
|
||||||
|
chartData.param.url = ''
|
||||||
|
}
|
||||||
|
this.chart = JSON.parse(JSON.stringify(chartData))
|
||||||
|
this.chart.panelId = this.showPanel.id
|
||||||
|
this.chart.panelName = this.showPanel.name
|
||||||
|
this.rightBox.chart.show = true
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
closeChartBox (refresh) {
|
closeChartBox (refresh) {
|
||||||
this.rightBox.chart.show = false
|
this.rightBox.chart.show = false
|
||||||
|
|||||||
Reference in New Issue
Block a user