NEZ-741 fix:修改复制面板中的图表报错的问题

This commit is contained in:
zhangyu
2021-06-18 16:57:49 +08:00
parent 2b2a419fd8
commit 0615351836
2 changed files with 31 additions and 24 deletions

View File

@@ -1616,7 +1616,7 @@ export default {
delete copyChart.varId
delete copyChart.varType
copyChart.name = 'Copy_' + copyChart.name
this.$emit('on-edit-chart', copyChart)
this.$emit('on-edit-chart', copyChart, true)
}
},
duplicateChartGroup (chart) {
@@ -1627,7 +1627,7 @@ export default {
delete copyChart.varId
delete copyChart.varType
copyChart.name = 'Copy_' + copyChart.name
this.$emit('on-edit-chart', copyChart)
this.$emit('on-edit-chart', copyChart, true)
}
},
// 编辑图表

View File

@@ -323,11 +323,17 @@ export default {
return JSON.parse(JSON.stringify(this.blankChart))
},
// 编辑图表信息,打开编辑弹窗
editChart (data) {
editChart (data, copy) {
if (copy) {
this.chart = JSON.parse(JSON.stringify(data))
this.chart.panelId = this.showPanel.id
this.chart.panelName = this.showPanel.name
this.rightBox.chart.show = true
} else {
this.$get('visual/panel/chart/' + data.id).then(res => {
if (res.code === 200) {
const chartData = res.data.data
console.log(typeof chartData.param);
console.log(typeof chartData.param)
if (typeof chartData.param === 'string') {
chartData.param = JSON.parse(chartData.param)
}
@@ -346,6 +352,7 @@ export default {
this.$message.error(res.msg)
}
})
}
},
closeChartBox (refresh) {
this.rightBox.chart.show = false