import type { AxiosPromise } from "axios"; import type { EntityApi, EntityReq, EntityModel, EntityPage, EntityKey, EntityList } from "jmash-core"; import type { ProtobufAny } from "@/util/protobuf"; export interface TaskApi extends EntityApi { findPage(req: TaskReq): AxiosPromise; startProcInst(req: StartProcInstReq): AxiosPromise; claimTask(req: FlowClaimTaskRequest): AxiosPromise; findTaskById(taskId: string): AxiosPromise; findProcInstDiagram(procInstId: string): AxiosPromise; completeTask(req: FlowCompleteTaskRequest): AxiosPromise; findTaskDefAllowGoback(taskId: string): AxiosPromise; gobackTask(req: FlowGobackTaskRequest): AxiosPromise; assignTask(req: FlowAssignTaskRequest): AxiosPromise; priorityTask(req: FlowPriorityTaskRequest): AxiosPromise; delegateTask(req: FlowDelegateTaskRequest): AxiosPromise; resolveTask(req: FlowResolveTaskRequest): AxiosPromise; } export interface TaskKey extends EntityKey { /** * 任务ID */ taskId?: string; } /** * 分配/移交任务给某人. */ export interface FlowAssignTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; /** * 任务ID. */ taskId?: string; /** * 用户ID. */ userId?: string; /** * 候选用户. */ candidateUser?: Array; /** * 分配/移交任务备注. */ comment?: string; } /** * 任务认领/取消认领/强制取回请求. */ export interface FlowClaimTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; /** * 任务ID. */ taskId?: Array; /** * 认领/取消认领. */ claim?: boolean; /** * 是否强制取回. */ force?: boolean; } /** * 任务执行请求. */ export interface FlowCompleteTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; module?: string; /** * 任务id. */ taskId?: string; /** * 动作. */ action?: string; /** * 办理意见. */ comment?: string; /** * 流程变量. */ vars: { [key: string]: ProtobufAny; }; } /** * 委托办理任务请求. */ export interface FlowDelegateTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; /** * 任务ID. */ taskId?: string; /** * 用户ID. */ userId?: string; /** * 委托备注. */ comment?: string; } /** * 任务退回请求. */ export interface FlowGobackTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; /** * 任务id. */ taskId?: string; /** * 退回到的任务节点. */ taskDefKey?: string; /** * 委托备注. */ comment?: string; } /** * - Trivial: (默认). - Minor: 次重要. - Major: 重要. - Critical: 关键. */ export type FlowPriority = "Trivial" | "Minor" | "Major" | "Critical"; /** * 任务优先级. */ export interface FlowPriorityTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId: string; /** * 任务ID. */ taskId?: string; priority?: FlowPriority; } /** * 流程实例Page. */ export interface FlowProcInstPage extends EntityPage { /** * 流程实例列表. */ results: Array; /** * 当前页码. */ curPage: number; /** * 页尺寸. */ pageSize: number; /** * 总记录数. */ totalSize: number; } export interface FlowProcInstKey extends EntityKey { /** * 流程实例ID. */ procInstId?: string; } /** * 完成委托办理任务. */ export interface FlowResolveTaskRequest { /** * 用于检测重复请求的唯一字符串ID. */ requestId?: string; /** * 任务ID. */ taskId?: string; /** * 动作. */ action?: string; /** * 完成委托备注. */ comment?: string; /** * 流程变量. */ vars: { [key: string]: ProtobufAny; }; } /** * 启动流程实例请求. */ export interface StartProcInstReq { /** * 用于检测重复请求的唯一字符串ID. */ requestId?: string; /** * 流程启动key. */ procDefKey?: string; /** * 流程业务key. */ businessKey?: string; /** * 流程实例名称. */ procInstName?: string; /** * 流程变量. */ vars: { [key: string]: ProtobufAny; }; } /** * 任务定义列表. */ export interface FlowTaskDefList { /** * 当前页内容. */ results: Array; } /** * 任务定义模型. */ export interface FlowTaskDefModel { /** * 任务名称. */ taskName: string; /** * 任务定义Key. */ taskDefKey: string; } export interface TaskReq extends EntityReq { tenant?: string; curPage?: number; pageSize?: number; orderName?: string; orderAsc?: boolean; priority?: string; procDefKey?: string; candidate?: boolean; category?: string; hasPriority?: boolean; procInstId?: string; } /** * 任务模型. */ export interface FlowTaskModel extends EntityModel { /** * 任务ID. */ id?: string; /** * 任务名称. */ name?: string; /** * 任务描述. */ description?: string; /** * 优先级. */ priority?: FlowPriority; /** * 所属用户. */ owner?: string; /** * 分配人. */ assignee?: string; /** * 流程实例ID. */ processInstanceId?: string; executionId?: string; /** * 任务定义ID. */ taskDefinitionId?: string; /** * 流程定义ID. */ processDefinitionId?: string; /** * 状态. */ state?: string; /** * 创建时间. */ createTime?: string; /** * 认领时间. */ claimTime?: string; /** * 认领用户. */ claimedBy?: string; /** * 暂停时间. */ suspendedTime?: string; /** * 暂停用户. */ suspendedBy?: string; /** * 任务定义Key. */ taskDefinitionKey?: string; /** * 过期时间. */ dueDate?: string; /** * 分类. */ category?: string; /** * 父任务ID. */ parentTaskId?: string; /** * 租户ID. */ tenantId?: string; /** * 表单Key. */ formKey?: string; suspended?: boolean; delegationState?: string; procInstName?: string; startTime?: string; startUserId?: string; businessKey?: string; businessStatus?: string; } export interface ProcInstReq extends EntityReq { tenant?: string; curPage?: number; pageSize?: number; orderName?: string; orderAsc?: boolean; priority?: string; procDefKey?: string; candidate?: boolean; category?: string; hasPriority?: boolean; procDefId?: string; } /** * 任务列表. */ export interface FlowTaskPage extends EntityPage { /** * 任务列表. */ results: Array; /** * 当前页码. */ curPage: number; /** * 页尺寸. */ pageSize: number; /** * 总记录数. */ totalSize: number; } /** * 流程实例. */ export interface FlowProcInstModel extends EntityModel { /** * ID. */ id?: string; /** * 暂停/恢复. */ suspended?: boolean; /** * 是否结束. */ isEnded?: boolean; /** * 活动ID. */ activityId?: string; /** * 流程实例ID. */ processInstanceId?: string; /** * 父ID. */ parentId?: string; /** * 父执行ID. */ superExecutionId?: string; /** * 根流程实例ID. */ bootProcessInstanceId?: string; /** * 租户. */ tenantId?: string; /** * 实例名称. */ name?: string; /** * 描述. */ description?: string; /** * 引用ID. */ referenceId?: string; /** * 引用类型. */ referenceType?: string; propagatedStageInstanceId?: string; /** * 流程变量. */ processVariables?: { [key: string]: object; }; /** * 开始时间. */ startTime?: string; /** * 创建用户. */ startUserId?: string; /** * 业务Key. */ businessKey?: string; /** * 业务状态. */ businessStatus?: string; /** * 流程定义ID. */ processDefinitionId?: string; /** * 流程定义名称. */ processDefinitionName?: string; /** * 流程定义Key. */ processDefinitionKey?: string; /** * 流程定义版本. */ processDefinitionVersion?: number; /** * 流程定义分类. */ processDefinitionCategory?: string; /** * 部署ID. */ deploymentId?: string; } /** * 列表. */ export interface FlowHiTaskinstList { /** * 当前页内容. */ results?: Array; } /** * 实体. */ export interface FlowHiTaskinstModel { id?: string; rev?: number; procDefId?: string; taskDefId?: string; taskDefKey?: string; procInstId?: string; executionId?: string; scopeId?: string; subScopeId?: string; scopeType?: string; scopeDefinitionId?: string; propagatedStageInstId?: string; name?: string; parentTaskId?: string; description?: string; owner?: string; assignee?: string; startTime?: string; claimTime?: string; endTime?: string; duration?: string; deleteReason?: string; priority?: number; dueDate?: string; formKey?: string; category?: string; tenantId?: string; lastUpdatedTime?: string; } export interface TaskUserReq extends EntityReq { tanent?: string; taskId?: string; type?: string; } export interface TaskUserPage extends EntityList { results: Array; } export interface TaskUserModel extends EntityModel { id?: string; type?: string; userId?: string; taskId?: string; processInstanceId?: string; }