From 0bb8ccaea80f2ee0f96756878aaeced775588655 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 10 Oct 2021 17:19:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=B6=E9=97=B4=E8=A2=AB=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue | 6 +++--- frontend/src/views/panel/edit/index.vue | 7 ++++++- frontend/src/views/panel/list/PanelList.vue | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue index 94369811d7..24d883cce4 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue @@ -37,9 +37,9 @@ export default { }, created() { // 初始化赋值 - if (!this.canvasStyleData.refreshTime) { - this.canvasStyleData['refreshTime'] = CANVAS_STYLE.refreshTime - } + // if (!this.canvasStyleData.refreshTime) { + // this.canvasStyleData['refreshTime'] = CANVAS_STYLE.refreshTime + // } }, methods: { onChangePanelStyle() { diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 9e1c8f16a9..8ed5f49081 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -394,7 +394,10 @@ export default { }) this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', this.resetID(JSON.parse(componentDataTemp))) - this.$store.commit('setCanvasStyle', JSON.parse(canvasStyleDataTemp)) + const temp = JSON.parse(canvasStyleDataTemp) + temp.refreshTime = (temp.refreshTime || 5) + + this.$store.commit('setCanvasStyle', temp) // 清空临时画布数据 this.$store.dispatch('panel/setComponentDataTemp', null) this.$store.dispatch('panel/setCanvasStyleDataTemp', null) @@ -413,6 +416,8 @@ export default { this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) const panelStyle = JSON.parse(response.data.panelStyle) + panelStyle.refreshTime = (panelStyle.refreshTime || 5) + this.$store.commit('setCanvasStyle', panelStyle) this.$store.commit('recordSnapshot', 'init')// 记录快照 // 刷新联动信息 diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index f249e23823..fa0cdb8578 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -630,6 +630,8 @@ export default { this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', sourceInfo.type === 'custom' ? sourceInfo : this.resetID(sourceInfo)) const temp = JSON.parse(response.data.panelStyle) + temp.refreshTime = (temp.refreshTime || 5) + this.$store.commit('setCanvasStyle', temp) this.$store.dispatch('panel/setPanelInfo', data)