From 8e229725517ff3d8f5f3a0c4452a74986f5aaf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Wed, 24 Apr 2024 14:38:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=81=A5=E5=A3=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useChartDataFetch.hook.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useChartDataFetch.hook.ts b/src/hooks/useChartDataFetch.hook.ts index 3976dc5d..9b1a5637 100644 --- a/src/hooks/useChartDataFetch.hook.ts +++ b/src/hooks/useChartDataFetch.hook.ts @@ -7,6 +7,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore import { RequestDataTypeEnum } from '@/enums/httpEnum' import { isPreview, newFunctionHandle, intervalUnitHandle } from '@/utils' import { setOption } from '@/packages/public/chart' +import { isNil } from 'lodash' // 获取类型 type ChartEditStoreType = typeof useChartEditStore @@ -101,9 +102,9 @@ export const useChartDataFetch = ( ) // 定时时间 - const time = targetInterval && targetInterval.value ? targetInterval.value : globalRequestInterval.value + const time = targetInterval && !isNil(targetInterval.value) ? targetInterval.value : globalRequestInterval.value // 单位 - const unit = targetInterval && targetInterval.value ? targetUnit.value : globalUnit.value + const unit = targetInterval && !isNil(targetInterval.value) ? targetUnit.value : globalUnit.value // 开启轮询 if (time) { fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))