wf_process.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package model
  2. import (
  3. "gin-vue-admin/global"
  4. "gorm.io/gorm"
  5. "time"
  6. )
  7. type WorkflowProcess struct {
  8. ID string `json:"id" form:"id" gorm:"comment:流程标识;primaryKey;unique;not null"`
  9. CreatedAt time.Time
  10. UpdatedAt time.Time
  11. DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
  12. Name string `json:"name" gorm:"comment:流程名称"`
  13. Category string `json:"category" gorm:"comment:分类"`
  14. Clazz string `json:"clazz" gorm:"comment:类型"`
  15. Label string `json:"label" gorm:"comment:流程标题"`
  16. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  17. Description string `json:"description" gorm:"comment:详细介绍"`
  18. View string `json:"view" gorm:"comment:前端视图文件"`
  19. Nodes []WorkflowNode `json:"nodes"` // 流程节点数据
  20. Edges []WorkflowEdge `json:"edges"` // 流程链接数据
  21. }
  22. type WorkflowNode struct {
  23. ID string `json:"id" form:"id" gorm:"comment:节点id;primaryKey;unique;not null"`
  24. CreatedAt time.Time
  25. UpdatedAt time.Time
  26. DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
  27. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  28. Clazz string `json:"clazz" gorm:"comment:节点类型"`
  29. Label string `json:"label" gorm:"comment:节点名称"`
  30. Type string `json:"type" gorm:"comment:图标类型"`
  31. Shape string `json:"shape" gorm:"comment:形状"`
  32. Description string `json:"description" gorm:"comment:详细介绍"`
  33. View string `json:"view" gorm:"comment:前端视图文件"`
  34. X float64 `json:"y" gorm:"comment:x位置"`
  35. Y float64 `json:"x" gorm:"comment:y位置"`
  36. WaitState string `json:"waitState" gorm:"comment:等待属性"`
  37. StateValue string `json:"stateValue" gorm:"comment:等待值"`
  38. To string `json:"to" gorm:"comment:收件人"`
  39. Subject string `json:"subject" gorm:"comment:标题"`
  40. Content string `json:"content" gorm:"comment:内容"`
  41. Cycle string `json:"cycle" gorm:"comment:循环时间"`
  42. Duration string `json:"duration" gorm:"comment:持续时间"`
  43. HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"`
  44. DueDate time.Time `json:"dueDate" gorm:"comment:到期时间"`
  45. AssignType string `json:"assignType" gorm:"comment:审批类型"`
  46. AssignValue string `json:"assignValue" gorm:"comment:审批类型值"`
  47. }
  48. type WorkflowEdge struct {
  49. ID string `json:"id" form:"id" gorm:"comment:唯一标识;primaryKey;unique;not null"`
  50. CreatedAt time.Time
  51. UpdatedAt time.Time
  52. DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
  53. WorkflowProcessID string `json:"-" gorm:"comment:流程标识"`
  54. Clazz string `json:"clazz" gorm:"comment:类型(线)"`
  55. Source string `json:"source" gorm:"comment:起点节点"`
  56. Target string `json:"target" gorm:"comment:目标节点"`
  57. SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"`
  58. TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"`
  59. Description string `json:"description" gorm:"comment:详细介绍"`
  60. Shape string `json:"shape" gorm:"comment:形状"`
  61. StartPoint WorkflowStartPoint `json:"startPoint"` // 起点信息
  62. EndPoint WorkflowEndPoint `json:"endPoint"` // 终点信息
  63. Label string `json:"label" gorm:"comment:标题"`
  64. HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"`
  65. ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"`
  66. Seq string `json:"seq" gorm:"comment:序号"`
  67. Reverse bool `json:"reverse" gorm:"comment:是否反向"`
  68. }
  69. type WorkflowStartPoint struct {
  70. WorkflowEdgeID string
  71. WorkflowPoint
  72. }
  73. type WorkflowEndPoint struct {
  74. WorkflowEdgeID string
  75. WorkflowPoint
  76. }
  77. //
  78. type WorkflowPoint struct {
  79. global.GVA_MODEL
  80. X float64 `json:"x"`
  81. Y float64 `json:"y"`
  82. Index int `json:"index"`
  83. }