matter.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import { BusinessTypeKey, MatterTypeKey } from './gather';
  2. // 审批金额汇总组件阶段数据
  3. export interface IAuditSummaryConfig {
  4. // 阶段名称
  5. name: string;
  6. // 关联步骤ID(条件下有多个步骤)
  7. stepIDs: string[];
  8. }
  9. // 审核意见组件配置
  10. export interface IAuditCommentConfig {
  11. // 富文本模板
  12. template: string;
  13. }
  14. // 事项
  15. export interface IMatter {
  16. ID: string;
  17. gatherID: string;
  18. businessType: BusinessTypeKey;
  19. matterType: MatterTypeKey;
  20. parentID: string;
  21. name: string;
  22. sort: string;
  23. formSchema: any;
  24. // 组件名列表
  25. assembly: string[];
  26. dataID: string;
  27. // 审批金额组件配置
  28. auditAmountConfig?: IAuditSummaryConfig[];
  29. // 审核意见组件配置
  30. auditCommentsConfig?: IAuditCommentConfig;
  31. }
  32. export interface IGatherMatter extends IMatter {
  33. businessID: string;
  34. }
  35. export interface IStepMatter {
  36. ID: string;
  37. userID: string;
  38. gatherID: string;
  39. businessType: BusinessTypeKey;
  40. stepID: string;
  41. matterID: string;
  42. formPermission: string[];
  43. costPermission: string[];
  44. profilePermission: string[];
  45. auditCommentsPermission: string[];
  46. settlementPermission: string[];
  47. }
  48. export interface IGatherStepMatter extends IStepMatter {
  49. businessID: string;
  50. userID: string;
  51. }
  52. export interface IYsProfileTemplate {
  53. ID: string;
  54. parentID: string;
  55. gatherID: string;
  56. businessType: BusinessTypeKey;
  57. name: string;
  58. sort: string;
  59. enable: boolean;
  60. required: boolean;
  61. folder: boolean;
  62. mode: string[];
  63. selectMode?: string;
  64. fileNum?: number;
  65. }
  66. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  67. businessID: string;
  68. }
  69. export interface IDynamicStep {
  70. ID: string;
  71. gatherID: string;
  72. businessType: BusinessTypeKey;
  73. stepID: string;
  74. nextStepID: string;
  75. executorID: boolean;
  76. }
  77. export interface IGatherDynamicStep extends IDynamicStep {
  78. businessID: string;
  79. }
  80. // 组件权限相关
  81. export interface IProcessComponentPermission {
  82. // 是否可编辑
  83. editable: boolean;
  84. // 是否可查看
  85. viewable: boolean;
  86. // 能否创建项目
  87. createProject?: boolean;
  88. }
  89. // 步骤里的的组件
  90. export interface IProcessComponent<T = any> {
  91. // 组件名:'cost'、'form'...
  92. name: string;
  93. // 组件权限
  94. permission: IProcessComponentPermission;
  95. // 组件数据
  96. data?: T | null;
  97. }
  98. // 步骤里的事项
  99. export interface IProcessMatter {
  100. // 事项ID
  101. matterID: string;
  102. // 事项可用组件
  103. components: IProcessComponent[];
  104. }
  105. // 前端展示需要用的事项数据结构
  106. export interface IMatterNode {
  107. ID: string;
  108. seq: number;
  109. parentID: string;
  110. name: string;
  111. components: IProcessComponent[];
  112. }
  113. export const ComponentNameMap: Record<string, string> = {
  114. dataProfile: '送审资料',
  115. form: '表单',
  116. costProfile: '造价文件',
  117. auditAmountSummary: '审核金额汇总',
  118. auditComments: '审核意见',
  119. settlement: '造价文件',
  120. };