diff --git a/dolphinscheduler-ui-next/src/views/home/use-process-state.ts b/dolphinscheduler-ui-next/src/views/home/use-process-state.ts index 1b6eca9138..f48e834bff 100644 --- a/dolphinscheduler-ui-next/src/views/home/use-process-state.ts +++ b/dolphinscheduler-ui-next/src/views/home/use-process-state.ts @@ -25,8 +25,8 @@ export function useProcessState() { const getProcessState = (date: Array) => { const { state } = useAsyncState( countProcessInstanceState({ - startDate: format(date[0], 'yyyy-MM-dd HH:mm:ss'), - endDate: format(date[1], 'yyyy-MM-dd HH:mm:ss'), + startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), + endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), projectCode: 0 }).then((res: TaskStateRes): StateData => { const table = res.taskCountDtos.map((item) => { diff --git a/dolphinscheduler-ui-next/src/views/home/use-task-state.ts b/dolphinscheduler-ui-next/src/views/home/use-task-state.ts index 7023a46507..d940e94503 100644 --- a/dolphinscheduler-ui-next/src/views/home/use-task-state.ts +++ b/dolphinscheduler-ui-next/src/views/home/use-task-state.ts @@ -22,11 +22,11 @@ import type { TaskStateRes } from '@/service/modules/projects-analysis/types' import type { StateData } from './types' export function useTaskState() { - const getTaskState = (date: Array) => { + const getTaskState = (date: Array) => { const { state } = useAsyncState( countTaskState({ - startDate: format(date[0], 'yyyy-MM-dd HH:mm:ss'), - endDate: format(date[1], 'yyyy-MM-dd HH:mm:ss'), + startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), + endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), projectCode: 0 }).then((res: TaskStateRes): StateData => { const table = res.taskCountDtos.map((item, index) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts b/dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts index 7a99f28a57..db238e74ee 100644 --- a/dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts +++ b/dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts @@ -28,8 +28,8 @@ export function useProcessState() { const getProcessState = (date: Array) => { const { state } = useAsyncState( countProcessInstanceState({ - startDate: format(date[0], 'yyyy-MM-dd HH:mm:ss'), - endDate: format(date[1], 'yyyy-MM-dd HH:mm:ss'), + startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), + endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), projectCode: Number(route.params.projectCode) }).then((res: TaskStateRes): StateData => { const table = res.taskCountDtos.map((item, index) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts b/dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts index ae39f99b37..bcdcbbd853 100644 --- a/dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts +++ b/dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts @@ -28,8 +28,8 @@ export function useTaskState() { const getTaskState = (date: Array) => { const { state } = useAsyncState( countTaskState({ - startDate: format(date[0], 'yyyy-MM-dd HH:mm:ss'), - endDate: format(date[1], 'yyyy-MM-dd HH:mm:ss'), + startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), + endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), projectCode: Number(route.params.projectCode) }).then((res: TaskStateRes): StateData => { const table = res.taskCountDtos.map((item, index) => {