diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index c4fe2cc750..0642b4b894 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -74,7 +74,7 @@ import { deepCopy } from '@/components/canvas/utils/utils' import { panelSave } from '@/api/panel/panel' import bus from '@/utils/bus' import { - DEFAULT_COMMON_CANVAS_STYLE + DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' export default { @@ -248,7 +248,7 @@ export default { }, clearCanvas() { this.$store.commit('setComponentData', []) - this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE) + this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) this.$store.commit('recordSnapshot') }, diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 0094960db3..669dace069 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -21,7 +21,7 @@ import snapshot from '@/components/canvas/store/snapshot' import lock from '@/components/canvas/store/lock' import { valueValid, formatCondition } from '@/utils/conditionUtil' import { - DEFAULT_COMMON_CANVAS_STYLE + DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' Vue.use(Vuex) @@ -38,7 +38,7 @@ const data = { ...lock.state, editMode: 'edit', // 编辑器模式 edit preview - canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE, // 页面全局数据 //扩展公共样式 公共的仪表板样式,用来实时响应样式的变化 + canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE_STRING, // 页面全局数据 //扩展公共样式 公共的仪表板样式,用来实时响应样式的变化 componentData: [], // 画布组件数据 curComponent: null, curCanvasScale: null, @@ -46,7 +46,7 @@ const data = { // 点击画布时是否点中组件,主要用于取消选中组件用。 // 如果没点中组件,并且在画布空白处弹起鼠标,则取消当前组件的选中状态 isClickComponent: false, - canvasCommonStyleData: DEFAULT_COMMON_CANVAS_STYLE + canvasCommonStyleData: DEFAULT_COMMON_CANVAS_STYLE_STRING }, mutations: { ...animation.mutations, diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index de073f1b1c..2854abe3a6 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -178,7 +178,7 @@ import bus from '@/utils/bus' import EditPanel from './EditPanel' import { addGroup, delGroup, groupTree, defaultTree, findOne } from '@/api/panel/panel' import { - DEFAULT_COMMON_CANVAS_STYLE, DEFAULT_COMMON_CANVAS_STYLE_STRING + DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' export default { @@ -286,7 +286,7 @@ export default { }, mounted() { this.$store.commit('setComponentData', []) - this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE) + this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) this.defaultTree() this.tree(this.groupForm) }, @@ -546,7 +546,7 @@ export default { // 清空当前缓存,快照 this.$store.commit('refreshSnapshot') this.$store.commit('setComponentData', []) - this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE) + this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) // 清空临时画布数据 this.$store.dispatch('panel/setComponentDataTemp', null) this.$store.dispatch('panel/setCanvasStyleDataTemp', null) diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js index 92d1aec6ed..d5ce18b144 100644 --- a/frontend/src/views/panel/panel.js +++ b/frontend/src/views/panel/panel.js @@ -20,11 +20,6 @@ export const CANVAS_STYLE = { panel: DEFAULT_PANEL_STYLE } -export const DEFAULT_COMMON_CANVAS_STYLE = { - ...CANVAS_STYLE, - chart: BASE_CHART -} - export const DEFAULT_COMMON_CANVAS_STYLE_STRING = { ...CANVAS_STYLE, chart: BASE_CHART_STRING