From 1eceeef35b78374e956fd5db5c7f11dba12d2b51 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 9 Apr 2025 14:54:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=A7=BB=E5=8A=A8=E7=AB=AF):=20=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=9F=A5=E7=9C=8B=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=8C=83=E5=9B=B4=E8=BF=87=E5=8E=BB=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/custom-component/v-query/Time.vue | 6 ++++-- core/core-frontend/src/hooks/web/useFilter.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/Time.vue b/core/core-frontend/src/custom-component/v-query/Time.vue index e41d37b7ac..5a963f1175 100644 --- a/core/core-frontend/src/custom-component/v-query/Time.vue +++ b/core/core-frontend/src/custom-component/v-query/Time.vue @@ -145,6 +145,7 @@ watch( ) const handleValueChange = () => { + selectValue.value = selectValue.value.map(ele => dayjs(ele).format('YYYY/MM/DD HH:mm:ss')) const value = Array.isArray(selectValue.value) ? [...selectValue.value] : selectValue.value if (!props.isConfig) { config.value.selectValue = Array.isArray(selectValue.value) @@ -412,8 +413,9 @@ const selectSecond = ref(false) const setArrValue = () => { currentDate.value = currentDate.value.slice(0, getIndex() + 1) - const timeFormat = - currentDate.value.length === 2 ? currentDate.value.concat(['01']) : currentDate.value + const timeFormat = [1, 2].includes(currentDate.value.length) + ? currentDate.value.concat(Array([0, 2, 1][currentDate.value.length]).fill('01')) + : currentDate.value if (isRange.value) { const [start, end] = selectValue.value || [] if (selectSecond.value) { diff --git a/core/core-frontend/src/hooks/web/useFilter.ts b/core/core-frontend/src/hooks/web/useFilter.ts index fbf05e60a7..16143622ad 100644 --- a/core/core-frontend/src/hooks/web/useFilter.ts +++ b/core/core-frontend/src/hooks/web/useFilter.ts @@ -9,7 +9,7 @@ const { componentData, canvasStyleData } = storeToRefs(dvMainStore) const getDynamicRangeTime = (type: number, selectValue: any, timeGranularityMultiple: string) => { const timeType = (timeGranularityMultiple || '').split('range')[0] - if (timeGranularityMultiple === 'datetimerange' || type === 1 || !timeType) { + if (['datetimerange', 'yearrange'].includes(timeGranularityMultiple) || type === 1 || !timeType) { return selectValue.map(ele => +new Date(ele)) }