From 73c794d31e51cde4e20749786de47da318da42f8 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 19 Nov 2025 18:52:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=86=85=E8=BE=B9=E8=B7=9D=E5=92=8C=E5=9C=86?= =?UTF-8?q?=E8=A7=92=E6=94=AF=E6=8C=81=E5=88=86=E5=BC=80=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/canvas/Shape.vue | 33 ++- .../BackgroundOverallCommon.vue | 266 ++++++++++++++++-- .../component-background/Types.ts | 61 ++++ .../src/custom-component/component-list.ts | 16 +- .../custom-component/de-tabs/Component.vue | 34 ++- core/core-frontend/src/locales/en.ts | 16 ++ core/core-frontend/src/locales/tw.ts | 16 ++ core/core-frontend/src/locales/zh-CN.ts | 16 ++ core/core-frontend/src/utils/canvasUtils.ts | 49 +++- 9 files changed, 469 insertions(+), 38 deletions(-) create mode 100644 core/core-frontend/src/components/visualization/component-background/Types.ts diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue index 1b371a3520..b349d6551f 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -158,6 +158,11 @@ import { import Board from '@/components/de-board/Board.vue' import { activeWatermarkCheckUser, removeActiveWatermark } from '@/components/watermark/watermark' import { useI18n } from '@/hooks/web/useI18n' +import { + CommonBackground, + ShorthandMode +} from '@/components/visualization/component-background/Types' + const { t } = useI18n() const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() @@ -962,10 +967,34 @@ const componentBackgroundStyle = computed(() => { innerPadding, borderRadius } = element.value.commonBackground + const commonBackground = element.value.commonBackground as CommonBackground const innerPaddingTarget = ['Group'].includes(element.value.component) ? 0 : innerPadding + let innerPaddingStyle = innerPaddingTarget * scale.value + 'px' + const paddingMode = commonBackground.innerPadding?.mode + if (paddingMode === ShorthandMode.Uniform) { + innerPaddingStyle = `${commonBackground.innerPadding?.top * scale.value}px` + } else if (paddingMode === ShorthandMode.PerEdge) { + innerPaddingStyle = `${commonBackground.innerPadding?.top * scale.value}px ${ + commonBackground.innerPadding?.right * scale.value + }px ${commonBackground.innerPadding?.bottom * scale.value}px ${ + commonBackground.innerPadding?.left * scale.value + }px` + } + + let borderRadiusStyle = borderRadius + 'px' + const borderRadiusMode = commonBackground.borderRadius?.mode + if (borderRadiusMode === ShorthandMode.Uniform) { + borderRadiusStyle = `${commonBackground.borderRadius?.topLeft * scale.value}px` + } else if (borderRadiusMode === ShorthandMode.PerEdge) { + borderRadiusStyle = `${commonBackground.borderRadius?.topLeft * scale.value}px ${ + commonBackground.borderRadius?.topRight * scale.value + }px ${commonBackground.borderRadius?.bottomRight * scale.value}px ${ + commonBackground.borderRadius?.bottomLeft * scale.value + }px` + } let style = { - padding: innerPaddingTarget * scale.value + 'px', - borderRadius: borderRadius + 'px' + padding: innerPaddingStyle, + borderRadius: borderRadiusStyle } let colorRGBA = '' if (backgroundColorSelect && backgroundColor) { diff --git a/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue b/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue index 57659141b0..dacd980c78 100644 --- a/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue +++ b/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue @@ -15,38 +15,192 @@ /> - + - +
+ {{ + t('visualization.inner_padding_shorthand_mode') + }} + + + +
+ + +
+ {{ + t('visualization.edge_top') + }} + +
+
+ {{ + t('visualization.edge_left') + }} + +
+
+ +
+ {{ + t('visualization.edge_bottom') + }} + +
+
+ {{ + t('visualization.edge_right') + }} + +
+
+
- +
+ + - +
+ {{ + t('visualization.corner_shorthand_mode') + }} + + + +
+ + +
+ {{ + t('visualization.corner_top_left') + }} + +
+
+ {{ + t('visualization.corner_bottom_left') + }} + +
+
+ +
+ {{ + t('visualization.corner_top_right') + }} + +
+
+ {{ + t('visualization.corner_bottom_right') + }} + +
+
+
@@ -218,7 +372,7 @@ class="image-hint" :class="`image-hint_${themes}`" > - 支持JPG、PNG、GIF、SVG + {{ t('visualization.panel_background_image_tips') }} - 重新上传 + {{ t('visualization.reUpload') }} @@ -244,7 +398,7 @@