NEZ-741 fix:修改复制面板中的图表报错的问题
This commit is contained in:
@@ -1616,7 +1616,7 @@ export default {
|
|||||||
delete copyChart.varId
|
delete copyChart.varId
|
||||||
delete copyChart.varType
|
delete copyChart.varType
|
||||||
copyChart.name = 'Copy_' + copyChart.name
|
copyChart.name = 'Copy_' + copyChart.name
|
||||||
this.$emit('on-edit-chart', copyChart)
|
this.$emit('on-edit-chart', copyChart, true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
duplicateChartGroup (chart) {
|
duplicateChartGroup (chart) {
|
||||||
@@ -1627,7 +1627,7 @@ export default {
|
|||||||
delete copyChart.varId
|
delete copyChart.varId
|
||||||
delete copyChart.varType
|
delete copyChart.varType
|
||||||
copyChart.name = 'Copy_' + copyChart.name
|
copyChart.name = 'Copy_' + copyChart.name
|
||||||
this.$emit('on-edit-chart', copyChart)
|
this.$emit('on-edit-chart', copyChart, true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 编辑图表
|
// 编辑图表
|
||||||
|
|||||||
@@ -323,29 +323,36 @@ export default {
|
|||||||
return JSON.parse(JSON.stringify(this.blankChart))
|
return JSON.parse(JSON.stringify(this.blankChart))
|
||||||
},
|
},
|
||||||
// 编辑图表信息,打开编辑弹窗
|
// 编辑图表信息,打开编辑弹窗
|
||||||
editChart (data) {
|
editChart (data, copy) {
|
||||||
this.$get('visual/panel/chart/' + data.id).then(res => {
|
if (copy) {
|
||||||
if (res.code === 200) {
|
this.chart = JSON.parse(JSON.stringify(data))
|
||||||
const chartData = res.data.data
|
this.chart.panelId = this.showPanel.id
|
||||||
console.log(typeof chartData.param);
|
this.chart.panelName = this.showPanel.name
|
||||||
if (typeof chartData.param === 'string') {
|
this.rightBox.chart.show = true
|
||||||
chartData.param = JSON.parse(chartData.param)
|
} else {
|
||||||
|
this.$get('visual/panel/chart/' + data.id).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
const chartData = res.data.data
|
||||||
|
console.log(typeof chartData.param)
|
||||||
|
if (typeof chartData.param === 'string') {
|
||||||
|
chartData.param = JSON.parse(chartData.param)
|
||||||
|
}
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
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