From c0eb3dbd2668865c256975071c0190f72e36f78d Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 10 Sep 2024 11:07:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=90=8C=E7=8E=AF?= =?UTF-8?q?=E6=AF=94=E5=A2=9E=E5=8A=A0=E5=85=B7=E4=BD=93=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/chart/charts/impl/DefaultChartHandler.java | 2 ++ core/core-frontend/src/locales/zh-CN.ts | 1 + .../components/editor/drag-item/components/CompareEdit.vue | 2 ++ 3 files changed, 5 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java index 4f124f9b70..bcfbcfe54e 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java @@ -328,6 +328,8 @@ public class DefaultChartHandler extends AbstractChartPlugin { .setScale(8, RoundingMode.HALF_UP) .toString(); } + } else if (StringUtils.equalsIgnoreCase(resultData, "pre")) { + item[dataIndex] = new BigDecimal(lastValue).toString(); } } } diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 3b69db823f..f74aa2f12c 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1098,6 +1098,7 @@ export default { quarter_mom: '季环比', week_mom: '周环比', day_mom: '日环比', + data_pre: '具体数值', data_sub: '对比差值', data_percent: '差值百分比', compare_calc_expression: '计算公式', diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue index 361e48f38a..f1a79d22b9 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/components/CompareEdit.vue @@ -201,12 +201,14 @@ initDateFormatter() + {{ t('chart.data_pre') }} {{ t('chart.data_sub') }} {{ t('chart.data_percent') }} + 上期数据 本期数据 - 上期数据