forked from github/dataease
fix: 清空仪表板 会导致样式错误问题
This commit is contained in:
parent
874fd25a7f
commit
4f589600e6
@ -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')
|
||||
},
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user