From c083450070934f74d6c636eefb002313886ebd71 Mon Sep 17 00:00:00 2001 From: Minamiyama Date: Thu, 25 Sep 2025 08:50:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=9C=AC=E5=9C=B0=E5=8C=96):=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=86=85=E8=BE=B9=E8=B7=9D=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=94=AE=E5=90=8D=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=86=85=E8=BE=B9=E8=B7=9D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将内边距模式相关的翻译键名统一添加前缀"inner_padding_" 优化BackgroundOverallCommon.vue中内边距的undefined检查 在Shape.vue中重命名padding变量为innerPaddingStyle以提高可读性 --- .../src/components/data-visualization/canvas/Shape.vue | 10 +++++----- .../component-background/BackgroundOverallCommon.vue | 2 +- core/core-frontend/src/locales/en.ts | 6 +++--- core/core-frontend/src/locales/tw.ts | 6 +++--- core/core-frontend/src/locales/zh-CN.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) 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 32b3418d02..c51df58dfd 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -934,16 +934,16 @@ const componentBackgroundStyle = computed(() => { } = element.value.commonBackground const commonBackground = element.value.commonBackground as CommonBackground const innerPaddingTarget = ['Group'].includes(element.value.component) ? 0 : innerPadding - let padding = innerPaddingTarget * scale.value + 'px' + let innerPaddingStyle = innerPaddingTarget * scale.value + 'px' const paddingMode = commonBackground.innerPadding2?.mode if (paddingMode === ShorthandMode.Uniform) { - padding = `${commonBackground.innerPadding2?.top * scale.value}px` + innerPaddingStyle = `${commonBackground.innerPadding2?.top * scale.value}px` } else if (paddingMode === ShorthandMode.Axis) { - padding = `${commonBackground.innerPadding2?.top * scale.value}px ${ + innerPaddingStyle = `${commonBackground.innerPadding2?.top * scale.value}px ${ commonBackground.innerPadding2?.left * scale.value }px` } else if (paddingMode === ShorthandMode.PerEdge) { - padding = `${commonBackground.innerPadding2?.top * scale.value}px ${ + innerPaddingStyle = `${commonBackground.innerPadding2?.top * scale.value}px ${ commonBackground.innerPadding2?.right * scale.value }px ${commonBackground.innerPadding2?.bottom * scale.value}px ${ commonBackground.innerPadding2?.left * scale.value @@ -951,7 +951,7 @@ const componentBackgroundStyle = computed(() => { } let style = { - padding: padding, + padding: innerPaddingStyle, borderRadius: borderRadius + 'px' } let colorRGBA = '' 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 d2c8b559a4..aeed30c595 100644 --- a/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue +++ b/core/core-frontend/src/components/visualization/component-background/BackgroundOverallCommon.vue @@ -388,7 +388,7 @@ const queryBackground = () => { const init = () => { const commonBackgroundPop = deepCopy(props.commonBackgroundPop) const innerPadding = commonBackgroundPop.innerPadding - if (innerPadding) { + if (typeof innerPadding !== 'undefined') { commonBackgroundPop.innerPadding2 = { mode: ShorthandMode.Uniform, top: innerPadding, diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index fd7e85a0b8..00a9476778 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -3385,9 +3385,9 @@ export default { stream_mobile_tips: 'May not be displayed on IOS devices', json_params_error: 'Failed to parse third-party parameters. Please check the parameter format.', inner_padding: 'Inner Padding', - shorthand_mode_uniform: 'Uniform', - shorthand_mode_axis: 'Axis', - shorthand_mode_per_edge: 'Per Edge', + inner_padding_shorthand_mode_uniform: 'Uniform', + inner_padding_shorthand_mode_axis: 'Axis', + inner_padding_shorthand_mode_per_edge: 'Per Edge', board_radio: 'Corners', web_set_tips: 'Some websites may not allow embedding and will not display.', repeat_params: 'Duplicate parameter names exist.', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index bdcc75ef8f..e06c642de0 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -3289,9 +3289,9 @@ export default { stream_mobile_tips: 'IOS終端可能無法顯示', json_params_error: '第三方參數解析失敗,請檢查參數格式是否正確', inner_padding: '內邊距', - shorthand_mode_uniform: '統一值', - shorthand_mode_axis: '軸向', - shorthand_mode_per_edge: '逐邊', + inner_padding_shorthand_mode_uniform: '統一值', + inner_padding_shorthand_mode_axis: '軸向', + inner_padding_shorthand_mode_per_edge: '逐邊', board_radio: '圓角', web_set_tips: '部分網站可能設置不允許嵌入而無法顯示', repeat_params: '存在名稱重複的參數', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 0dc8115db9..0d23dae2ac 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -3298,9 +3298,9 @@ export default { stream_mobile_tips: 'IOS终端可能无法显示', json_params_error: '第三方参数解析失败,请检查参数格式是否正确', inner_padding: '内边距', - shorthand_mode_uniform: '统一值', - shorthand_mode_axis: '轴向', - shorthand_mode_per_edge: '逐边', + inner_padding_shorthand_mode_uniform: '统一值', + inner_padding_shorthand_mode_axis: '轴向', + inner_padding_shorthand_mode_per_edge: '逐边', board_radio: '圆角', web_set_tips: '部分网站可能设置不允许嵌入而无法显示', repeat_params: '存在名称重复的参数',