From 37d6623db5e0876bf6b47d729198750127a3a71b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 30 Nov 2021 15:24:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=BF=9D=E5=AD=98=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=AE=9E=E6=97=B6=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/list/PanelList.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 9e229ba15e..77ee470ee2 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -371,7 +371,7 @@ export default { mounted() { this.$store.commit('setComponentData', []) this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING) - this.defaultTree() + this.defaultTree(true) this.tree(true) this.initCache() }, @@ -620,17 +620,19 @@ export default { } }) }, - defaultTree() { + defaultTree(cache = false) { const requestInfo = { panelType: 'system' } const modelInfo = localStorage.getItem('panel-default-tree') - if (modelInfo) { + const userCache = (modelInfo && cache) + + if (userCache) { this.defaultData = JSON.parse(modelInfo) } defaultTree(requestInfo, false).then(res => { localStorage.setItem('panel-default-tree', JSON.stringify(res.data)) - if (!modelInfo) { + if (!userCache) { this.defaultData = res.data } })