From 517bca9d572c5ed23f10ab243c8f4e10db27b960 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 20 Feb 2024 12:06:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=AE=BE=E7=BD=AE=E6=B5=8F=E8=A7=88=E5=99=A8=E6=95=B4?= =?UTF-8?q?=E4=BD=93=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/utils/utils.js | 2 + core/frontend/src/lang/en.js | 2 + core/frontend/src/lang/tw.js | 2 + core/frontend/src/lang/zh.js | 2 + core/frontend/src/views/link/view/index.vue | 7 +++ core/frontend/src/views/panel/panel.js | 2 + .../panelStyle/OverallSetting.vue | 59 +++++++++++++++++++ 7 files changed, 76 insertions(+) diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index 4e6d3ce266..3237fa64e6 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -92,6 +92,8 @@ export function panelDataPrepare(componentData, componentStyle, callback) { componentStyle.refreshViewLoading = (componentStyle.refreshViewLoading || false) componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute') componentStyle.refreshViewEnable = (componentStyle.refreshViewEnable === undefined ? true : componentStyle.refreshViewEnable) + componentStyle.refreshBrowserEnable = (componentStyle.refreshBrowserEnable || false) + componentStyle.refreshBrowserTime = (componentStyle.refreshBrowserTime || 5) componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN)) componentStyle.pdfPageLine = (componentStyle.pdfPageLine || deepCopy(PAGE_LINE_DESIGN)) componentStyle.chartInfo = (componentStyle.chartInfo || deepCopy(PANEL_CHART_INFO)) diff --git a/core/frontend/src/lang/en.js b/core/frontend/src/lang/en.js index da6b1b291a..dd87df6c1a 100644 --- a/core/frontend/src/lang/en.js +++ b/core/frontend/src/lang/en.js @@ -2144,6 +2144,8 @@ export default { theme_color_dark: 'Dark', theme_color_light: 'Light', refresh_frequency: 'Refresh Frequency', + refresh_browser_frequency: 'Refresh Browser', + refresh_browser_tips: 'Only public links are effective', card_color_matching: 'Card Color Matching', table_color_matching: 'Table Color Matching', background_color: 'Background Color', diff --git a/core/frontend/src/lang/tw.js b/core/frontend/src/lang/tw.js index e8fcfefb10..fbaaec0083 100644 --- a/core/frontend/src/lang/tw.js +++ b/core/frontend/src/lang/tw.js @@ -2136,6 +2136,8 @@ export default { theme_color_dark: '深色', theme_color_light: '淺色', refresh_frequency: '刷新頻率', + refresh_browser_frequency: '浏览器刷新', + refresh_browser_tips: '仅公共链接生效', card_color_matching: '卡片配色', table_color_matching: '表格配色', background_color: '背景顏色', diff --git a/core/frontend/src/lang/zh.js b/core/frontend/src/lang/zh.js index bff885256b..c77d4b89b8 100644 --- a/core/frontend/src/lang/zh.js +++ b/core/frontend/src/lang/zh.js @@ -2139,6 +2139,8 @@ export default { theme_color_dark: '深色', theme_color_light: '浅色', refresh_frequency: '刷新频率', + refresh_browser_frequency: '浏览器刷新', + refresh_browser_tips: '仅公共链接生效', card_color_matching: '卡片配色', table_color_matching: '表格配色', background_color: '背景颜色', diff --git a/core/frontend/src/views/link/view/index.vue b/core/frontend/src/views/link/view/index.vue index a3213d33f7..6ac84f95fa 100644 --- a/core/frontend/src/views/link/view/index.vue +++ b/core/frontend/src/views/link/view/index.vue @@ -76,6 +76,12 @@ export default { }) }, + initBrowserTimer() { + if (this.canvasStyleData.refreshBrowserEnable) { + const browserRefreshTime = this.canvasStyleData.refreshBrowserTime * 60 * 1000 + setTimeout(() => { window.location.reload() }, browserRefreshTime) + } + }, setPanelInfo() { loadResource(this.resourceId, this.user).then(res => { this.show = false @@ -99,6 +105,7 @@ export default { this.$store.dispatch('panel/setPanelInfo', this.panelInfo) panelInit(JSON.parse(res.data.panelData), JSON.parse(res.data.panelStyle)) + this.initBrowserTimer() // 设置浏览器title为当前仪表板名称 document.title = res.data.name // 刷新联动信息 diff --git a/core/frontend/src/views/panel/panel.js b/core/frontend/src/views/panel/panel.js index a41302a7c8..ceee9e86bc 100644 --- a/core/frontend/src/views/panel/panel.js +++ b/core/frontend/src/views/panel/panel.js @@ -81,6 +81,8 @@ export const CANVAS_STYLE = { refreshViewLoading: true, // 仪表板视图loading提示 refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟 refreshTime: 5, // 仪表板刷新时间 默认5分钟 + refreshBrowserEnable: false, // 开启视图刷新(默认关闭) + refreshBrowserTime: 5, // 仪表板刷新时间 默认5分钟(浏览器刷新仅保留分钟) themeId: 'system_1', // 当前所选主题ID 默认系统主题1 chartInfo: PANEL_CHART_INFO } diff --git a/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue b/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue index c970f73314..9e5a3b4799 100644 --- a/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue +++ b/core/frontend/src/views/panel/subjectSetting/panelStyle/OverallSetting.vue @@ -83,6 +83,49 @@ + + + + + {{ $t('panel.refresh_browser_frequency') }} + + + + +
+ {{ $t('panel.refresh_browser_tips') }} +
+ +
+
+
+
+ + + +
+
@@ -186,6 +229,13 @@ export default { initForm() { this.overallSettingForm = this.canvasStyleData }, + refreshBrowserTimeChange(val) { + if (val < 1) { + this.overallSettingForm.refreshBrowserTime = 1 + } else if (val > 3600) { + this.overallSettingForm.refreshBrowserTime = 3600 + } + }, themeChange(modifyName) { if (modifyName === 'themeColor') { // 主题变更 @@ -238,6 +288,15 @@ export default { font-size: 12px; } +.el-input-refresh-browser { + font-size: 12px; +} + +.el-input-refresh-browser-inner { + width: calc(50% + 4px); + padding-top: 2px; +} + .margin-left4 { margin-left: 4px; }