From 08271e7bfc523e5b1058f8901f3e3782b1499147 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Tue, 15 Nov 2022 16:52:40 +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=E8=A7=86=E5=9B=BE=E5=88=B7=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=BC=80=E5=85=B3=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/canvas/DeCanvas.vue | 2 +-
.../canvas/components/editor/EditBar.vue | 2 +-
.../canvas/components/editor/Preview.vue | 24 +++++-----
frontend/src/components/canvas/utils/utils.js | 16 ++++---
frontend/src/lang/en.js | 12 +++++
frontend/src/lang/tw.js | 12 +++++
frontend/src/lang/zh.js | 12 +++++
frontend/src/views/panel/panel.js | 2 +
.../src/views/panel/subjectSetting/index.vue | 24 +++++-----
.../panelStyle/BackgroundSelector.vue | 2 +-
.../panelStyle/FilterStyleSelector.vue | 44 +++++++++++--------
.../panelStyle/OverallSetting.vue | 12 ++++-
12 files changed, 113 insertions(+), 51 deletions(-)
diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue
index 0cffaf824a..38b1259fa1 100644
--- a/frontend/src/components/canvas/DeCanvas.vue
+++ b/frontend/src/components/canvas/DeCanvas.vue
@@ -8,7 +8,7 @@
@mouseup="deselectCurComponent"
@scroll="canvasScroll"
>
-
+
-
+
diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue
index 89c02365f9..b4f021fb8f 100644
--- a/frontend/src/components/canvas/components/editor/Preview.vue
+++ b/frontend/src/components/canvas/components/editor/Preview.vue
@@ -428,19 +428,21 @@ export default {
},
canvasStyleDataInit() {
// 数据刷新计时器
- this.searchCount = 0
- this.timer && clearInterval(this.timer)
- let refreshTime = 300000
- if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
- if (this.canvasStyleData.refreshUnit === 'second') {
- refreshTime = this.canvasStyleData.refreshTime * 1000
- } else {
- refreshTime = this.canvasStyleData.refreshTime * 60000
+ if (this.canvasStyleData.refreshViewEnable) {
+ this.searchCount = 0
+ this.timer && clearInterval(this.timer)
+ let refreshTime = 300000
+ if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
+ if (this.canvasStyleData.refreshUnit === 'second') {
+ refreshTime = this.canvasStyleData.refreshTime * 1000
+ } else {
+ refreshTime = this.canvasStyleData.refreshTime * 60000
+ }
}
+ this.timer = setInterval(() => {
+ this.searchCount++
+ }, refreshTime)
}
- this.timer = setInterval(() => {
- this.searchCount++
- }, refreshTime)
},
changeStyleWithScale,
getStyle,
diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js
index aa9bf63c4a..a64da813e9 100644
--- a/frontend/src/components/canvas/utils/utils.js
+++ b/frontend/src/components/canvas/utils/utils.js
@@ -1,11 +1,10 @@
import {
- BASE_MOBILE_STYLE, COMMON_BACKGROUND_NONE,
+ BASE_MOBILE_STYLE,
+ COMMON_BACKGROUND_NONE,
HYPERLINKS
} from '@/components/canvas/customComponent/component-list'
-import {
- ApplicationContext
-} from '@/utils/ApplicationContext'
+import { ApplicationContext } from '@/utils/ApplicationContext'
import { uuid } from 'vue-uuid'
import store from '@/store'
import { AIDED_DESIGN, PANEL_CHART_INFO, TAB_COMMON_STYLE } from '@/views/panel/panel'
@@ -49,6 +48,7 @@ export function toTop(arr, i, j) {
export function toBottom(arr, i) {
arr.unshift(arr.splice(i, 1)[0])
}
+
export function $(selector) {
return document.querySelector(selector)
}
@@ -80,6 +80,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
componentStyle.refreshTime = (componentStyle.refreshTime || 5)
componentStyle.refreshViewLoading = (componentStyle.refreshViewLoading || false)
componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute')
+ componentStyle.refreshViewEnable = (componentStyle.refreshViewEnable === undefined ? true : componentStyle.refreshViewEnable)
componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN))
componentStyle.chartInfo = (componentStyle.chartInfo || deepCopy(PANEL_CHART_INFO))
componentStyle.chartInfo.tabStyle = (componentStyle.chartInfo.tabStyle || deepCopy(TAB_COMMON_STYLE))
@@ -209,8 +210,11 @@ export function exportImg(imgName) {
}
export function dataURLToBlob(dataurl) { // ie 图片转格式
- const arr = dataurl.split(','); const mime = arr[0].match(/:(.*?);/)[1]
- const bstr = atob(arr[1]); let n = bstr.length; const u8arr = new Uint8Array(n)
+ const arr = dataurl.split(',')
+ const mime = arr[0].match(/:(.*?);/)[1]
+ const bstr = atob(arr[1])
+ let n = bstr.length
+ const u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index 863e8c6aec..7b45e7298b 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -1865,6 +1865,18 @@ export default {
sure_bt: 'Confirm'
},
panel: {
+ board: 'Border',
+ text: 'Text',
+ board_background: 'Background',
+ title_color: 'Title color',
+ input_style: 'Input box style (color)',
+ overall_setting: 'Overall setting',
+ panel_background: 'Panel background',
+ component_color: 'Component color',
+ chart_title: 'Chart title',
+ filter_component: 'Filter component',
+ enable_refresh_view: 'Enable refresh',
+ enable_view_loading: 'View loading prompt',
image_size_tips: 'Please do not exceed 15M in the picture',
image_add_tips: 'Only pictures can be inserted',
watermark: 'Watermark',
diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js
index 15d447be85..32b2d9f6a9 100644
--- a/frontend/src/lang/tw.js
+++ b/frontend/src/lang/tw.js
@@ -1865,6 +1865,18 @@ export default {
sure_bt: '確定'
},
panel: {
+ board: '邊框',
+ text: '文字',
+ board_background: '背景',
+ title_color: '標題顏色',
+ input_style: '輸入框樣式(顏色)',
+ overall_setting: '整體配置',
+ panel_background: '儀表板背景',
+ component_color: '組件配色',
+ chart_title: '圖表標題',
+ filter_component: '過濾組件',
+ enable_refresh_view: '開啟刷新',
+ enable_view_loading: '視圖加載提示',
image_size_tips: '圖片請不要大於15M',
image_add_tips: '只能插入圖片',
watermark: '水印',
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index 533defbed1..d331c9fa4d 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -1865,6 +1865,18 @@ export default {
sure_bt: '确定'
},
panel: {
+ board: '边框',
+ text: '文字',
+ board_background: '背景',
+ title_color: '标题颜色',
+ input_style: '输入框样式(颜色)',
+ overall_setting: '整体配置',
+ panel_background: '仪表板背景',
+ component_color: '组件配色',
+ chart_title: '图表标题',
+ filter_component: '过滤组件',
+ enable_refresh_view: '开启刷新',
+ enable_view_loading: '视图加载提示',
image_size_tips: '图片请不要大于15M',
image_add_tips: '只能插入图片',
watermark: '水印',
diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js
index d7a26c1731..55e25fa733 100644
--- a/frontend/src/views/panel/panel.js
+++ b/frontend/src/views/panel/panel.js
@@ -2,6 +2,7 @@
import { DEFAULT_COLOR_CASE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import { deepCopy } from '@/components/canvas/utils/utils'
import { COMMON_BACKGROUND_BASE } from '@/components/canvas/customComponent/component-list'
+
export const TAB_COMMON_STYLE = {
headFontColor: '#000000',
headFontActiveColor: '#000000',
@@ -60,6 +61,7 @@ export const CANVAS_STYLE = {
showGrid: false,
matrixBase: 4 // 当前matrix的基数 (是pcMatrixCount的几倍)
}, // 辅助设计
+ refreshViewEnable: true, // 开启视图刷新(默认开启)
refreshViewLoading: true, // 仪表板视图loading提示
refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟
refreshTime: 5, // 仪表板刷新时间 默认5分钟
diff --git a/frontend/src/views/panel/subjectSetting/index.vue b/frontend/src/views/panel/subjectSetting/index.vue
index 2478507a09..a34dc1606e 100644
--- a/frontend/src/views/panel/subjectSetting/index.vue
+++ b/frontend/src/views/panel/subjectSetting/index.vue
@@ -21,7 +21,7 @@
@change="handleChange"
>
@@ -29,31 +29,31 @@
@@ -204,21 +204,21 @@ export default {
font-weight: 700
}
-.theme-slider-position{
+.theme-slider-position {
height: 1px;
position: absolute;
left: 15px;
right: 15px;
top: 40px;
- box-sizing:border-box;
+ box-sizing: border-box;
border-bottom: 1px solid #e8eaed
}
-::v-deep .el-collapse-item__header{
- font-weight: 500!important;
- font-size: 14px!important;
+::v-deep .el-collapse-item__header {
+ font-weight: 500 !important;
+ font-size: 14px !important;
color: var(--TextPrimary, #1F2329);
- padding: 0!important;
+ padding: 0 !important;
}
diff --git a/frontend/src/views/panel/subjectSetting/panelStyle/BackgroundSelector.vue b/frontend/src/views/panel/subjectSetting/panelStyle/BackgroundSelector.vue
index e286b2d41c..2e60b5b8ed 100644
--- a/frontend/src/views/panel/subjectSetting/panelStyle/BackgroundSelector.vue
+++ b/frontend/src/views/panel/subjectSetting/panelStyle/BackgroundSelector.vue
@@ -45,7 +45,7 @@
:on-remove="handleRemove"
:file-list="fileList"
>
-
+
{{ $t('chart.text_pos_center') }}
+ >{{ $t('chart.text_pos_center') }}
+
{{ $t('chart.text_pos_right') }}
@@ -38,11 +39,12 @@
{{ $t('chart.text_pos_center') }}
+ >{{ $t('chart.text_pos_center') }}
+
- 输入框样式(颜色)
+ {{ $t('panel.input_style') }}
- 边框
+ {{ $t('panel.board') }}
- 文字
+ {{ $t('panel.text') }}
- 背景
+ {{ $t('panel.board_background') }}