feat(dev_map_reduce): 任务批次新增任务类型字段TaskType
This commit is contained in:
parent
5bfb638cfc
commit
023bd1169d
@ -18,6 +18,7 @@ const local: FlowI18n.Schema = {
|
|||||||
jobBatch: {
|
jobBatch: {
|
||||||
groupName: 'Group name',
|
groupName: 'Group name',
|
||||||
jobName: 'Job name',
|
jobName: 'Job name',
|
||||||
|
taskType: 'Task Type',
|
||||||
executorInfo: 'Executor Name',
|
executorInfo: 'Executor Name',
|
||||||
executorType: 'Executor type',
|
executorType: 'Executor type',
|
||||||
executionAt: 'Start execution time',
|
executionAt: 'Start execution time',
|
||||||
|
@ -18,6 +18,7 @@ const local: FlowI18n.Schema = {
|
|||||||
jobBatch: {
|
jobBatch: {
|
||||||
groupName: '组名称',
|
groupName: '组名称',
|
||||||
jobName: '任务名称',
|
jobName: '任务名称',
|
||||||
|
taskType: '任务类型',
|
||||||
executorInfo: '执行器名称',
|
executorInfo: '执行器名称',
|
||||||
executorType: '执行器类型',
|
executorType: '执行器类型',
|
||||||
executionAt: '开始执行时间',
|
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: {
|
jobBatch: {
|
||||||
groupName: string;
|
groupName: string;
|
||||||
jobName: string;
|
jobName: string;
|
||||||
|
taskType: string;
|
||||||
executorInfo: string;
|
executorInfo: string;
|
||||||
executorType: string;
|
executorType: string;
|
||||||
executionAt: string;
|
executionAt: string;
|
||||||
|
@ -133,7 +133,9 @@ export const executorTypeRecordOptions = transformRecordToNumberOption(executorT
|
|||||||
export const taskTypeRecord: Record<Api.Common.TaskType, App.I18n.I18nKey> = {
|
export const taskTypeRecord: Record<Api.Common.TaskType, App.I18n.I18nKey> = {
|
||||||
1: 'common.taskType.items.cluster',
|
1: 'common.taskType.items.cluster',
|
||||||
2: 'common.taskType.items.broadcast',
|
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);
|
export const taskTypeRecordRecordOptions = transformRecordToNumberOption(taskTypeRecord);
|
||||||
|
|
||||||
|
@ -126,7 +126,9 @@ const local: App.I18n.Schema = {
|
|||||||
items: {
|
items: {
|
||||||
cluster: 'Cluster',
|
cluster: 'Cluster',
|
||||||
broadcast: 'Broadcast',
|
broadcast: 'Broadcast',
|
||||||
slice: 'Slice'
|
slice: 'Static Slice',
|
||||||
|
map: 'Map',
|
||||||
|
mapreduce: 'MapReduce'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
triggerType: {
|
triggerType: {
|
||||||
@ -799,6 +801,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: 'Job Batch List',
|
title: 'Job Batch List',
|
||||||
groupName: 'Group name',
|
groupName: 'Group name',
|
||||||
jobName: 'Job name',
|
jobName: 'Job name',
|
||||||
|
taskType: 'Task Type',
|
||||||
executorInfo: 'Executor Name',
|
executorInfo: 'Executor Name',
|
||||||
executorType: 'Executor type',
|
executorType: 'Executor type',
|
||||||
executionAt: 'Start execution time',
|
executionAt: 'Start execution time',
|
||||||
|
@ -126,7 +126,9 @@ const local: App.I18n.Schema = {
|
|||||||
items: {
|
items: {
|
||||||
cluster: '集群',
|
cluster: '集群',
|
||||||
broadcast: '广播',
|
broadcast: '广播',
|
||||||
slice: '切片'
|
slice: '静态切片',
|
||||||
|
map: 'Map',
|
||||||
|
mapreduce: 'MapReduce'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
triggerType: {
|
triggerType: {
|
||||||
@ -807,6 +809,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: '任务批次列表',
|
title: '任务批次列表',
|
||||||
groupName: '组名称',
|
groupName: '组名称',
|
||||||
jobName: '任务名称',
|
jobName: '任务名称',
|
||||||
|
taskType: '任务类型',
|
||||||
executorInfo: '执行器名称',
|
executorInfo: '执行器名称',
|
||||||
executorType: '执行器类型',
|
executorType: '执行器类型',
|
||||||
executionAt: '开始执行时间',
|
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:工作流 */
|
/** 触发类型 2:固定时间 3:CRON 表达式 99:工作流 */
|
||||||
type TriggerType = 2 | 3 | 99;
|
type TriggerType = 2 | 3 | 99;
|
||||||
|
|
||||||
/** 任务类型 1:集群 2:广播 3:切片 */
|
/** 任务类型 1:集群 2:广播 3:切片 4:Map 5:MapReduce */
|
||||||
type TaskType = 1 | 2 | 3;
|
type TaskType = 1 | 2 | 3 | 4 | 5;
|
||||||
|
|
||||||
/** 1、待处理 2、运行中 3、成功 4、失败 5、停止 6、取消 */
|
/** 1、待处理 2、运行中 3、成功 4、失败 5、停止 6、取消 */
|
||||||
type TaskBatchStatus = 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"
|
* backend api module: "jobBatch"
|
||||||
*/
|
*/
|
||||||
namespace JobBatch {
|
namespace JobBatch {
|
||||||
|
import TaskType = Api.Common.TaskType;
|
||||||
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
|
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
|
||||||
|
|
||||||
/** JobBatch */
|
/** JobBatch */
|
||||||
@ -1053,6 +1054,8 @@ declare namespace Api {
|
|||||||
groupName: string;
|
groupName: string;
|
||||||
/** 任务名称 */
|
/** 任务名称 */
|
||||||
jobName: string;
|
jobName: string;
|
||||||
|
/** 任务类型 */
|
||||||
|
taskType: TaskType;
|
||||||
/** 工作流节点名称 */
|
/** 工作流节点名称 */
|
||||||
nodeName: string;
|
nodeName: string;
|
||||||
/** 任务信息id */
|
/** 任务信息id */
|
||||||
@ -1079,7 +1082,7 @@ declare namespace Api {
|
|||||||
|
|
||||||
/** JobBatch search params */
|
/** JobBatch search params */
|
||||||
type JobBatchSearchParams = CommonType.RecordNullable<
|
type JobBatchSearchParams = CommonType.RecordNullable<
|
||||||
Pick<Api.JobBatch.JobBatch, 'groupName' | 'jobName' | 'taskBatchStatus'> & CommonSearchParams
|
Pick<Api.JobBatch.JobBatch, 'groupName' | 'jobName' | 'taskBatchStatus' | 'taskType'> & CommonSearchParams
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/** JobBatch list */
|
/** 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;
|
cluster: string;
|
||||||
broadcast: string;
|
broadcast: string;
|
||||||
slice: string;
|
slice: string;
|
||||||
|
map: string;
|
||||||
|
mapreduce: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
triggerType: {
|
triggerType: {
|
||||||
@ -967,6 +969,7 @@ declare namespace App {
|
|||||||
title: string;
|
title: string;
|
||||||
groupName: string;
|
groupName: string;
|
||||||
jobName: string;
|
jobName: string;
|
||||||
|
taskType: string;
|
||||||
executorInfo: string;
|
executorInfo: string;
|
||||||
executorType: string;
|
executorType: string;
|
||||||
executionAt: string;
|
executionAt: string;
|
||||||
|
@ -7,7 +7,7 @@ import { fetchGetJobBatchList, fetchGetJobNameList, fetchJobBatchRetry, fetchJob
|
|||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useTable } from '@/hooks/common/table';
|
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 { tagColor } from '@/utils/common';
|
||||||
import JobBatchSearch from './modules/job-batch-search.vue';
|
import JobBatchSearch from './modules/job-batch-search.vue';
|
||||||
import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue';
|
import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue';
|
||||||
@ -54,6 +54,27 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
|||||||
align: 'left',
|
align: 'left',
|
||||||
minWidth: 120
|
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',
|
key: 'jobName',
|
||||||
title: $t('page.jobBatch.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> = {
|
const tagMap: Record<Api.Common.TaskType, NaiveUI.ThemeColor> = {
|
||||||
1: 'info',
|
1: 'info',
|
||||||
2: 'success',
|
2: 'success',
|
||||||
3: 'error'
|
3: 'error',
|
||||||
|
4: 'primary',
|
||||||
|
5: 'warning'
|
||||||
};
|
};
|
||||||
const label = $t(taskTypeRecord[row.taskType!]);
|
const label = $t(taskTypeRecord[row.taskType!]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user