matter.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. budgetComparePermission: string[];
  48. }
  49. export interface IGatherStepMatter extends IStepMatter {
  50. businessID: string;
  51. userID: string;
  52. }
  53. export interface IYsProfileTemplate {
  54. ID: string;
  55. parentID: string;
  56. gatherID: string;
  57. businessType: BusinessTypeKey;
  58. name: string;
  59. sort: string;
  60. enable: boolean;
  61. required: boolean;
  62. folder: boolean;
  63. mode: string[];
  64. selectMode?: string;
  65. fileNum?: number;
  66. }
  67. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  68. businessID: string;
  69. }
  70. export interface IDynamicStep {
  71. ID: string;
  72. gatherID: string;
  73. businessType: BusinessTypeKey;
  74. stepID: string;
  75. nextStepID: string;
  76. executorID: boolean;
  77. }
  78. export interface IGatherDynamicStep extends IDynamicStep {
  79. businessID: string;
  80. }
  81. // 组件权限相关
  82. export interface IProcessComponentPermission {
  83. // 是否可编辑
  84. editable: boolean;
  85. // 是否可查看
  86. viewable: boolean;
  87. // 能否创建项目
  88. createProject?: boolean;
  89. }
  90. // 步骤里的的组件
  91. export interface IProcessComponent<T = any> {
  92. // 组件名:'cost'、'form'...
  93. name: string;
  94. // 组件权限
  95. permission: IProcessComponentPermission;
  96. // 组件数据
  97. data?: T | null;
  98. }
  99. // 步骤里的事项
  100. export interface IProcessMatter {
  101. // 事项ID
  102. matterID: string;
  103. // 事项可用组件
  104. components: IProcessComponent[];
  105. }
  106. // 前端展示需要用的事项数据结构
  107. export interface IMatterNode {
  108. ID: string;
  109. seq: number;
  110. parentID: string;
  111. name: string;
  112. components: IProcessComponent[];
  113. }
  114. export const ComponentNameMap: Record<string, string> = {
  115. dataProfile: '送审资料',
  116. form: '表单',
  117. costProfile: '造价文件',
  118. auditAmountSummary: '审核金额汇总',
  119. auditComments: '审核意见',
  120. settlement: '造价文件',
  121. budgetCompare: '概算-预算阶段造价对比',
  122. };