From 230384e2b115d7631500af3f80f48298bb180fe9 Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 22 Jan 2024 17:11:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8C=87=E6=A0=87=E5=8D=A1>=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=80=BC>=E5=90=8E=E7=BC=80=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicator/DeIndicator.vue | 5 +- .../src/models/chart/chart-style.d.ts | 1 + .../components/IndicatorNameSelector.vue | 1 + .../components/IndicatorValueSelector.vue | 274 ++++++++++-------- .../chart/components/editor/util/chart.ts | 1 + 5 files changed, 153 insertions(+), 129 deletions(-) diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue index 71c400b65c..e71f474348 100644 --- a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue +++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue @@ -194,6 +194,8 @@ const indicatorSuffixClass = ref({ 'font-synthesis': 'weight style' }) +const showSuffix = ref(DEFAULT_INDICATOR_STYLE.suffixEnable) + const suffixContent = ref('') const indicatorNameShow = ref(false) @@ -293,6 +295,7 @@ const renderChart = async view => { 'font-synthesis': 'weight style' } + showSuffix.value = customAttr.indicator.suffixEnable suffixContent.value = defaultTo(customAttr.indicator.suffix, '') } if (customAttr.indicatorName && customAttr.indicatorName.show) { @@ -359,7 +362,7 @@ defineExpose({
{{ formattedResult }} - {{ suffixContent }} + {{ suffixContent }}
{{ resultName }} diff --git a/core/core-frontend/src/models/chart/chart-style.d.ts b/core/core-frontend/src/models/chart/chart-style.d.ts index 9cdd45e017..d07758fbcd 100644 --- a/core/core-frontend/src/models/chart/chart-style.d.ts +++ b/core/core-frontend/src/models/chart/chart-style.d.ts @@ -44,6 +44,7 @@ declare interface ChartIndicatorStyle { letterSpace: string fontShadow: boolean + suffixEnable: boolean suffix: string suffixFontSize: string suffixColor: string diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue index 6444a75856..0c54dbc03d 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue @@ -149,6 +149,7 @@ watch( - - - - - - + - - + {{ t('chart.indicator_suffix') }} + -
- - + + - - - - - - - - + - + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+
+
+
+ + + + + +
+ + + +
+
+
+
+
+ + + + {{ t('chart.font_shadow') }} + +
- - - - - - -
- - - -
-
-
-
- - - - - -
- - - -
-
-
-
-
- - - - {{ t('chart.font_shadow') }} - -
diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 1bfe74f1e8..c0787cb1ad 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -359,6 +359,7 @@ export const DEFAULT_INDICATOR_STYLE: ChartIndicatorStyle = { letterSpace: '0', fontShadow: false, + suffixEnable: true, suffix: '', suffixFontSize: '14', suffixColor: '#5470C6',