fix: 刷新时间设置时间被还原问题

This commit is contained in:
wangjiahao 2021-10-10 17:19:26 +08:00
parent b7d5f0b86c
commit 0bb8ccaea8
3 changed files with 11 additions and 4 deletions

View File

@ -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() {

View File

@ -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')//
//

View File

@ -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)