From fc51f531edb5d428eeadd35ece314940e2d07ca0 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 6 Aug 2024 17:34:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E8=8C=83=E5=9B=B4=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E6=B2=A1=E6=9C=89=E6=9C=AC=E6=9C=88?= =?UTF-8?q?=E3=80=81=E6=9C=AC=E5=B9=B4=E7=AD=89=20#11283?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v-query/ConditionDefaultConfiguration.vue | 94 +++++++++++++++++++ .../v-query/DynamicTimeRange.vue | 11 +++ .../v-query/QueryConditionConfiguration.vue | 85 +++++++++++++++++ .../v-query/time-format-dayjs.ts | 44 ++++++++- 4 files changed, 233 insertions(+), 1 deletion(-) 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 87013f3b9d..9af4ed4773 100644 --- a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue @@ -156,6 +156,85 @@ const relativeToCurrentList = computed(() => { ] }) +const relativeToCurrentListRange = computed(() => { + let list = [] + if (!curComponent.value) return list + switch (curComponent.value.timeGranularityMultiple) { + case 'yearrange': + list = [ + { + label: '今年', + value: 'thisYear' + }, + { + label: '去年', + value: 'lastYear' + } + ] + break + case 'monthrange': + list = [ + { + label: '本月', + value: 'thisMonth' + }, + { + label: '上月', + value: 'lastMonth' + }, + { + label: '最近 3 个 月', + value: 'LastThreeMonths' + }, + { + label: '最近 6 个 月', + value: 'LastSixMonths' + }, + { + label: '最近 12 个 月', + value: 'LastTwelveMonths' + } + ] + break + case 'daterange': + case 'datetimerange': + list = [ + { + label: '今天', + value: 'today' + }, + { + label: '昨天', + value: 'yesterday' + }, + { + label: '最近 3 天', + value: 'LastThreeDays' + }, + { + label: '月初至今', + value: 'monthBeginning' + }, + { + label: '年初至今', + value: 'yearBeginning' + } + ] + break + + default: + break + } + + return [ + ...list, + { + label: '自定义', + value: 'custom' + } + ] +}) + const aroundList = [ { label: '前', @@ -405,8 +484,22 @@ defineExpose({