From 023bd1169d5c1d078a39994449d1ebbbfd46f020 Mon Sep 17 00:00:00 2001 From: wodeyangzipingpingwuqi Date: Fri, 14 Jun 2024 13:46:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(dev=5Fmap=5Freduce):=20=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E6=96=B0=E5=A2=9E=E4=BB=BB=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5TaskType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/work-flow/src/locales/langs/en-us.ts | 1 + packages/work-flow/src/locales/langs/zh-cn.ts | 1 + packages/work-flow/src/typings/i18n.d.ts | 1 + src/constants/business.ts | 4 +++- src/locales/langs/en-us.ts | 5 +++- src/locales/langs/zh-cn.ts | 5 +++- src/typings/api.d.ts | 9 +++++--- src/typings/app.d.ts | 3 +++ src/views/job/batch/index.vue | 23 ++++++++++++++++++- src/views/job/task/index.vue | 4 +++- 10 files changed, 48 insertions(+), 8 deletions(-) diff --git a/packages/work-flow/src/locales/langs/en-us.ts b/packages/work-flow/src/locales/langs/en-us.ts index f6c32ec..6ff82f5 100644 --- a/packages/work-flow/src/locales/langs/en-us.ts +++ b/packages/work-flow/src/locales/langs/en-us.ts @@ -18,6 +18,7 @@ const local: FlowI18n.Schema = { jobBatch: { groupName: 'Group name', jobName: 'Job name', + taskType: 'Task Type', executorInfo: 'Executor Name', executorType: 'Executor type', executionAt: 'Start execution time', diff --git a/packages/work-flow/src/locales/langs/zh-cn.ts b/packages/work-flow/src/locales/langs/zh-cn.ts index 8ddc111..f41eaf4 100644 --- a/packages/work-flow/src/locales/langs/zh-cn.ts +++ b/packages/work-flow/src/locales/langs/zh-cn.ts @@ -18,6 +18,7 @@ const local: FlowI18n.Schema = { jobBatch: { groupName: '组名称', jobName: '任务名称', + taskType: '任务类型', executorInfo: '执行器名称', executorType: '执行器类型', executionAt: '开始执行时间', diff --git a/packages/work-flow/src/typings/i18n.d.ts b/packages/work-flow/src/typings/i18n.d.ts index bb5285a..afb7af2 100644 --- a/packages/work-flow/src/typings/i18n.d.ts +++ b/packages/work-flow/src/typings/i18n.d.ts @@ -21,6 +21,7 @@ declare namespace FlowI18n { jobBatch: { groupName: string; jobName: string; + taskType: string; executorInfo: string; executorType: string; executionAt: string; diff --git a/src/constants/business.ts b/src/constants/business.ts index 1ca131b..d68e397 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -133,7 +133,9 @@ export const executorTypeRecordOptions = transformRecordToNumberOption(executorT export const taskTypeRecord: Record = { 1: 'common.taskType.items.cluster', 2: 'common.taskType.items.broadcast', - 3: 'common.taskType.items.slice' + 3: 'common.taskType.items.slice', + 4: 'common.taskType.items.map', + 5: 'common.taskType.items.mapreduce' }; export const taskTypeRecordRecordOptions = transformRecordToNumberOption(taskTypeRecord); diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 67d45be..3e81952 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -126,7 +126,9 @@ const local: App.I18n.Schema = { items: { cluster: 'Cluster', broadcast: 'Broadcast', - slice: 'Slice' + slice: 'Static Slice', + map: 'Map', + mapreduce: 'MapReduce' } }, triggerType: { @@ -799,6 +801,7 @@ const local: App.I18n.Schema = { title: 'Job Batch List', groupName: 'Group name', jobName: 'Job name', + taskType: 'Task Type', executorInfo: 'Executor Name', executorType: 'Executor type', executionAt: 'Start execution time', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index a73aaac..5c829a9 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -126,7 +126,9 @@ const local: App.I18n.Schema = { items: { cluster: '集群', broadcast: '广播', - slice: '切片' + slice: '静态切片', + map: 'Map', + mapreduce: 'MapReduce' } }, triggerType: { @@ -807,6 +809,7 @@ const local: App.I18n.Schema = { title: '任务批次列表', groupName: '组名称', jobName: '任务名称', + taskType: '任务类型', executorInfo: '执行器名称', executorType: '执行器类型', executionAt: '开始执行时间', diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 0a8350e..23dcb04 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -82,8 +82,8 @@ declare namespace Api { /** 触发类型 2:固定时间 3:CRON 表达式 99:工作流 */ type TriggerType = 2 | 3 | 99; - /** 任务类型 1:集群 2:广播 3:切片 */ - type TaskType = 1 | 2 | 3; + /** 任务类型 1:集群 2:广播 3:切片 4:Map 5:MapReduce */ + type TaskType = 1 | 2 | 3 | 4 | 5; /** 1、待处理 2、运行中 3、成功 4、失败 5、停止 6、取消 */ type TaskBatchStatus = 1 | 2 | 3 | 4 | 5 | 6; @@ -1045,6 +1045,7 @@ declare namespace Api { * backend api module: "jobBatch" */ namespace JobBatch { + import TaskType = Api.Common.TaskType; type CommonSearchParams = Pick; /** JobBatch */ @@ -1053,6 +1054,8 @@ declare namespace Api { groupName: string; /** 任务名称 */ jobName: string; + /** 任务类型 */ + taskType: TaskType; /** 工作流节点名称 */ nodeName: string; /** 任务信息id */ @@ -1079,7 +1082,7 @@ declare namespace Api { /** JobBatch search params */ type JobBatchSearchParams = CommonType.RecordNullable< - Pick & CommonSearchParams + Pick & CommonSearchParams >; /** JobBatch list */ diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 6d61178..401002a 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -377,6 +377,8 @@ declare namespace App { cluster: string; broadcast: string; slice: string; + map: string; + mapreduce: string; }; }; triggerType: { @@ -967,6 +969,7 @@ declare namespace App { title: string; groupName: string; jobName: string; + taskType: string; executorInfo: string; executorType: string; executionAt: string; diff --git a/src/views/job/batch/index.vue b/src/views/job/batch/index.vue index 8026c45..6bf2f92 100644 --- a/src/views/job/batch/index.vue +++ b/src/views/job/batch/index.vue @@ -7,7 +7,7 @@ import { fetchGetJobBatchList, fetchGetJobNameList, fetchJobBatchRetry, fetchJob import { $t } from '@/locales'; import { useAppStore } from '@/store/modules/app'; import { useTable } from '@/hooks/common/table'; -import { operationReasonRecord, taskBatchStatusRecord } from '@/constants/business'; +import { operationReasonRecord, taskBatchStatusRecord, taskTypeRecord } from '@/constants/business'; import { tagColor } from '@/utils/common'; import JobBatchSearch from './modules/job-batch-search.vue'; import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue'; @@ -54,6 +54,27 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP align: 'left', minWidth: 120 }, + { + key: 'taskType', + title: $t('page.jobBatch.taskType'), + align: 'center', + width: 120, + render: row => { + if (row.taskType === null) { + return null; + } + const tagMap: Record = { + 1: 'info', + 2: 'success', + 3: 'error', + 4: 'primary', + 5: 'warning' + }; + const label = $t(taskTypeRecord[row.taskType!]); + + return {label}; + } + }, { key: 'jobName', title: $t('page.jobBatch.jobName'), diff --git a/src/views/job/task/index.vue b/src/views/job/task/index.vue index 9463821..2f51c36 100644 --- a/src/views/job/task/index.vue +++ b/src/views/job/task/index.vue @@ -107,7 +107,9 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP const tagMap: Record = { 1: 'info', 2: 'success', - 3: 'error' + 3: 'error', + 4: 'primary', + 5: 'warning' }; const label = $t(taskTypeRecord[row.taskType!]);