From 46ea36d14d1527bf774942b4c1ee4d34830d7b01 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 18 Mar 2025 13:31:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=97=B4=E8=B7=9D=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=AE=BE=E7=BD=AE=E5=A4=A7=E5=B0=8F=20#15009?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard-style/OverallSetting.vue | 45 +++++++++++++++++++ core/core-frontend/src/locales/en.ts | 5 +++ core/core-frontend/src/locales/tw.ts | 5 +++ core/core-frontend/src/locales/zh-CN.ts | 5 +++ core/core-frontend/src/utils/canvasUtils.ts | 1 + .../editor/util/dataVisualization.ts | 1 + 6 files changed, 62 insertions(+) diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue index 859a213db5..3e07a07b72 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue @@ -49,6 +49,34 @@ {{ t('visualization.no_gap') }} + + + {{ t('visualization.small') }} + {{ t('visualization.middle') }} + {{ t('visualization.large') }} + {{ t('visualization.custom') }} + + + + + { eventBus.emit('event-canvas-size-init') snapshotStore.recordSnapshotCache('renderChart') } +const onGapModeChange = () => { + snapshotStore.recordSnapshotCache('renderChart') + switch (canvasStyleData.value.dashboard.gapMode) { + case 'small': + canvasStyleData.value.dashboard.gapSize = 3 + break + case 'middle': + canvasStyleData.value.dashboard.gapSize = 5 + break + case 'large': + canvasStyleData.value.dashboard.gapSize = 10 + break + default: + break + } +} const themeChange = (modifyName?) => { if (modifyName === 'themeColor') { diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 99a3a1cb88..4c4bd1ed0f 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -2868,6 +2868,11 @@ export default { column_name: 'Field name' }, visualization: { + gap_size: 'Gap Size', + small: 'Small', + middle: 'Medium', + large: 'Large', + custom: 'Custom', no_details: 'No Data', sync_pc_design: 'Synchronize PC Design', title_background: 'Title Background', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index eb2a066c38..9cd81951cd 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -2789,6 +2789,11 @@ export default { column_name: '欄位名稱' }, visualization: { + gap_size: '間隙大小', + small: '小', + middle: '中', + large: '大', + custom: '自定義', no_details: '無明細數據', sync_pc_design: '同步PC設計', title_background: '標題背景', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index d9856ce06e..34ac124f9d 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2795,6 +2795,11 @@ export default { column_name: '字段名称' }, visualization: { + gap_size: '间隙大小', + small: '小', + middle: '中', + large: '大', + custom: '自定义', no_details: '无明细数据', sync_pc_design: '同步PC设计', title_background: '标题背景', diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 902227b8cd..c4485c3072 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -251,6 +251,7 @@ export function historyAdaptor( canvasStyleResult['fontFamily'] = canvasStyleResult['fontFamily'] || 'PingFang' canvasStyleResult.dashboard['showGrid'] = canvasStyleResult.dashboard['showGrid'] || false canvasStyleResult.dashboard['matrixBase'] = canvasStyleResult.dashboard['matrixBase'] || 4 + canvasStyleResult.dashboard['gapMode'] = canvasStyleResult.dashboard['gapMode'] || 'middle' canvasStyleResult.component['seniorStyleSetting'] = canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT) canvasStyleResult['suspensionButtonAvailable'] = diff --git a/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts b/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts index fece2c775b..53ac94ebdf 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts @@ -61,6 +61,7 @@ export const MOBILE_SETTING_DARK = { export const DEFAULT_DASHBOARD_STYLE_BASE = { gap: 'yes', gapSize: 5, + gapMode: 'middle', showGrid: false, matrixBase: 4, // 当前matrix的基数 (是pcMatrixCount的几倍) resultMode: 'all', // 图表结果显示模式 all 图表 custom 仪表板自定义