feat(dev_map_reduce): 任务批次新增任务类型字段TaskType
This commit is contained in:
parent
5bfb638cfc
commit
023bd1169d
@ -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',
|
||||
|
@ -18,6 +18,7 @@ const local: FlowI18n.Schema = {
|
||||
jobBatch: {
|
||||
groupName: '组名称',
|
||||
jobName: '任务名称',
|
||||
taskType: '任务类型',
|
||||
executorInfo: '执行器名称',
|
||||
executorType: '执行器类型',
|
||||
executionAt: '开始执行时间',
|
||||
|
1
packages/work-flow/src/typings/i18n.d.ts
vendored
1
packages/work-flow/src/typings/i18n.d.ts
vendored
@ -21,6 +21,7 @@ declare namespace FlowI18n {
|
||||
jobBatch: {
|
||||
groupName: string;
|
||||
jobName: string;
|
||||
taskType: string;
|
||||
executorInfo: string;
|
||||
executorType: string;
|
||||
executionAt: string;
|
||||
|
@ -133,7 +133,9 @@ export const executorTypeRecordOptions = transformRecordToNumberOption(executorT
|
||||
export const taskTypeRecord: Record<Api.Common.TaskType, App.I18n.I18nKey> = {
|
||||
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);
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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: '开始执行时间',
|
||||
|
9
src/typings/api.d.ts
vendored
9
src/typings/api.d.ts
vendored
@ -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<Common.PaginatingCommonParams, 'page' | 'size'>;
|
||||
|
||||
/** 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<Api.JobBatch.JobBatch, 'groupName' | 'jobName' | 'taskBatchStatus'> & CommonSearchParams
|
||||
Pick<Api.JobBatch.JobBatch, 'groupName' | 'jobName' | 'taskBatchStatus' | 'taskType'> & CommonSearchParams
|
||||
>;
|
||||
|
||||
/** JobBatch list */
|
||||
|
3
src/typings/app.d.ts
vendored
3
src/typings/app.d.ts
vendored
@ -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;
|
||||
|
@ -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<Api.Common.TaskType, NaiveUI.ThemeColor> = {
|
||||
1: 'info',
|
||||
2: 'success',
|
||||
3: 'error',
|
||||
4: 'primary',
|
||||
5: 'warning'
|
||||
};
|
||||
const label = $t(taskTypeRecord[row.taskType!]);
|
||||
|
||||
return <NTag type={tagMap[row.taskType!]}>{label}</NTag>;
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'jobName',
|
||||
title: $t('page.jobBatch.jobName'),
|
||||
|
@ -107,7 +107,9 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
||||
const tagMap: Record<Api.Common.TaskType, NaiveUI.ThemeColor> = {
|
||||
1: 'info',
|
||||
2: 'success',
|
||||
3: 'error'
|
||||
3: 'error',
|
||||
4: 'primary',
|
||||
5: 'warning'
|
||||
};
|
||||
const label = $t(taskTypeRecord[row.taskType!]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user