fix: 优化复制chart的逻辑

This commit is contained in:
zhangyu
2021-12-29 16:18:46 +08:00
parent e75f324604
commit 92a26b9cbe
2 changed files with 47 additions and 5 deletions

View File

@@ -416,6 +416,8 @@ export default {
editChart (data, copy) {
if (copy) {
this.chart = JSON.parse(JSON.stringify(data))
this.chart.x = 0
this.chart.y = 0
this.chart.panelId = this.showPanel.id
this.chart.panelName = this.showPanel.name
this.chart.id = ''
@@ -424,6 +426,9 @@ export default {
item.chartId = ''
delete item.seq
})
if (this.chart.datasource !== 'metrics' && this.chart.datasource !== 'log') {
delete this.chart.elements
}
} else {
this.rightBox.loading = true
this.$get('visual/panel/chart/' + data.id).then(res => {