From d52c755bcf3789ad278b870f45d8b3439f2abc75 Mon Sep 17 00:00:00 2001 From: junjun Date: Fri, 14 Mar 2025 11:24:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E8=A7=A3=E6=9E=90=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/manage/ChartViewManege.java | 1 + .../java/io/dataease/engine/utils/Utils.java | 2 ++ core/core-frontend/src/locales/en.ts | 5 +++ core/core-frontend/src/locales/tw.ts | 5 +++ core/core-frontend/src/locales/zh-CN.ts | 5 +++ .../editor/drag-item/DimensionItem.vue | 33 +++++++++++++++++++ .../view/dto/ChartViewFieldBaseDTO.java | 11 +++++++ 7 files changed, 62 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartViewManege.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartViewManege.java index 22714474b7..22ce707796 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartViewManege.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartViewManege.java @@ -356,6 +356,7 @@ public class ChartViewManege { BeanUtils.copyBean(dto, ele); dto.setDateStyle("y_M_d"); dto.setDatePattern("date_sub"); + dto.setDateShowFormat("y_M_d"); dto.setChartType("bar"); if (dto.getId() == -1L || dto.getDeType() == 0 || dto.getDeType() == 1 || dto.getDeType() == 7) { diff --git a/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java b/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java index a7a19aa60c..f23263c787 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java +++ b/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java @@ -161,6 +161,8 @@ public class Utils { return "MM" + split + "dd"; case "H_m_s": return "HH:mm:ss"; + case "y_M_d_H": + return "yyyy" + split + "MM" + split + "dd" + " HH"; case "y_M_d_H_m": return "yyyy" + split + "MM" + split + "dd" + " HH:mm"; case "y_M_d_H_m_s": diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 4e83ad2d48..4f5a7feb33 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1441,7 +1441,12 @@ export default { y_W: 'Year Week', y_M_d: 'Year Month Day', M_d: 'Month Day', + M: 'Month', + d: 'Day', + H: 'Hours', + H_m: 'Hours Minutes', H_m_s: 'Hours Minutes Seconds', + y_M_d_H: 'Year Month Day Hours', y_M_d_H_m: 'Year Month Day Hours Minutes', y_M_d_H_m_s: 'Year Month Day Hours Minutes Seconds', date_sub: 'yyyy-MM-dd', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index a20237c1ef..fdc783c1e7 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1406,7 +1406,12 @@ export default { y_W: '年周', y_M_d: '年月日', M_d: '月日', + M: '月', + d: '日', + H: '時', + H_m: '時分', H_m_s: '時分秒', + y_M_d_H: '年月日時', y_M_d_H_m: '年月日時分', y_M_d_H_m_s: '年月日時分秒', date_sub: 'yyyy-MM-dd', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 224de85a79..e9989652a8 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1411,7 +1411,12 @@ export default { y_W: '年周', y_M_d: '年月日', M_d: '月日', + M: '月', + d: '日', + H: '时', + H_m: '时分', H_m_s: '时分秒', + y_M_d_H: '年月日时', y_M_d_H_m: '年月日时分', y_M_d_H_m_s: '年月日时分秒', date_sub: 'yyyy-MM-dd', diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue index 0399dc490b..1e204d5efc 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue @@ -212,6 +212,20 @@ const toggleHide = () => { const showHideIcon = computed(() => { return ['table-info', 'table-normal'].includes(props.chart.type) && item.value.hide }) +const dateShowFormatConfig = [ + { name: t('chart.y'), value: 'y', noSplit: true }, + { name: t('chart.y_M'), value: 'y_M', noSplit: false }, + { name: t('chart.y_M_d'), value: 'y_M_d', noSplit: false }, + { name: t('chart.M'), value: 'M', noSplit: true }, + { name: t('chart.M_d'), value: 'M_d', noSplit: false }, + { name: t('chart.d'), value: 'd', noSplit: true }, + { name: t('chart.y_M_d_H'), value: 'y_M_d_H', noSplit: false }, + { name: t('chart.y_M_d_H_m'), value: 'y_M_d_H_m', noSplit: false }, + { name: t('chart.y_M_d_H_m_s'), value: 'y_M_d_H_m_s', noSplit: false }, + { name: t('chart.H'), value: 'H', noSplit: true }, + { name: t('chart.H_m'), value: 'H_m', noSplit: true }, + { name: t('chart.H_m_s'), value: 'H_m_s', noSplit: true } +] onMounted(() => { getItemTagType() }) @@ -531,6 +545,25 @@ onMounted(() => { + + + {{ t('chart.y_M_d_H') }} + + + + +