export type NodeType = 0 | 1 | 2 | 3 | 4 | 5 | 9; //0开始,1审核,2抄送,3条件判断,4路由,5办理人,9结束 export type UserSetType = 1 | 2 | 3 | 4 | 5; //1,指定人员;2,自选人员;3,岗位;4,直属主管;5,连续多级主管; export type MutipleUserHandleType = 1 | 2; //1,会签,2,或签 export type NodeTypeKey = 'APPROVER' | 'NOTIFIER' | 'BRANCH' | 'CONDITION' | 'HANDLE'; export type BpmnTypeKey = 'startEvent' | 'endEvent' | 'exclusiveGateway' | 'userTask' | 'sequenceFlow'; export type FormAuthType = 0 | 1 | 2; //0隐藏;1,可以编辑;2,可阅读 export type NodeUserType = { name: string; //用户名或者岗位名称 key: 'userId' | 'groupId'; //用户id 或者 岗位id value: string; //id groupName?: string; }; export type WorkerFlowFormType = { name: string; label: string; widgetType: 'SINGLE_TEXT' | 'MULTIPLE_TEXT' | 'SINGLE_SELECTION' | 'MULTIPLE_SELECTION' | 'IMAGE'; type: string; value: string; auth?: FormAuthType; required: boolean; options?: { value: string | number | boolean; label: string }[]; }; export type ConditionItemType = { field: string; value: any }; export type NodeItem = { id: string; // ID按规则生成; nodeName: string; //节点名称 nodeUserList?: NodeUserType[]; //审核用户,userTask类型存在切必选 emptyUserList?: NodeUserType[]; //节点 审核人员为空时 copyUserIds?: string[]; //下一个节点需要抄送的用户id childNode?: NodeItem; //下一个链接元素 chargeLevel?: 1 | 2 | 3; //连线多级主管上溯级别 conditionNodes?: NodeItem[]; //条件判断集合,路由节点存在 type: NodeType; // 自定义类型 userType?: UserSetType; //人员设置类型 usersHandType?: MutipleUserHandleType; //多人时处理类型,会签 or 或签 conditionList?: ConditionItemType[]; //条件对象 vNode?: NodeItem; //虚拟条件对象,自动生成,用于同意和进入下一个节点,取消结束流程 expression?: string; //条件判断模板 priorityLevel?: number; // 条件优先级 owner?: string; // 显示审核人员文本 error?: boolean; // 节点是否出错 bpmnType: BpmnTypeKey; // 对于bpmn类型 form?: WorkerFlowFormType[]; }; export interface WorkerFlowContext { config: NodeItem; errorIds?: string[]; form: WorkerFlowFormType[]; onInsertNode: (type: NodeType, node: NodeItem) => void; onDeleteNode: (parentNode: NodeItem, node: NodeItem, type?: NodeType, index?: number) => void; onSelectNode: (node: NodeItem, parentNode: NodeItem, index?: number) => void; updateNode: () => void; readOnly?: boolean; } export interface WorkerFlowRequest { id: string; name: string; nodeConfig: NodeItem; } export type SubmitFlowItemType = { processId: string; actNodeId: string; taskType: 0 | 1; //任务类型,0,办理人;1,审批人; jointlySignBlank?: 1; //会签标识 multiVariableName?: string; //会签选定人员的变量名称(同一部署文件,id要求唯一) actNodeName: string; //用户任务节点名称 assignType: number; // 任务执行人选定方式,1,直接执行人;2,自选;3,岗位;4.直属主管;5.连续多级主管 assignVariableName: string; //任务执行人的变量名称(同一部署文件,id要求唯一) chargeLevel: 1 | 2 | 3; //连续多级主管上溯级别 stationIds?: string[]; //直接选择的/自选的岗位Id nextTaskId?: string; //下一个任务节点Id,条件不算 formAuthority?: string; //表单权限等扩展信息 copyUserIds?: string[]; //下个节点存在抄送人饿 emptyPersonIds?: string[]; //没有审批人时,任务交给指定人员处理 assignPersonIds?: string[]; //直接执行/自选的人员Ids taskFirstBlank?: 1; //首用户任务标志,1,首任务; }; export type SubmitData = { config: WorkerFlowRequest; bpmnBlob: Blob; useFormKeys: ConditionItemType[]; taskList: SubmitFlowItemType[]; }; export type AddNodeType = 1 | 2 | 3 | 4; //1审核人,2抄送人,3办理人,4条件分支