提交 dfc65d20 authored 作者: wangjiahao's avatar wangjiahao

refactor:仪表板刷新到秒级别

上级 8b094748
......@@ -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++
......
......@@ -211,7 +211,7 @@ export default {
},
// 监听外部计时器变化
searchCount: function(val1) {
if (val1 > 0) {
if (val1 > 0 && this.requestStatus !== 'waiting') {
this.getData(this.element.propValue.viewId)
}
},
......
......@@ -1239,6 +1239,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',
......
......@@ -1242,6 +1242,7 @@ export default {
component_gap: '組件間隙',
refresh_time: '刷新时间',
minute: '分钟',
second: '秒',
photo: '圖片',
default_panel: '默認儀表板',
create_public_links: '創建公共鏈接',
......
......@@ -1250,6 +1250,7 @@ export default {
component_gap: '组件间隙',
refresh_time: '刷新时间',
minute: '分钟',
second: '秒',
photo: '图片',
default_panel: '默认仪表板',
create_public_links: '创建公共链接',
......
......@@ -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>
......
......@@ -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')// 记录快照
......
......@@ -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)
......
......@@ -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 = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论