You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/02 06:49:52 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha]Fixed an issue with time picker clearing (#8655)

This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 78d7c06  [Fix][UI Next][V1.0.0-Alpha]Fixed an issue with time picker clearing (#8655)
78d7c06 is described below

commit 78d7c06f2e4c2e9038587eef9f427bd9e4f7908b
Author: labbomb <73...@qq.com>
AuthorDate: Wed Mar 2 14:49:43 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha]Fixed an issue with time picker clearing (#8655)
---
 dolphinscheduler-ui-next/src/views/home/use-process-state.ts        | 4 ++--
 dolphinscheduler-ui-next/src/views/home/use-task-state.ts           | 6 +++---
 .../src/views/projects/overview/use-process-state.ts                | 4 ++--
 .../src/views/projects/overview/use-task-state.ts                   | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

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 1b6eca9..f48e834 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<number>) => {
     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 7023a46..d940e94 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<number>) => {
+  const getTaskState = (date: Array<any>) => {
     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 7a99f28..db238e7 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<number>) => {
     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 ae39f99..bcdcbbd 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<number>) => {
     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) => {