From 5275947fe9d0d8684165f7bab3104fd78768745b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 8 Aug 2024 17:26:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E6=94=AF=E6=8C=81=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E4=BC=B8=E7=BC=A9=E6=96=B9=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/CanvasAttr.vue | 45 ++++++++++++++++++- core/core-frontend/src/utils/canvasUtils.ts | 1 + .../editor/util/dataVisualization.ts | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue index 90c23a19aa..67a37243fb 100644 --- a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue +++ b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue @@ -3,7 +3,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { storeToRefs } from 'pinia' import { nextTick, onMounted, ref } from 'vue' -import { ElFormItem } from 'element-plus-secondary' +import { ElFormItem, ElIcon } from 'element-plus-secondary' import { merge, cloneDeep } from 'lodash-es' import { useEmitt } from '@/hooks/web/useEmitt' @@ -11,12 +11,20 @@ import ComponentColorSelector from '@/components/dashboard/subject-setting/dashb import OverallSetting from '@/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue' import CanvasBackground from '@/components/visualization/component-background/CanvasBackground.vue' import SeniorStyleSetting from '@/components/dashboard/subject-setting/dashboard-style/SeniorStyleSetting.vue' +import Icon from '../icon-custom/src/Icon.vue' const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() const { canvasStyleData, canvasViewInfo } = storeToRefs(dvMainStore) let canvasAttrInit = false const canvasAttrActiveNames = ref(['size', 'background', 'color']) + +const screenAdaptorList = [ + { label: '宽度优先', value: 'widthFirst' }, + { label: '高度优先', value: 'heightFirst' }, + { label: '铺满全屏', value: 'full' }, + { label: '不缩放', value: 'keepSize' } +] const init = () => { nextTick(() => { canvasAttrInit = true @@ -105,6 +113,33 @@ onMounted(() => { + + + 缩放方式 + + + + + + + + + + + @@ -129,6 +164,10 @@ onMounted(() => { diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 9f65374438..385ecbf3be 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -130,6 +130,7 @@ export function historyAdaptor( //历史字段适配 canvasStyleResult.component['seniorStyleSetting'] = canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT) + canvasStyleResult['screenAdaptor'] = canvasStyleResult['screenAdaptor'] || 'widthFirst' canvasStyleResult['popupAvailable'] = canvasStyleResult['popupAvailable'] === undefined ? true : canvasStyleResult['popupAvailable'] //兼容弹框区域开关 const reportFilterInfo = canvasInfo.reportFilterInfo 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 10fb24790e..ea8f05674e 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 @@ -85,6 +85,7 @@ export const DEFAULT_CANVAS_STYLE_DATA_BASE = { refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟 refreshTime: 5, // 仪表板刷新时间 默认5分钟 popupAvailable: true, // 弹窗区域是否可用 默认为true + screenAdaptor: 'widthFirst', // 屏幕适配方式 widthFirst=宽度优先 heightFirst=高度优先 full=铺满全屏 keepSize=不缩放 scale: 60, scaleWidth: 100, scaleHeight: 100,