form.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. import { FormConfig } from '@/types/basic-form';
  2. import { EMERGENCY_DRILL_SCOPE, EMERGENCY_DRILL_SCOPE_DICT } from '../../constants';
  3. export const DRILL_CREATE_FORM_CONFIG: FormConfig[] = [
  4. {
  5. prop: 'drillScope',
  6. label: '演练规模:',
  7. component: 'el-select',
  8. componentProps: {
  9. placeholder: '请选择演练规模',
  10. },
  11. selectOptions: [
  12. {
  13. label: EMERGENCY_DRILL_SCOPE_DICT[EMERGENCY_DRILL_SCOPE.INSTITUTE].label,
  14. value: EMERGENCY_DRILL_SCOPE_DICT[EMERGENCY_DRILL_SCOPE.INSTITUTE].dict,
  15. },
  16. {
  17. label: EMERGENCY_DRILL_SCOPE_DICT[EMERGENCY_DRILL_SCOPE.DEPT].label,
  18. value: EMERGENCY_DRILL_SCOPE_DICT[EMERGENCY_DRILL_SCOPE.DEPT].dict,
  19. },
  20. ],
  21. },
  22. {
  23. prop: 'drillContent',
  24. label: '演练内容:',
  25. component: 'el-input',
  26. componentProps: { placeholder: '请输入演练内容' },
  27. },
  28. {
  29. prop: 'dueCompleteTime',
  30. label: '计划完成日期:',
  31. component: 'el-date-picker',
  32. componentProps: {
  33. type: 'date',
  34. placeholder: '请选择计划完成日期',
  35. format: 'YYYY-MM-DD',
  36. valueFormat: 'YYYY-MM-DD',
  37. },
  38. },
  39. {
  40. prop: 'responsibleDeptIdList',
  41. label: '责任部门:',
  42. slot: 'responsibleDeptIdList',
  43. },
  44. {
  45. prop: 'coordinateDeptIdList',
  46. label: '配合部门:',
  47. slot: 'coordinateDeptIdList',
  48. },
  49. {
  50. prop: 'preplanId',
  51. label: '应急预案:',
  52. slot: 'preplanId',
  53. },
  54. {
  55. prop: 'approvalTemplateId',
  56. label: '审批流程:',
  57. slot: 'approvalTemplateId',
  58. },
  59. ];
  60. export const DRILL_CREATE_FORM_RULES = {
  61. drillScope: [
  62. {
  63. required: true,
  64. message: '请选择演练规模',
  65. trigger: 'change',
  66. },
  67. ],
  68. drillContent: [
  69. {
  70. required: true,
  71. message: '请输入演练内容',
  72. trigger: 'blur',
  73. },
  74. ],
  75. dueCompleteTime: [
  76. {
  77. required: true,
  78. message: '请选择计划完成时间',
  79. trigger: 'change',
  80. },
  81. ],
  82. responsibleDeptIdList: [
  83. {
  84. required: true,
  85. message: '请选择责任部门',
  86. trigger: 'change',
  87. },
  88. ],
  89. approvalTemplateId: [
  90. {
  91. required: true,
  92. message: '请选择审批流程',
  93. trigger: 'change',
  94. },
  95. ],
  96. };
  97. export const DRILL_CREATE_FORM_DATA = {
  98. drillScope: '',
  99. drillContent: '',
  100. dueCompleteTime: '',
  101. responsibleDeptIdList: undefined,
  102. coordinateDeptIdList: undefined,
  103. preplanId: undefined,
  104. approvalTemplateId: undefined,
  105. };
  106. export const DRILL_EXECUTE_FORM_CONFIG = [
  107. {
  108. prop: 'drillTime',
  109. label: '演练时间:',
  110. component: 'el-date-picker',
  111. componentProps: {
  112. type: 'date',
  113. placeholder: '请选择演练时间',
  114. format: 'YYYY-MM-DD',
  115. valueFormat: 'YYYY-MM-DD',
  116. },
  117. },
  118. {
  119. prop: 'drillLocation',
  120. label: '演练地点:',
  121. component: 'el-input',
  122. componentProps: { placeholder: '请输入演练地点' },
  123. },
  124. {
  125. prop: 'personInChargeName',
  126. label: '负责人:',
  127. slot: 'personInChargeName',
  128. },
  129. {
  130. prop: 'drillDeptIdList',
  131. label: '演练部门:',
  132. slot: 'drillDeptIdList',
  133. },
  134. {
  135. prop: 'drillScript',
  136. label: '演练脚本:',
  137. slot: 'drillScript',
  138. },
  139. ];
  140. export const INS_DRILL_EXECUTE_FORM_RULES = {
  141. drillTime: [{ required: true, message: '请选择演练时间', trigger: 'change' }],
  142. drillLocation: [{ required: true, message: '请输入演练地点', trigger: 'blur' }],
  143. personInChargeName: [{ required: true, message: '请选择演练负责人', trigger: 'change' }],
  144. drillDeptIdList: [{ required: true, message: '请选择演练部门', trigger: 'change' }],
  145. drillScript: [{ required: true, message: '请上传演练脚本', trigger: 'change' }],
  146. };
  147. export const DEP_DRILL_EXECUTE_FORM_RULES = {
  148. drillTime: [{ required: true, message: '请选择演练时间', trigger: 'change' }],
  149. drillLocation: [{ required: true, message: '请输入演练地点', trigger: 'blur' }],
  150. personInChargeName: [{ required: true, message: '请选择演练负责人', trigger: 'change' }],
  151. };
  152. export const DRILL_EXECUTE_FORM_DATA = {
  153. drillTime: undefined,
  154. drillLocation: '',
  155. personInChargeName: undefined,
  156. drillDeptIdList: undefined,
  157. drillScript: undefined,
  158. };