refactor:仪表板刷新到秒级别

This commit is contained in:
wangjiahao 2021-10-29 17:46:04 +08:00
parent 7ca65ff280
commit 001c974e9f
9 changed files with 11 additions and 8 deletions

View File

@ -175,7 +175,7 @@ export default {
this.timer && clearInterval(this.timer)
let refreshTime = 300000
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
refreshTime = this.canvasStyleData.refreshTime * 60000
refreshTime = this.canvasStyleData.refreshTime * 1000
}
this.timer = setInterval(() => {
this.searchCount++

View File

@ -211,7 +211,7 @@ export default {
},
//
searchCount: function(val1) {
if (val1 > 0) {
if (val1 > 0 && this.requestStatus !== 'waiting') {
this.getData(this.element.propValue.viewId)
}
},

View File

@ -1229,6 +1229,7 @@ export default {
component_gap: 'Component Gap',
refresh_time: 'Refresh Time',
minute: 'minute',
second: 'second',
photo: 'Photo',
default_panel: 'Default Dashboard',
create_public_links: 'Create public links',

View File

@ -1232,6 +1232,7 @@ export default {
component_gap: '組件間隙',
refresh_time: '刷新时间',
minute: '分钟',
second: '秒',
photo: '圖片',
default_panel: '默認儀表板',
create_public_links: '創建公共鏈接',

View File

@ -1239,6 +1239,7 @@ export default {
component_gap: '组件间隙',
refresh_time: '刷新时间',
minute: '分钟',
second: '秒',
photo: '图片',
default_panel: '默认仪表板',
create_public_links: '创建公共链接',

View File

@ -8,8 +8,8 @@
>
<el-col>
<el-form ref="colorForm" label-width="80px" size="mini">
<el-form-item :label="$t('panel.minute')" class="form-item form-item-slider">
<el-slider v-model="canvasStyleData.refreshTime" show-input :show-input-controls="false" input-size="mini" :min="1" :max="60" @change="onChangePanelStyle" />
<el-form-item :label="$t('panel.second')" class="form-item form-item-slider">
<el-slider v-model="canvasStyleData.refreshTime" show-input :show-input-controls="false" input-size="mini" :min="1" :max="3600" @change="onChangePanelStyle" />
</el-form-item>
</el-form>
</el-col>

View File

@ -422,7 +422,7 @@ export default {
this.$store.commit('setComponentData', this.resetID(componentDatas))
// this.$store.commit('setComponentData', this.resetID(JSON.parse(componentDataTemp)))
const temp = JSON.parse(canvasStyleDataTemp)
temp.refreshTime = (temp.refreshTime || 5)
temp.refreshTime = (temp.refreshTime || 300)
this.$store.commit('setCanvasStyle', temp)
//
@ -443,7 +443,7 @@ 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)
panelStyle.refreshTime = (panelStyle.refreshTime || 300)
this.$store.commit('setCanvasStyle', panelStyle)
this.$store.commit('recordSnapshot', 'init')//

View File

@ -631,7 +631,7 @@ 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)
temp.refreshTime = (temp.refreshTime || 300)
this.$store.commit('setCanvasStyle', temp)
this.$store.dispatch('panel/setPanelInfo', data)

View File

@ -20,7 +20,7 @@ export const CANVAS_STYLE = {
auxiliaryMatrix: true,
openCommonStyle: true,
panel: DEFAULT_PANEL_STYLE,
refreshTime: 5 // 仪表板刷新时间 默认五分钟
refreshTime: 300 // 仪表板刷新时间 默认300秒
}
export const DEFAULT_COMMON_CANVAS_STYLE_STRING = {