diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 44096977d0..4cbddbe300 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -193,6 +193,7 @@ export default { ]) }, created() { + eventBus.$on('editPanelInitReady', this.editPanelInit) eventBus.$on('preview', this.preview) eventBus.$on('save', this.save) eventBus.$on('clearCanvas', this.clearCanvas) @@ -205,10 +206,14 @@ export default { eventBus.$off('preview', this.preview) eventBus.$off('save', this.save) eventBus.$off('clearCanvas', this.clearCanvas) + eventBus.$off('editPanelInitReady', this.editPanelInit) clearInterval(this.timer) this.timer = null }, methods: { + editPanelInit(){ + this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + }, close() { // 关闭页面清理缓存 this.$store.commit('initCanvasBase') diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 038c39dee8..d037fc2db6 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -429,6 +429,7 @@ import ChartStyleBatchSet from '@/views/chart/view/ChartStyleBatchSet' import Multiplexing from '@/views/panel/ViewSelect/multiplexing' import { listenGlobalKeyDown } from '@/components/canvas/utils/shortcutKey' import { adaptCurThemeCommonStyle } from '@/components/canvas/utils/style' +import eventBus from '@/components/canvas/utils/eventBus' export default { name: 'PanelEdit', components: { @@ -794,6 +795,7 @@ export default { } else { _this.$store.commit('refreshSaveStatus') } + eventBus.$emit('editPanelInitReady') }, 500) }) },