diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue index 74079b4f2..61e6225ec 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/notebookTab.vue @@ -174,6 +174,9 @@ export default { let charts = this.$lodash.cloneDeep(this.$refs.notebookList.copyDataList) charts = charts.filter(item => item.name !== 'groupTemp') charts.forEach(item => { + item.elements.forEach((subItem, subIndex) => { + subItem.expression = item.oldElements[subIndex].expression + }) delete item.x delete item.y delete item.modifiedName @@ -248,7 +251,8 @@ export default { this.chart.position = { position: 'after', id: data.id } this.chart.panelName = this.showPanel.name this.chart.id = '' - this.chart.elements.forEach((item) => { + this.chart.elements.forEach((item, index) => { + item.expression = this.chart.oldElements[index].expression item.id = '' item.chartId = '' delete item.seq @@ -262,6 +266,9 @@ export default { } else { this.chart = JSON.parse(JSON.stringify(data)) this.chart.panelName = this.showPanel.name + this.chart.elements.forEach((item, index) => { + item.expression = this.chart.oldElements[index].expression + }) this.$nextTick(() => { this.$refs.addChartModal.isStable = 'stable' })