提交 4f589600 authored 作者: wangjiahao's avatar wangjiahao

fix: 清空仪表板 会导致样式错误问题

上级 874fd25a
...@@ -74,7 +74,7 @@ import { deepCopy } from '@/components/canvas/utils/utils' ...@@ -74,7 +74,7 @@ import { deepCopy } from '@/components/canvas/utils/utils'
import { panelSave } from '@/api/panel/panel' import { panelSave } from '@/api/panel/panel'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { import {
DEFAULT_COMMON_CANVAS_STYLE DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel' } from '@/views/panel/panel'
export default { export default {
...@@ -248,7 +248,7 @@ export default { ...@@ -248,7 +248,7 @@ export default {
}, },
clearCanvas() { clearCanvas() {
this.$store.commit('setComponentData', []) 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') this.$store.commit('recordSnapshot')
}, },
......
...@@ -21,7 +21,7 @@ import snapshot from '@/components/canvas/store/snapshot' ...@@ -21,7 +21,7 @@ import snapshot from '@/components/canvas/store/snapshot'
import lock from '@/components/canvas/store/lock' import lock from '@/components/canvas/store/lock'
import { valueValid, formatCondition } from '@/utils/conditionUtil' import { valueValid, formatCondition } from '@/utils/conditionUtil'
import { import {
DEFAULT_COMMON_CANVAS_STYLE DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel' } from '@/views/panel/panel'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -38,7 +38,7 @@ const data = { ...@@ -38,7 +38,7 @@ const data = {
...lock.state, ...lock.state,
editMode: 'edit', // 编辑器模式 edit preview editMode: 'edit', // 编辑器模式 edit preview
canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE, // 页面全局数据 //扩展公共样式 公共的仪表板样式,用来实时响应样式的变化 canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE_STRING, // 页面全局数据 //扩展公共样式 公共的仪表板样式,用来实时响应样式的变化
componentData: [], // 画布组件数据 componentData: [], // 画布组件数据
curComponent: null, curComponent: null,
curCanvasScale: null, curCanvasScale: null,
...@@ -46,7 +46,7 @@ const data = { ...@@ -46,7 +46,7 @@ const data = {
// 点击画布时是否点中组件,主要用于取消选中组件用。 // 点击画布时是否点中组件,主要用于取消选中组件用。
// 如果没点中组件,并且在画布空白处弹起鼠标,则取消当前组件的选中状态 // 如果没点中组件,并且在画布空白处弹起鼠标,则取消当前组件的选中状态
isClickComponent: false, isClickComponent: false,
canvasCommonStyleData: DEFAULT_COMMON_CANVAS_STYLE canvasCommonStyleData: DEFAULT_COMMON_CANVAS_STYLE_STRING
}, },
mutations: { mutations: {
...animation.mutations, ...animation.mutations,
......
...@@ -178,7 +178,7 @@ import bus from '@/utils/bus' ...@@ -178,7 +178,7 @@ import bus from '@/utils/bus'
import EditPanel from './EditPanel' import EditPanel from './EditPanel'
import { addGroup, delGroup, groupTree, defaultTree, findOne } from '@/api/panel/panel' import { addGroup, delGroup, groupTree, defaultTree, findOne } from '@/api/panel/panel'
import { import {
DEFAULT_COMMON_CANVAS_STYLE, DEFAULT_COMMON_CANVAS_STYLE_STRING DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel' } from '@/views/panel/panel'
export default { export default {
...@@ -286,7 +286,7 @@ export default { ...@@ -286,7 +286,7 @@ export default {
}, },
mounted() { mounted() {
this.$store.commit('setComponentData', []) this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE) this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.defaultTree() this.defaultTree()
this.tree(this.groupForm) this.tree(this.groupForm)
}, },
...@@ -546,7 +546,7 @@ export default { ...@@ -546,7 +546,7 @@ export default {
// 清空当前缓存,快照 // 清空当前缓存,快照
this.$store.commit('refreshSnapshot') this.$store.commit('refreshSnapshot')
this.$store.commit('setComponentData', []) 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/setComponentDataTemp', null)
this.$store.dispatch('panel/setCanvasStyleDataTemp', null) this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
......
...@@ -20,11 +20,6 @@ export const CANVAS_STYLE = { ...@@ -20,11 +20,6 @@ export const CANVAS_STYLE = {
panel: DEFAULT_PANEL_STYLE panel: DEFAULT_PANEL_STYLE
} }
export const DEFAULT_COMMON_CANVAS_STYLE = {
...CANVAS_STYLE,
chart: BASE_CHART
}
export const DEFAULT_COMMON_CANVAS_STYLE_STRING = { export const DEFAULT_COMMON_CANVAS_STYLE_STRING = {
...CANVAS_STYLE, ...CANVAS_STYLE,
chart: BASE_CHART_STRING chart: BASE_CHART_STRING
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论