提交 8be04097 authored 作者: wangjiahao's avatar wangjiahao

refactor:删除仪表板的同时,清空画布数据

上级 bef9dc24
...@@ -463,6 +463,7 @@ export default { ...@@ -463,6 +463,7 @@ export default {
message: this.$t('panel.delete_success'), message: this.$t('panel.delete_success'),
showClose: true showClose: true
}) })
this.clearCanvas()
this.tree(this.groupForm) this.tree(this.groupForm)
this.defaultTree() this.defaultTree()
}) })
...@@ -470,6 +471,17 @@ export default { ...@@ -470,6 +471,17 @@ export default {
}) })
}, },
clearCanvas() {
// 清空当前缓存,快照
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.$store.dispatch('panel/setPanelInfo', {
id: null,
name: '',
preStyle: null
})
},
close() { close() {
this.editGroup = false this.editGroup = false
this.groupForm = { this.groupForm = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论