From 1ed1ed508535beb3977cb25f0da54e2acb8bbd48 Mon Sep 17 00:00:00 2001 From: Carson Date: Sat, 16 May 2026 07:02:22 +0800 Subject: [PATCH 1/2] feat(query): add year to last month end range --- .../v-query/ConditionDefaultConfiguration.vue | 8 +++++ .../custom-component/v-query/FilterTime.vue | 8 +++++ .../v-query/QueryConditionConfiguration.vue | 8 +++++ .../v-query/RangeFilterTime.vue | 8 +++++ .../v-query/time-format-dayjs.ts | 34 ++++++++++++++++--- core/core-frontend/src/locales/en.ts | 1 + core/core-frontend/src/locales/tw.ts | 1 + core/core-frontend/src/locales/zh-CN.ts | 1 + 8 files changed, 64 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue index 8804c4f60f..f23cf53c02 100644 --- a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue @@ -229,6 +229,10 @@ const relativeToCurrentListRange = computed(() => { { label: t('common.to_this_month'), value: 'YearToThisMonth' + }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' } ] break @@ -263,6 +267,10 @@ const relativeToCurrentListRange = computed(() => { label: t('v_query.year_to_date'), value: 'yearBeginning' }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' + }, { label: t('common.month_to_yesterday'), value: 'monthToYesterday' diff --git a/core/core-frontend/src/custom-component/v-query/FilterTime.vue b/core/core-frontend/src/custom-component/v-query/FilterTime.vue index da52e556be..76b1dfe2e4 100644 --- a/core/core-frontend/src/custom-component/v-query/FilterTime.vue +++ b/core/core-frontend/src/custom-component/v-query/FilterTime.vue @@ -217,6 +217,10 @@ const relativeToCurrentListRange = computed(() => { { label: t('common.to_this_month'), value: 'YearToThisMonth' + }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' } ] break @@ -243,6 +247,10 @@ const relativeToCurrentListRange = computed(() => { label: t('v_query.year_to_date'), value: 'yearBeginning' }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' + }, { label: t('common.month_to_yesterday'), value: 'monthToYesterday' diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index eef7b9e3b7..a90f2e7358 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -2184,6 +2184,10 @@ const relativeToCurrentListRange = computed(() => { { label: t('common.to_this_month'), value: 'YearToThisMonth' + }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' } ] break @@ -2210,6 +2214,10 @@ const relativeToCurrentListRange = computed(() => { label: t('v_query.year_to_date'), value: 'yearBeginning' }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' + }, { label: t('common.month_to_yesterday'), value: 'monthToYesterday' diff --git a/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue index 817a3a757b..f195c20431 100644 --- a/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue +++ b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue @@ -228,6 +228,10 @@ const relativeToCurrentListRange = computed(() => { { label: t('common.to_this_month'), value: 'YearToThisMonth' + }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' } ] break @@ -254,6 +258,10 @@ const relativeToCurrentListRange = computed(() => { label: t('v_query.year_to_date'), value: 'yearBeginning' }, + { + label: t('v_query.year_to_last_month_end'), + value: 'YearToLastMonthEnd' + }, { label: t('common.month_to_yesterday'), value: 'monthToYesterday' diff --git a/core/core-frontend/src/custom-component/v-query/time-format-dayjs.ts b/core/core-frontend/src/custom-component/v-query/time-format-dayjs.ts index 4e0a0a3693..43ba232399 100644 --- a/core/core-frontend/src/custom-component/v-query/time-format-dayjs.ts +++ b/core/core-frontend/src/custom-component/v-query/time-format-dayjs.ts @@ -1,11 +1,23 @@ import dayjs from 'dayjs' -import type { ManipulateType } from 'dayjs' -function getThisStart(val = 'month' as ManipulateType | 'quarter') { - return new Date(dayjs().startOf(val).format('YYYY/MM/DD HH:mm:ss')) +import type { ManipulateType, QUnitType } from 'dayjs' +import quarterOfYear from 'dayjs/plugin/quarterOfYear' +type ManipulateTypeWithQuarter = ManipulateType | 'quarter' +dayjs.extend(quarterOfYear) + +function getThisStart(val = 'month' as ManipulateTypeWithQuarter) { + return new Date( + dayjs() + .startOf(val as QUnitType) + .format('YYYY/MM/DD HH:mm:ss') + ) } -function getThisEnd(val = 'month' as ManipulateType | 'quarter') { - return new Date(dayjs().endOf(val).format('YYYY/MM/DD HH:mm:ss')) +function getThisEnd(val = 'month' as ManipulateTypeWithQuarter) { + return new Date( + dayjs() + .endOf(val as QUnitType) + .format('YYYY/MM/DD HH:mm:ss') + ) } function getLastStart(val = 'month' as ManipulateType) { @@ -16,6 +28,15 @@ function getLastEnd(val = 'month' as ManipulateType) { return new Date(dayjs().subtract(1, val).endOf(val).format('YYYY/MM/DD HH:mm:ss')) } +function getYearToLastMonthEnd(): [Date, Date] { + const start = getThisStart('year') + const end = getLastEnd('month') + if (+start > +end) { + return [start, getThisEnd('day')] + } + return [start, end] +} + function getAround(val = 'month' as ManipulateType, type = 'add', num = 0) { if (val === 'week') { return new Date(dayjs().endOf('week').add(1, 'day').endOf('day').format('YYYY/MM/DD HH:mm:ss')) @@ -70,6 +91,8 @@ function getCustomRange(relativeToCurrentRange: string): [Date, Date] { ] case 'YearToThisMonth': return [new Date(dayjs().startOf('year').format('YYYY/MM/DD HH:mm:ss')), getThisEnd('month')] + case 'YearToLastMonthEnd': + return getYearToLastMonthEnd() case 'monthToYesterday': const sm = new Date(dayjs().startOf('month').format('YYYY/MM/DD HH:mm:ss')) const ld = getLastEnd('day') @@ -99,6 +122,7 @@ export { getThisEnd, getLastStart, getLastEnd, + getYearToLastMonthEnd, getAround, getCustomRange, getAroundStart diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index b0380a7845..5ae1088565 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -2862,6 +2862,7 @@ export default { last_3_days: 'Last 3 days', month_to_date: 'Month to date', year_to_date: 'Year to date', + year_to_last_month_end: 'Year to end of last month', exact_match: 'Exact', fuzzy_match: 'Fuzzy', option_type: 'Option type', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 4105371597..884fbf9d1f 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -2792,6 +2792,7 @@ export default { last_3_days: '最近3 天', month_to_date: '月初至今', year_to_date: '年初至今', + year_to_last_month_end: '年初至上月底', exact_match: '精確匹配', fuzzy_match: '模糊匹配', option_type: '選項類型', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 4731283893..7939075432 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2798,6 +2798,7 @@ export default { last_3_days: '最近 3 天', month_to_date: '月初至今', year_to_date: '年初至今', + year_to_last_month_end: '年初至上月末', exact_match: '精确匹配', fuzzy_match: '模糊匹配', option_type: '选项类型', From 0269982d6abe1b29360d5f8fc44b1aee5503f8cc Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 19 May 2026 15:34:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/views/chart/ChartView.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/ChartView.vue b/core/core-frontend/src/views/chart/ChartView.vue index ab5d618a76..e3563eff01 100644 --- a/core/core-frontend/src/views/chart/ChartView.vue +++ b/core/core-frontend/src/views/chart/ChartView.vue @@ -27,6 +27,10 @@ const Dataset = defineAsyncComponent(() => import('@/views/visualized/data/datas const Datasource = defineAsyncComponent( () => import('@/views/visualized/data/datasource/index.vue') ) + +const ExportExcel = defineAsyncComponent( + () => import('@/views/visualized/data/dataset/ExportExcel.vue') +) const ScreenPanel = defineAsyncComponent(() => import('@/views/data-visualization/PreviewShow.vue')) const DashboardPanel = defineAsyncComponent( () => import('@/views/dashboard/DashboardPreviewShow.vue') @@ -45,7 +49,8 @@ const componentMap = { Datasource, ScreenPanel, DashboardPanel, - TemplateManage + TemplateManage, + ExportExcel } const iframeStyle = ref(null) const setStyle = debounce(() => {