提交 37d6623d authored 作者: wangjiahao's avatar wangjiahao

fix: 修复默认仪表板保存时无法实时显示在列表中的问题

上级 ef6ae668
...@@ -371,7 +371,7 @@ export default { ...@@ -371,7 +371,7 @@ export default {
mounted() { mounted() {
this.$store.commit('setComponentData', []) this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.defaultTree() this.defaultTree(true)
this.tree(true) this.tree(true)
this.initCache() this.initCache()
}, },
...@@ -620,17 +620,19 @@ export default { ...@@ -620,17 +620,19 @@ export default {
} }
}) })
}, },
defaultTree() { defaultTree(cache = false) {
const requestInfo = { const requestInfo = {
panelType: 'system' panelType: 'system'
} }
const modelInfo = localStorage.getItem('panel-default-tree') const modelInfo = localStorage.getItem('panel-default-tree')
if (modelInfo) { const userCache = (modelInfo && cache)
if (userCache) {
this.defaultData = JSON.parse(modelInfo) this.defaultData = JSON.parse(modelInfo)
} }
defaultTree(requestInfo, false).then(res => { defaultTree(requestInfo, false).then(res => {
localStorage.setItem('panel-default-tree', JSON.stringify(res.data)) localStorage.setItem('panel-default-tree', JSON.stringify(res.data))
if (!modelInfo) { if (!userCache) {
this.defaultData = res.data this.defaultData = res.data
} }
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论