evaluationFormOptions.ts 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. import type { IDynamicFormOptions } from '@/components/dynamic';
  2. import type { RadioValueProps } from '@/components/dynamic/wrappers/RadioValue';
  3. import type { FieldProps } from '@/components/form/Field.vue';
  4. import type { SignatureFieldProps } from '@/components/form/SignatureField.vue';
  5. import { useImageSimpleUploadCo } from '@/common/components/upload/ImageUploadCo';
  6. /** 与 `evaluation-form` 页一致的动态表单配置(供编辑页与只读展示复用) */
  7. export function buildSelfAssessmentFormOptions(
  8. signUpload: ReturnType<typeof useImageSimpleUploadCo>,
  9. type: 'start' | 'end',
  10. ): IDynamicFormOptions {
  11. return {
  12. formAdditionaProps: {
  13. labelFlex: 4,
  14. inputFlex: 8,
  15. },
  16. formItems: [
  17. type === 'start' ? {
  18. type: 'flat-group',
  19. label: '传承人自查评估',
  20. name: 'selfAssessmentGroup',
  21. childrenColProps: { span: 24 },
  22. children: [
  23. {
  24. label: '传承人名称',
  25. name: 'inheritor',
  26. type: 'text',
  27. additionalProps: { placeholder: '请输入传承人名称' },
  28. },
  29. {
  30. label: '项目保护单位',
  31. name: 'unit',
  32. type: 'text',
  33. additionalProps: { placeholder: '请输入项目保护单位' },
  34. },
  35. {
  36. label: '项目名称',
  37. name: 'ichName',
  38. type: 'text',
  39. additionalProps: { placeholder: '请输入项目名称' },
  40. },
  41. {
  42. label: '联系电话',
  43. name: 'mobile',
  44. type: 'text',
  45. additionalProps: { placeholder: '请输入联系电话' },
  46. },
  47. {
  48. label: '身份证号',
  49. name: 'idCard',
  50. type: 'text',
  51. additionalProps: { placeholder: '请输入身份证号' },
  52. },
  53. {
  54. label: '级别',
  55. name: 'level',
  56. type: 'select-id',
  57. additionalProps: {
  58. placeholder: '请选择级别',
  59. loadData: async () => [
  60. { text: '国家级', value: 23 },
  61. { text: '省级', value: 24 },
  62. { text: '市级', value: 25 },
  63. ],
  64. },
  65. formProps: {
  66. showRightArrow: true,
  67. },
  68. },
  69. {
  70. label: '家庭住址',
  71. name: 'address',
  72. type: 'text',
  73. additionalProps: { placeholder: '请输入家庭住址' },
  74. },
  75. {
  76. label: '获评时间',
  77. name: 'awardTime',
  78. type: 'date',
  79. additionalProps: {
  80. placeholder: '请选择获评时间',
  81. shouldUpdateValueImmediately: true,
  82. },
  83. formProps: {
  84. showRightArrow: true,
  85. },
  86. },
  87. {
  88. label: '自评报告',
  89. name: 'content',
  90. type: 'object',
  91. children: [
  92. {
  93. label: '',
  94. name: 'title',
  95. type: 'static-text',
  96. },
  97. {
  98. label: '(一)开展传承活动,培养后继人才情况;',
  99. name: 'item0',
  100. type: 'textarea',
  101. formProps: { labelPosition: 'top' },
  102. additionalProps: {
  103. placeholder: '请填写',
  104. maxLength: 1000,
  105. colon: false,
  106. showWordLimit: true,
  107. },
  108. },
  109. {
  110. label: '(二)妥善保存相关实物、资料情况;',
  111. name: 'item1',
  112. type: 'textarea',
  113. formProps: { labelPosition: 'top' },
  114. additionalProps: {
  115. placeholder: '请填写',
  116. maxLength: 1000,
  117. colon: false,
  118. showWordLimit: true,
  119. },
  120. },
  121. {
  122. label: '(三)配合进行非物质文化遗产调查情况;',
  123. name: 'item2',
  124. type: 'textarea',
  125. formProps: { labelPosition: 'top' },
  126. additionalProps: {
  127. placeholder: '请填写',
  128. maxLength: 1000,
  129. colon: false,
  130. showWordLimit: true,
  131. },
  132. },
  133. {
  134. label: '(四)参加非物质文化遗产公益性宣传情况;',
  135. name: 'item3',
  136. type: 'textarea',
  137. formProps: { labelPosition: 'top' },
  138. additionalProps: {
  139. placeholder: '请填写',
  140. maxLength: 1000,
  141. colon: false,
  142. showWordLimit: true,
  143. },
  144. },
  145. {
  146. label: '(五)补助经费使用情况;',
  147. name: 'item4',
  148. type: 'textarea',
  149. formProps: { labelPosition: 'top' },
  150. additionalProps: {
  151. placeholder: '请填写',
  152. maxLength: 1000,
  153. colon: false,
  154. showWordLimit: true,
  155. },
  156. },
  157. {
  158. label: '(六)参加培训情况',
  159. name: 'item5',
  160. type: 'textarea',
  161. formProps: { labelPosition: 'top' },
  162. additionalProps: {
  163. placeholder: '请填写',
  164. maxLength: 1000,
  165. colon: false,
  166. showWordLimit: true,
  167. },
  168. },
  169. {
  170. label: '(七)其他相关情况;',
  171. name: 'item6',
  172. type: 'textarea',
  173. formProps: { labelPosition: 'top' },
  174. additionalProps: {
  175. placeholder: '请填写',
  176. maxLength: 1000,
  177. colon: false,
  178. showWordLimit: true,
  179. } as FieldProps,
  180. },
  181. {
  182. label: '(八)存在的问题及原因分析。',
  183. name: 'item7',
  184. type: 'textarea',
  185. formProps: { labelPosition: 'top' },
  186. additionalProps: {
  187. placeholder: '请填写',
  188. maxLength: 1000,
  189. colon: false,
  190. showWordLimit: true,
  191. },
  192. },
  193. ],
  194. },
  195. ],
  196. } :
  197. {
  198. type: 'flat-group',
  199. label: '传承人自查评估',
  200. name: 'selfAssessmentGroup2',
  201. childrenColProps: { span: 24 },
  202. children: [
  203. {
  204. label: '其他相关情况(扣分内容)',
  205. name: 'deductContent',
  206. type: 'text',
  207. additionalProps: {
  208. showWordLimit: true,
  209. maxlength: 260,
  210. placeholder: '请输入其他相关情况(扣分内容)',
  211. } as FieldProps,
  212. },
  213. {
  214. label: '其他相关情况(扣分分值)',
  215. name: 'deductPoints',
  216. type: 'number',
  217. additionalProps: {
  218. placeholder: '请输入其他相关情况(扣分分值)',
  219. min: 0,
  220. max: 100,
  221. },
  222. },
  223. {
  224. label: '自我评估',
  225. name: 'self',
  226. type: 'radio-value',
  227. additionalProps: {
  228. options: [
  229. { text: '优秀', value: 1 },
  230. { text: '合格', value: 2 },
  231. { text: '不合格', value: 3 },
  232. { text: '丧失传承能力', value: 4 },
  233. { text: '取消资格', value: 5 },
  234. ],
  235. vertical: true,
  236. } as RadioValueProps,
  237. },
  238. {
  239. label: '传承人签名',
  240. name: 'inheritorSign',
  241. type: 'sign',
  242. formProps: {
  243. showRightArrow: true,
  244. },
  245. additionalProps: {
  246. upload: signUpload,
  247. previewImageProps: {
  248. width: '400rpx',
  249. },
  250. } as SignatureFieldProps,
  251. },
  252. {
  253. label: '填报人联系方式',
  254. name: 'contactMobile',
  255. type: 'text',
  256. formProps: {
  257. extraMessage: '用于消息通知,若有审核回退或通过,会以短信方式通知您',
  258. },
  259. additionalProps: {
  260. placeholder: '请填写手机号',
  261. },
  262. },
  263. ],
  264. },
  265. ],
  266. formRules: {
  267. inheritor: [{ required: true, message: '请输入传承人名称' }],
  268. unit: [{ required: true, message: '请输入项目保护单位' }],
  269. ichName: [{ required: true, message: '请输入项目名称' }],
  270. mobile: [{ required: true, message: '请输入联系电话' }],
  271. idCard: [{ required: true, message: '请输入身份证号' }],
  272. level: [{ required: true, message: '请选择级别' }],
  273. address: [{ required: true, message: '请输入家庭住址' }],
  274. content: [{ required: true, message: '请填写自评报告' }],
  275. self: [{ required: true, message: '请选择自我评估' }],
  276. sign: [{ required: true, message: '请传承人签名' }],
  277. awardTime: [{ required: true, message: '请选择获评时间' }],
  278. },
  279. };
  280. }