import { StringMap, ZQMdata } from "zq_ui_react_4/zq"; export interface FlowIncProps extends CurrentUserAccessProps { _id?: string; status?: string; curentNodeIndex?: number; curentNodeName?: string; curentNodeTitle?: string; incData?: Record | string; name?: string; comment?: string; createTime?: number; creator?: any; logs?: FlowIncLogProps[]; commentList?: string; lastOperInfo?: StringMap; operator?: string | Record; updateTime?: number; flowIncOperatorList: FlowIncOperator[]; lastExeStatus?: submitStatus; lastComment?: string; fromNodeIndex?: number; flowDefId_name?: string; flowDefId_title?: string; flowDefVersion?: number; flowSeqNo?: number; flowDefId?: string | any; flowDef?: WorkFlowDefProps; flowType?: string; childFlowList?: ChildFlow[]; fromInc: FlowIncProps; ccDefaultUserJson?: string | Record; incDataVersion?: number; } export declare type submitStatus = "yes" | "end" | "no" | string; export interface CurrentUserAccessProps { canSubmit?: boolean; canFullEnd?: boolean; canFullReOpen?: boolean; operatorDef?: FlowIncOperator; fieldsAccess?: Record; } export interface ChildFlow { toDef: WorkFlowDefProps; incList?: FlowIncProps[]; } export interface FlowIncOperator { _id?: string; createTime: number; creator: string | Record; flowIncId: string; userId: string | StringMap; operateType: OperateType; operateDefIndex: number; ccUserJson: string | Record; } export interface WorkFlowDefProps { _id?: string; name?: string; title?: string; fields?: ZQMdata[]; nodes?: NodeProps[]; flowDefVersion?: number; canWithdraw?: boolean; useTemplate?: { _id: string; name: string; }; observers?: Operator[]; canEndUsers?: Operator[]; canReOpenUsers?: Operator[]; flowDefId?: string; flowDefLogId?: string; } export declare type TimeUnitType = "分钟" | "小时" | "天"; export declare type moreOperateType = "moreInOne" | "moreInMore" | "moreOfAll"; export interface NodeNeedTimes { timeNum: number; unit: TimeUnitType; } export interface NodeProps { name: string; title?: string; desc?: string; groupName?: string; canEnd?: boolean; canForward?: boolean; moreOperateType?: moreOperateType; yesPercent?: number; isNeedAllExe?: boolean; canWithdraw?: boolean; canPrevWithdraw?: boolean; canSumbMitToReturnNode?: boolean; canSumbMitToReturnNodeRule?: StringMap; gotos?: GoTo[]; operators?: Operator[]; fieldsAccess?: Record; notifiTemplates?: NotifiProps[]; approvalTemplates?: string | string[]; commitTemplates?: CommitTemplate[]; statusList?: StatusProps[]; nodeNeedTimes?: NodeNeedTimes; flowApi?: string | string[]; autoSubmit?: boolean; canSelectReturnNode?: boolean; selectReturnNodeList?: string[]; noOperatorAutoSkip?: boolean; samePrevNodeAndYes?: boolean; skipCreaotr?: boolean; } export interface StatusProps { name: string; title: string; color?: string; icon?: string; } export interface CommitTemplate { name: string; content?: string; type?: "是否" | "评分"; value?: string; } export interface NotifiProps { sendType: Array<"微信" | "短信">; name: string; title: string; desc: string; content: string; } export declare type FieldAccessType = "none" | "part" | "all"; export declare type FieldAccessNameType = "visible" | "editable" | "vierifiable"; export interface FieldAccess { _id: string; visible: FieldAccessType; editable: FieldAccessType; vierifiable: FieldAccessType; } /** * 操作者各种定义,除了all外,所有关于参与人的定义都是要同时满足所设定的所有条件 */ export interface SelecUserDef { all?: boolean; user?: Array> | Record; role?: Record; department?: Record; departmentAndChildren?: Record; departmentType?: Record; station?: Record; operatorByFlow?: boolean | string[]; creatorByFlow?: boolean; creatorManager?: boolean; creatorLeader?: boolean; creatorDepartment?: boolean; creatorDepartmentTree?: boolean; creatorByField?: boolean; creatorReportTree?: boolean; creatorByFieldValue?: ZQMdata[]; } /** * 设置抄送用户定义 */ export interface SelecCcUserDef extends SelecUserDef { operatorManager?: boolean; operatorLeader?: boolean; operatorDepartment?: boolean; operatorDepartmentTree?: boolean; operatorReportTree?: boolean; } export interface Operator extends SelecUserDef { isSetOperator?: boolean; linkGotos?: StringMap[]; fieldsAccess?: Record; canSubmit?: boolean; canCountersign?: boolean; canCC?: boolean; ccSetting?: SelecUserDef[]; } export interface Conditions { type: "状态" | "表单值" | "其他"; condition: "=" | ">" | "<" | ">=" | "<=" | "包含" | "不包含" | "头部保护" | "尾部包含" | "函数"; status?: submitStatus; func?: string; formField?: string; reverse?: boolean; formValue?: string; otherCondition?: string; } export declare type SubmitLogType = "无参与者自动跳过" | "仅发起者审核自动跳过" | "上节点相同处理人自动同意" | "流程定义自动提交" | "会签提交" | "正常提交" | "撤回" | "重新打开" | "管理员终止"; export declare type OperateType = "观察" | "抄送" | "处理" | "会签" | "撤回" | "重新打开" | "管理员终止"; export declare const HuiSubmitBtnList: StatusProps[]; export interface GoTo { conditions?: Conditions[]; to: string; logicType?: "one" | "all"; isNeedSetGoToOperators?: boolean; setGoToOperator?: StringMap; } export interface FlowIncLogProps { _id: string; nodeIndex: number; createTime: number; creator: Record; flowDefId: string; flowDefVersion: number; status: string; name?: string; comment?: string; content?: string; flowSeqNo?: number; operateType?: OperateType; submitLogType?: SubmitLogType; } export interface SelectInfoProps { type: "node" | "line" | "flow"; nodeIndex: number; lineIndex: number; } export declare const fixFields: (fields: ZQMdata[]) => ZQMdata[]; export declare const fieldsAccessFix: (map?: Record) => Record; export declare const fixData: (conf: WorkFlowDefProps | undefined) => WorkFlowDefProps; export declare const genLineType: (from: number, to: number, len: number) => "" | "终止" | "退回" | "同意"; export declare type NodeAccessType = "edit" | "visible" | "none"; export declare const checkNodeAccess: (currentUser?: any, flowDef?: WorkFlowDefProps, flowInc?: FlowIncProps, isAdd?: boolean) => NodeAccessType; /** * 权限过滤,支持多层权限设置 * @param fieldList * @param accessMap * @param readOnly * @returns */ export declare const genZQMdataList: (fieldList: ZQMdata[], accessMap: Record, readOnly: boolean) => ZQMdata[];