matter.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. settlementPassingRate?: number;
  32. }
  33. export interface IGatherMatter extends IMatter {
  34. businessID: string;
  35. }
  36. export interface IStepMatter {
  37. ID: string;
  38. userID: string;
  39. gatherID: string;
  40. businessType: BusinessTypeKey;
  41. stepID: string;
  42. matterID: string;
  43. formPermission: string[];
  44. costPermission: string[];
  45. profilePermission: string[];
  46. auditCommentsPermission: string[];
  47. settlementPermission: string[];
  48. budgetComparePermission: string[];
  49. changeAuditPermission: string[];
  50. }
  51. export interface IGatherStepMatter extends IStepMatter {
  52. businessID: string;
  53. userID: string;
  54. }
  55. export interface IYsProfileTemplate {
  56. ID: string;
  57. parentID: string;
  58. gatherID: string;
  59. businessType: BusinessTypeKey;
  60. name: string;
  61. sort: string;
  62. enable: boolean;
  63. required: boolean;
  64. folder: boolean;
  65. mode: string[];
  66. selectMode?: string;
  67. fileNum?: number;
  68. }
  69. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  70. businessID: string;
  71. matterID?: string;
  72. }
  73. export interface IDynamicStep {
  74. ID: string;
  75. gatherID: string;
  76. businessType: BusinessTypeKey;
  77. stepID: string;
  78. nextStepID: string;
  79. executorID: boolean;
  80. }
  81. export interface IGatherDynamicStep extends IDynamicStep {
  82. businessID: string;
  83. }
  84. // 组件权限相关
  85. export interface IProcessComponentPermission {
  86. // 是否可编辑
  87. editable: boolean;
  88. // 是否可查看
  89. viewable: boolean;
  90. // 能否创建项目
  91. createProject?: boolean;
  92. // 新增
  93. add?: boolean;
  94. // 审核
  95. audit?: boolean;
  96. // 增报
  97. addReport?: boolean;
  98. }
  99. // 步骤里的的组件
  100. export interface IProcessComponent<T = any> {
  101. // 组件名:'cost'、'form'...
  102. name: string;
  103. // 组件权限
  104. permission: IProcessComponentPermission;
  105. // 组件数据
  106. data?: T | null;
  107. // 组件标题
  108. componentTitle?: string;
  109. }
  110. // 步骤里的事项
  111. export interface IProcessMatter {
  112. // 事项ID
  113. matterID: string;
  114. // 事项可用组件
  115. components: IProcessComponent[];
  116. }
  117. // 前端展示需要用的事项数据结构
  118. export interface IMatterNode {
  119. ID: string;
  120. seq: number;
  121. parentID: string;
  122. name: string;
  123. components: IProcessComponent[];
  124. }
  125. export const ComponentNameMap: Record<string, string> = {
  126. dataProfile: '送审资料',
  127. form: '表单',
  128. costProfile: '造价文件',
  129. auditAmountSummary: '审核金额汇总',
  130. auditComments: '审核意见',
  131. settlement: '造价文件',
  132. budgetCompare: '概算-预算阶段造价对比',
  133. resultsDocument: '成果文件',
  134. changeAudit: '传统变更审核',
  135. };