flow.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. attachmentUrls?: string
  58. }
  59. export interface NodeProgress {
  60. nodeId: string
  61. nodeName: string
  62. nodeType: string
  63. status: 'completed' | 'current' | 'pending'
  64. tasks: FlowTask[]
  65. isMyTurn: boolean
  66. }
  67. export interface ProcessProgress {
  68. instance: FlowInstance
  69. definition: FlowDefinition
  70. nodes: NodeProgress[]
  71. records: ApprovalRecord[]
  72. remainingNodeCount: number
  73. }
  74. export interface ApprovalRecord {
  75. id?: number
  76. taskId: number
  77. instanceId: number
  78. nodeId: string
  79. nodeName: string
  80. operatorId: number
  81. operatorName?: string
  82. actionType: string
  83. actionResult: string
  84. comment?: string
  85. attachmentUrls?: string
  86. createTime?: string
  87. }