diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index db038a7f5..906759e83 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -297,7 +297,7 @@ export default { } this.scrollTopTimer = setTimeout(() => { this.copyDataList.forEach(item => { - if (!this.$refs['grid-item' + item.id][0]) { + if (!this.$refs['grid-item' + item.id] || !this.$refs['grid-item' + item.id][0]) { return; } const dom = this.$refs['grid-item' + item.id][0].$el diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index c772ba6e0..da97c5da6 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -686,7 +686,13 @@ export default { }, chartBySync () { this.panelTabLoading = true - this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => { + const params = {} + if (this.from === 'chartTemp') { + params.pid = this.obj.id + } else { + params.panelId = this.showPanel.id + } + this.$post('visual/panel/chart/syncTmpl', params).then(res => { this.panelTabLoading = false if (res.code === 200) { this.getTableData(this.obj.id)