Skip to content

Commit 6cf3592

Browse files
Merge pull request dataease#3760 from dataease/pr@dev@feat_panel-refresh
feat(仪表板): 仪表板视图刷新增加开关控制
2 parents 99842f9 + 08271e7 commit 6cf3592

File tree

12 files changed

+113
-51
lines changed

12 files changed

+113
-51
lines changed

frontend/src/components/canvas/DeCanvas.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@mouseup="deselectCurComponent"
99
@scroll="canvasScroll"
1010
>
11-
<slot name="optBar"/>
11+
<slot name="optBar" />
1212
<de-editor
1313
:ref="editorRefName"
1414
:canvas-style-data="canvasStyleData"

frontend/src/components/canvas/components/editor/EditBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
:target="curComponent.hyperlinks.openMode "
138138
:href="curComponent.hyperlinks.content "
139139
>
140-
<i class="icon iconfont icon-com-jump"/>
140+
<i class="icon iconfont icon-com-jump" />
141141
</a>
142142
</span>
143143

frontend/src/components/canvas/components/editor/Preview.vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,21 @@ export default {
428428
},
429429
canvasStyleDataInit() {
430430
// 数据刷新计时器
431-
this.searchCount = 0
432-
this.timer && clearInterval(this.timer)
433-
let refreshTime = 300000
434-
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
435-
if (this.canvasStyleData.refreshUnit === 'second') {
436-
refreshTime = this.canvasStyleData.refreshTime * 1000
437-
} else {
438-
refreshTime = this.canvasStyleData.refreshTime * 60000
431+
if (this.canvasStyleData.refreshViewEnable) {
432+
this.searchCount = 0
433+
this.timer && clearInterval(this.timer)
434+
let refreshTime = 300000
435+
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
436+
if (this.canvasStyleData.refreshUnit === 'second') {
437+
refreshTime = this.canvasStyleData.refreshTime * 1000
438+
} else {
439+
refreshTime = this.canvasStyleData.refreshTime * 60000
440+
}
439441
}
442+
this.timer = setInterval(() => {
443+
this.searchCount++
444+
}, refreshTime)
440445
}
441-
this.timer = setInterval(() => {
442-
this.searchCount++
443-
}, refreshTime)
444446
},
445447
changeStyleWithScale,
446448
getStyle,

frontend/src/components/canvas/utils/utils.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import {
2-
BASE_MOBILE_STYLE, COMMON_BACKGROUND_NONE,
2+
BASE_MOBILE_STYLE,
3+
COMMON_BACKGROUND_NONE,
34
HYPERLINKS
45
} from '@/components/canvas/customComponent/component-list'
56

6-
import {
7-
ApplicationContext
8-
} from '@/utils/ApplicationContext'
7+
import { ApplicationContext } from '@/utils/ApplicationContext'
98
import { uuid } from 'vue-uuid'
109
import store from '@/store'
1110
import { AIDED_DESIGN, PANEL_CHART_INFO, TAB_COMMON_STYLE } from '@/views/panel/panel'
@@ -49,6 +48,7 @@ export function toTop(arr, i, j) {
4948
export function toBottom(arr, i) {
5049
arr.unshift(arr.splice(i, 1)[0])
5150
}
51+
5252
export function $(selector) {
5353
return document.querySelector(selector)
5454
}
@@ -80,6 +80,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
8080
componentStyle.refreshTime = (componentStyle.refreshTime || 5)
8181
componentStyle.refreshViewLoading = (componentStyle.refreshViewLoading || false)
8282
componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute')
83+
componentStyle.refreshViewEnable = (componentStyle.refreshViewEnable === undefined ? true : componentStyle.refreshViewEnable)
8384
componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN))
8485
componentStyle.chartInfo = (componentStyle.chartInfo || deepCopy(PANEL_CHART_INFO))
8586
componentStyle.chartInfo.tabStyle = (componentStyle.chartInfo.tabStyle || deepCopy(TAB_COMMON_STYLE))
@@ -209,8 +210,11 @@ export function exportImg(imgName) {
209210
}
210211

