2025-07-23 14:26:53 +08:00
|
|
|
|
// 机器人的具体动作,现在是一个对象
|
|
|
|
|
export interface RobotAction {
|
|
|
|
|
name: string;
|
|
|
|
|
actionId: string;
|
|
|
|
|
}
|
2025-07-21 15:10:39 +08:00
|
|
|
|
|
2025-07-22 15:10:57 +08:00
|
|
|
|
// 参数选项接口
|
|
|
|
|
export interface ParameterOption {
|
|
|
|
|
label: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 动态参数配置接口
|
|
|
|
|
export interface DynamicParameter {
|
2025-07-23 11:46:00 +08:00
|
|
|
|
label?: string;
|
|
|
|
|
type?: 'Simple' | 'Select' | 'MultiSelect' | 'Text' | 'Number';
|
2025-07-23 14:26:53 +08:00
|
|
|
|
value: string | string[] | number | RobotAction;
|
2025-07-23 11:46:00 +08:00
|
|
|
|
required?: boolean;
|
2025-07-22 15:10:57 +08:00
|
|
|
|
options?: ParameterOption[];
|
|
|
|
|
placeholder?: string;
|
|
|
|
|
min?: number;
|
|
|
|
|
max?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 任务参数 - 支持动态配置
|
2025-07-21 15:10:39 +08:00
|
|
|
|
export interface TaskParameters {
|
2025-07-22 15:10:57 +08:00
|
|
|
|
[key: string]: DynamicParameter | undefined; // 支持扩展参数
|
2025-07-21 15:10:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 核心任务对象
|
|
|
|
|
export interface Task {
|
|
|
|
|
id: string; // 唯一ID,例如使用 uuid
|
|
|
|
|
name: string; // 任务名称, e.g., "炉前缓存区到热处理上料交接区运输"
|
2025-07-23 11:35:09 +08:00
|
|
|
|
label: string;
|
2025-07-23 14:26:53 +08:00
|
|
|
|
description?: string;
|
2025-07-23 11:35:09 +08:00
|
|
|
|
version: number;
|
|
|
|
|
templateName: string;
|
|
|
|
|
periodicTask: boolean;
|
|
|
|
|
ifEnable: number;
|
|
|
|
|
status: number; // 任务当前状态
|
|
|
|
|
createDate: string; // 创建时间
|
|
|
|
|
remark: string;
|
2025-07-21 15:10:39 +08:00
|
|
|
|
parameters: TaskParameters; // 任务的具体执行参数
|
2025-07-23 11:35:09 +08:00
|
|
|
|
detail?: TaskDetail; // 任务详情
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 任务详情
|
|
|
|
|
export interface TaskDetail {
|
|
|
|
|
inputParams: InputParam[];
|
|
|
|
|
outputParams: any[]; // 根据需要定义
|
|
|
|
|
rootBlock: any; // 根据需要定义
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 输入参数
|
|
|
|
|
export interface InputParam {
|
|
|
|
|
name: string;
|
|
|
|
|
type: string;
|
|
|
|
|
label: string;
|
|
|
|
|
required: boolean;
|
2025-07-23 14:26:53 +08:00
|
|
|
|
defaultValue: any;
|
2025-07-23 11:35:09 +08:00
|
|
|
|
remark: string;
|
2025-07-23 14:26:53 +08:00
|
|
|
|
min?: number;
|
|
|
|
|
max?: number;
|
|
|
|
|
step?: number;
|
2025-07-21 15:10:39 +08:00
|
|
|
|
}
|