flow.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. export interface FlowDefinition {
  2. id: number
  3. code: string
  4. name: string
  5. description?: string
  6. category?: string
  7. version: number
  8. status: number // 0-草稿 1-已发布 2-停用
  9. formSchema?: string
  10. flowJson?: string
  11. createTime?: string
  12. updateTime?: string
  13. }
  14. export interface FlowInstance {
  15. id: number
  16. definitionId: number
  17. definitionName?: string
  18. instanceNo?: string
  19. businessKey?: string
  20. status: number // 0-运行中 1-已完成 2-已终止
  21. startTime?: string
  22. endTime?: string
  23. currentNode?: string
  24. createBy?: string
  25. }
  26. export interface FlowTask {
  27. id: number
  28. instanceId: number
  29. definitionName?: string
  30. nodeName: string
  31. assigneeId?: number
  32. assigneeName?: string
  33. status: number // 0-待处理 1-已处理 2-转办
  34. action?: string
  35. comment?: string
  36. createTime?: string
  37. endTime?: string
  38. }
  39. export interface FlowNodeConfig {
  40. id: string
  41. type: 'start' | 'approval' | 'cc' | 'condition' | 'end'
  42. name: string
  43. x: number
  44. y: number
  45. properties?: Record<string, unknown>
  46. }
  47. export interface FlowEdgeConfig {
  48. id: string
  49. sourceNodeId: string
  50. targetNodeId: string
  51. properties?: Record<string, unknown>
  52. }
  53. export interface ApprovalAction {
  54. action: 'pass' | 'reject' | 'rollback' | 'transfer'
  55. comment?: string
  56. transferTo?: number
  57. }
  58. export interface NodeProgress {
  59. nodeId: string
  60. nodeName: string
  61. nodeType: string
  62. status: 'completed' | 'current' | 'pending'
  63. tasks: FlowTask[]
  64. isMyTurn: boolean
  65. }
  66. export interface ProcessProgress {
  67. instance: FlowInstance
  68. definition: FlowDefinition
  69. nodes: NodeProgress[]
  70. records: ApprovalRecord[]
  71. remainingNodeCount: number
  72. }
  73. export interface ApprovalRecord {
  74. id?: number
  75. taskId: number
  76. instanceId: number
  77. nodeId: string
  78. nodeName: string
  79. operatorId: number
  80. operatorName?: string
  81. actionType: string
  82. actionResult: string
  83. comment?: string
  84. createTime?: string
  85. }