process.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { CptModelName, SubModelName, ActionType } from './base';
  2. // 环节类型
  3. export enum SectorType {
  4. APPROVAL = 'approval', // 审批
  5. CONDITION = 'condition', // 条件
  6. }
  7. // 审批方式
  8. export enum ApprovalWay {
  9. ACCOUNT = 'account', // 指定用户
  10. JOINTLYSIGN = 'jointlySign', // 会签
  11. ORSIGN = 'orSign', // 或签
  12. ORDERAPPROVAL = 'orderApproval', // 依次审批
  13. PREACCOUNT = 'prevAccount', // 上一审批人设置
  14. }
  15. // 参与者模式
  16. export enum ParticipantMode {
  17. ACCOUNT = 'account', // 用户模式
  18. ROLE = 'role', // 角色模式(未来)
  19. }
  20. export enum AccountConfigure {
  21. SKIP = 'skip',
  22. RETURN = 'return',
  23. REVOKE = 'revoke',
  24. ASSISTAUDIT = 'assistAudit',
  25. ADDSIGN = 'addSign',
  26. }
  27. export interface IProcessAccount {
  28. // ID 账号ID name 名称institutionID 企事业ID
  29. ID: string;
  30. name: string;
  31. institutionID?: string; // 可能不会用到
  32. configure: AccountConfigure[];
  33. }
  34. // 参与者信息
  35. export interface IParticipantInfo {
  36. approvalWay: ApprovalWay;
  37. participantMode: ParticipantMode;
  38. accounts: IProcessAccount[];
  39. }
  40. // 流程中的一个环节
  41. export interface IProcess {
  42. ID: string;
  43. name: string;
  44. sectorType: SectorType;
  45. seq?: number;
  46. participantInfo: IParticipantInfo;
  47. }
  48. export interface IApproval {
  49. ID: string;
  50. name: string;
  51. created: string;
  52. createdID: string;
  53. createdTime: number;
  54. process: IProcess[];
  55. }
  56. export enum ApprovalState {
  57. CREATED = 'created', // 创建
  58. PROCESSING = 'processing', // 正在审批
  59. APPROVED = 'approved', // 审批通过
  60. FAILED = 'failed', // 失败
  61. }
  62. // 复制到项目里的流程
  63. export interface IProjectApproval extends IApproval {
  64. projectIDs: string[]; // 包含在流程里的项目
  65. state: ApprovalState; // 状态
  66. approvalTime?: number; // 审批通过时间
  67. currentProcessID?: string; // 当前正处于哪个环节ID
  68. }
  69. // 流程过程中存储的数据
  70. export interface IProcessBackupData {
  71. ID: string;
  72. module: CptModelName | SubModelName; // 编辑的模块
  73. action: ActionType; // 动作,增删改等
  74. oDocs: any; // 存放删除时或者修改时的数据
  75. }
  76. // 备份数据集合
  77. export interface IProcessData {
  78. projectID: string;
  79. processID: string;
  80. index: number;
  81. backupData: IProcessBackupData[];
  82. }