From 222506ae35fd4d3a3a7edc0bf861f8826417e7a9 Mon Sep 17 00:00:00 2001 From: calvin Date: Wed, 9 Feb 2022 20:02:16 +0800 Subject: [PATCH] [Fix][UI Next] Fix a few errors in the task group. (#8322) --- .../views/resource/task-group/option/use-table.ts | 12 +++++++++--- .../src/views/resource/task-group/queue/index.tsx | 2 +- .../src/views/resource/task-group/queue/use-table.ts | 12 +++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts b/dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts index 77fa9b1daf..40e71794c2 100644 --- a/dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts +++ b/dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts @@ -97,9 +97,15 @@ export function useTable( variables.totalPage = values[0].totalPage variables.tableData = values[0].totalList.map( (item: any, index: number) => { - item.projectName = _.find(values[1], { - code: item.projectCode - }).name + let projectName = '' + if (values[1]) { + let project = _.find(values[1], { code: item.projectCode }) + if (project) { + projectName = project.name + } + } + + item.projectName = projectName item.createTime = format( new Date(item.createTime), 'yyyy-MM-dd HH:mm:ss' diff --git a/dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx b/dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx index 8c31cd1bb2..1cef230de5 100644 --- a/dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx +++ b/dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx @@ -193,7 +193,7 @@ const taskGroupQueue = defineComponent({
{ - item.taskGroupName = _.find(taskGroupList, { - id: item.groupId - }).name + let taskGroupName = '' + if (taskGroupList) { + let taskGroup = _.find(taskGroupList, { id: item.groupId }) + if (taskGroup) { + taskGroupName = taskGroup.name + } + } + + item.taskGroupName = taskGroupName item.createTime = format( new Date(item.createTime), 'yyyy-MM-dd HH:mm:ss'