From 54c0da715065748fc28d0bf92d747ff754c7971d Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 11 Mar 2025 10:04:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=97=A5=E6=9C=9F=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=97=B6=E9=97=B4=E6=9C=88=E5=BA=95=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E4=B8=8E=E5=AE=9E=E9=99=85=E7=BB=93=E6=9E=9C=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v-query/ConditionDefaultConfiguration.vue | 3 ++- core/core-frontend/src/hooks/web/useFilter.ts | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 10 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 ab3ee53a79..8050fb695f 100644 --- a/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/ConditionDefaultConfiguration.vue @@ -456,7 +456,8 @@ defineExpose({ {{ t('v_query.configured') }} { } } const getYearEnd = timestamp => { - const time = new Date(timestamp) return [ - +new Date(time.getFullYear(), 0, 1), - +new Date(time.getFullYear(), 11, 31) + 60 * 1000 * 60 * 24 - 1000 + +new Date(dayjs(timestamp).startOf('year').format('YYYY/MM/DD HH:mm:ss')), + +new Date(dayjs(timestamp).endOf('year').format('YYYY/MM/DD HH:mm:ss')) ] } const getMonthEnd = timestamp => { - const time = new Date(timestamp) - const date = new Date(time.getFullYear(), time.getMonth(), 1) - date.setDate(1) - date.setMonth(date.getMonth() + 1) - return [+new Date(time.getFullYear(), time.getMonth(), 1), +new Date(date.getTime() - 1000)] + return [ + +new Date(dayjs(timestamp).startOf('month').format('YYYY/MM/DD HH:mm:ss')), + +new Date(dayjs(timestamp).endOf('month').format('YYYY/MM/DD HH:mm:ss')) + ] } const getDayEnd = timestamp => { - return [+new Date(timestamp), +new Date(timestamp) + 60 * 1000 * 60 * 24 - 1000] + return [ + +new Date(dayjs(timestamp).startOf('day').format('YYYY/MM/DD HH:mm:ss')), + +new Date(dayjs(timestamp).endOf('day').format('YYYY/MM/DD HH:mm:ss')) + ] } const getFieldId = (arr, result) => {