211212
export function dataURLToBlob(dataurl) { // ie 图片转格式
212-
const arr = dataurl.split(','); const mime = arr[0].match(/:(.*?);/)[1]
213-
const bstr = atob(arr[1]); let n = bstr.length; const u8arr = new Uint8Array(n)
213+
const arr = dataurl.split(',')
214+
const mime = arr[0].match(/:(.*?);/)[1]
215+
const bstr = atob(arr[1])
216+
let n = bstr.length
217+
const u8arr = new Uint8Array(n)
214218
while (n--) {
215219
u8arr[n] = bstr.charCodeAt(n)
216220
}

frontend/src/lang/en.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,18 @@ export default {
18651865
sure_bt: 'Confirm'
18661866
},
18671867
panel: {
1868+
board: 'Border',
1869+
text: 'Text',
1870+
board_background: 'Background',
1871+
title_color: 'Title color',
1872+
input_style: 'Input box style (color)',
1873+
overall_setting: 'Overall setting',
1874+
panel_background: 'Panel background',
1875+
component_color: 'Component color',
1876+
chart_title: 'Chart title',
1877+
filter_component: 'Filter component',
1878+
enable_refresh_view: 'Enable refresh',
1879+
enable_view_loading: 'View loading prompt',
18681880
image_size_tips: 'Please do not exceed 15M in the picture',
18691881
image_add_tips: 'Only pictures can be inserted',
18701882
watermark: 'Watermark',

frontend/src/lang/tw.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,18 @@ export default {
18651865
sure_bt: '確定'
18661866
},
18671867
panel: {
1868+
board: '邊框',
1869+
text: '文字',
1870+
board_background: '背景',
1871+
title_color: '標題顏色',
1872+
input_style: '輸入框樣式(顏色)',
1873+
overall_setting: '整體配置',
1874+
panel_background: '儀表板背景',
1875+
component_color: '組件配色',
1876+
chart_title: '圖表標題',
1877+
filter_component: '過濾組件',
1878+
enable_refresh_view: '開啟刷新',
1879+
enable_view_loading: '視圖加載提示',
18681880
image_size_tips: '圖片請不要大於15M',
18691881
image_add_tips: '只能插入圖片',
18701882
watermark: '水印',

frontend/src/lang/zh.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,18 @@ export default {
18651865
sure_bt: '确定'
18661866
},
18671867
panel: {
1868+
board: '边框',
1869+
text: '文字',
1870+
board_background: '背景',
1871+
title_color: '标题颜色',
1872+
input_style: '输入框样式(颜色)',
1873+
overall_setting: '整体配置',
1874+
panel_background: '仪表板背景',
1875+
component_color: '组件配色',
1876+
chart_title: '图表标题',
1877+
filter_component: '过滤组件',
1878+
enable_refresh_view: '开启刷新',
1879+
enable_view_loading: '视图加载提示',
18681880
image_size_tips: '图片请不要大于15M',
18691881
image_add_tips: '只能插入图片',
18701882
watermark: '水印',

frontend/src/views/panel/panel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { DEFAULT_COLOR_CASE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
33
import { deepCopy } from '@/components/canvas/utils/utils'
44
import { COMMON_BACKGROUND_BASE } from '@/components/canvas/customComponent/component-list'
5+
56
export const TAB_COMMON_STYLE = {
67
headFontColor: '#000000',
78
headFontActiveColor: '#000000',
@@ -60,6 +61,7 @@ export const CANVAS_STYLE = {
6061
showGrid: false,
6162
matrixBase: 4 // 当前matrix的基数 (是pcMatrixCount的几倍)
6263
}, // 辅助设计
64+
refreshViewEnable: true, // 开启视图刷新(默认开启)
6365
refreshViewLoading: true, // 仪表板视图loading提示
6466
refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟
6567
refreshTime: 5, // 仪表板刷新时间 默认5分钟

frontend/src/views/panel/subjectSetting/index.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,39 @@
2121
@change="handleChange"
2222
>
2323
<el-collapse-item
24-
:title="'整体配置'"
24+
:title="$t('panel.overall_setting')"
2525
name="panel"
2626
>
2727
<el-row class="selector-div">
2828
<overall-setting />
2929
</el-row>
3030
</el-collapse-item>
3131
<el-collapse-item
32-
:title="'仪表板背景'"
32+
:title="$t('panel.panel_background')"
3333
name="panelBackground"
3434
>
3535
<background-selector />
3636
</el-collapse-item>
3737
<el-collapse-item
38-
:title="'组件样式'"
38+
:title="$t('panel.component_style')"
3939
name="componentStyle"
4040
>
4141
<component-style />
4242
</el-collapse-item>
4343
<el-collapse-item
44-
:title="'组件配色'"
44+
:title="$t('panel.component_color')"
4545
name="graphical"
4646
>
4747
<panel-color-selector @onColorChange="onColorChange" />
4848
</el-collapse-item>
4949
<el-collapse-item
50-
:title="'图表标题'"
50+
:title="$t('panel.chart_title')"
5151
name="table"
5252
>
5353
<view-title @onTextChange="onTextChange" />
5454
</el-collapse-item>
5555
<el-collapse-item
56-
:title="'过滤组件'"
56+
:title="$t('panel.filter_component')"
5757
name="filterComponent"
5858
>
5959
<FilterStyleSelector />
@@ -204,21 +204,21 @@ export default {
204204
font-weight: 700
205205
}
206206
207-
.theme-slider-position{
207+
.theme-slider-position {
208208
height: 1px;
209209
position: absolute;
210210
left: 15px;
211211
right: 15px;
212212
top: 40px;
213-
box-sizing:border-box;
213+
box-sizing: border-box;
214214
border-bottom: 1px solid #e8eaed
215215
}
216216
217-
::v-deep .el-collapse-item__header{
218-
font-weight: 500!important;
219-
font-size: 14px!important;
217+
::v-deep .el-collapse-item__header {
218+
font-weight: 500 !important;
219+
font-size: 14px !important;
220220
color: var(--TextPrimary, #1F2329);
221-
padding: 0!important;
221+
padding: 0 !important;
222222
}
223223
224224
</style>

frontend/src/views/panel/subjectSetting/panelStyle/BackgroundSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
:on-remove="handleRemove"
4646
:file-list="fileList"
4747
>
48-
<i class="el-icon-plus"/>
48+
<i class="el-icon-plus" />
4949
</el-upload>
5050
<el-dialog
5151
top="25vh"

0 commit comments

Comments
 (0)