Просмотр исходного кода

[Fix][UI Next] Fix a few errors in the task group. (#8322)

calvin 3 лет назад
Родитель
Сommit
222506ae35

+ 9 - 3
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'

+ 1 - 1
dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx

@@ -193,7 +193,7 @@ const taskGroupQueue = defineComponent({
         </NCard>
         <Card
           class={styles['table-card']}
-          title={t('resource.task_group_option.option')}
+          title={t('resource.task_group_queue.queue')}
         >
           <div>
             <NDataTable

+ 9 - 3
dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-table.ts

@@ -98,9 +98,15 @@ export function useTable(
       variables.totalPage = values[0].totalPage
       variables.tableData = values[0].totalList.map(
         (item: any, index: number) => {
-          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'