data.ts 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { listDictModel } from '@/api/common';
  3. // export const BasicWeek = [
  4. // {
  5. // field: 'monday',
  6. // label: '星期一',
  7. // },
  8. // {
  9. // field: 'tuesday',
  10. // label: '星期二',
  11. // },
  12. // {
  13. // field: 'wednesday',
  14. // label: '星期三',
  15. // },
  16. // {
  17. // field: 'thursday',
  18. // label: '星期四',
  19. // },
  20. // {
  21. // field: 'friday',
  22. // label: '星期五',
  23. // },
  24. // {
  25. // field: 'saturday',
  26. // label: '星期六',
  27. // },
  28. // {
  29. // field: 'sunday',
  30. // label: '星期日',
  31. // },
  32. // ];
  33. export enum BasicWeekEnum {
  34. monday = '星期一',
  35. monday_field = 'monday',
  36. tuesday = '星期二',
  37. tuesday_field = 'tuesday',
  38. wednesday = '星期三',
  39. wednesday_field = 'wednesday',
  40. thursday = '星期四',
  41. thursday_field = 'thursday',
  42. friday = '星期五',
  43. friday_field = 'friday',
  44. saturday = '星期六',
  45. saturday_field = 'saturday',
  46. sunday = '星期日',
  47. sunday_field = 'sunday',
  48. }
  49. export const BasicTab = [
  50. {
  51. key: '0',
  52. label: '全部',
  53. value: 0,
  54. hasValue: true,
  55. hasBracket: true,
  56. },
  57. {
  58. key: '1',
  59. label: '新患者',
  60. value: 12,
  61. hasValue: true,
  62. prefixColor: '#1BC1B3',
  63. // valueColor: 'red',
  64. hasBracket: true,
  65. },
  66. {
  67. key: '2',
  68. label: '无排班患者',
  69. value: 0,
  70. hasValue: true,
  71. prefixColor: '#F7B500',
  72. hasBracket: true,
  73. },
  74. ];
  75. export const BasicTabActive = BasicTab[0].key;
  76. export const columns: BasicColumn[] = [
  77. {
  78. title: '编号',
  79. dataIndex: 'patientUniqueNo',
  80. align: 'left',
  81. width: 160,
  82. },
  83. {
  84. title: '姓名',
  85. dataIndex: 'patientName',
  86. align: 'left',
  87. width: 120,
  88. },
  89. {
  90. title: '性别',
  91. dataIndex: 'patientGender',
  92. align: 'left',
  93. width: 80,
  94. },
  95. {
  96. title: '年龄',
  97. dataIndex: 'age',
  98. align: 'left',
  99. width: 80,
  100. },
  101. {
  102. title: '建档时间',
  103. dataIndex: 'archivesCreateTime',
  104. align: 'left',
  105. width: 200,
  106. },
  107. {
  108. title: '类型',
  109. dataIndex: 'patientType',
  110. align: 'left',
  111. width: 100,
  112. },
  113. {
  114. title: '透析机器',
  115. dataIndex: 'machine',
  116. align: 'left',
  117. width: 130,
  118. },
  119. {
  120. title: '透析频率',
  121. dataIndex: 'frequency',
  122. align: 'left',
  123. width: 120,
  124. },
  125. {
  126. title: '特殊时间需求',
  127. dataIndex: 'specialNeed',
  128. align: 'left',
  129. // width: 300,
  130. ellipsis: true,
  131. },
  132. ];
  133. // 表单新增编辑
  134. export const dataFormSchema: FormSchema[] = [
  135. {
  136. label: '编号',
  137. field: 'patientUniqueNo',
  138. component: 'PlainText',
  139. },
  140. {
  141. label: '建档时间',
  142. field: 'archivesCreateTime',
  143. component: 'PlainText',
  144. },
  145. {
  146. label: '类型',
  147. field: 'patientType',
  148. component: 'ApiSelect',
  149. componentProps: {
  150. api: listDictModel,
  151. params: {
  152. dictCode: 'pb_type',
  153. },
  154. disabled: true,
  155. },
  156. },
  157. {
  158. label: '透析机器',
  159. field: 'machine',
  160. component: 'ApiCheckboxGroup',
  161. componentProps: {
  162. api: listDictModel,
  163. params: {
  164. dictCode: 'bm_pump',
  165. },
  166. },
  167. },
  168. {
  169. field: 'frequency',
  170. label: '透析频次(次/周)',
  171. component: 'ApiInputDict',
  172. componentProps: ({ formModel }) => {
  173. return {
  174. api: listDictModel,
  175. params: {
  176. dictCode: 'sp_week',
  177. dictSort: true,
  178. },
  179. onChange: e => {
  180. console.log('🚀 ~ file: data.ts:81 ~ e:', e);
  181. return (formModel['frequency'] = e);
  182. },
  183. };
  184. },
  185. },
  186. {
  187. label: '特殊时间需求',
  188. field: 'special',
  189. component: 'RadioGroup',
  190. componentProps: {
  191. options: [
  192. { label: '无', value: 0 },
  193. { label: '有', value: 1 },
  194. ],
  195. },
  196. },
  197. {
  198. label: '期望周次',
  199. field: 'specialNeedWeek',
  200. required: true,
  201. component: 'CheckboxGroup',
  202. componentProps: {
  203. options: [
  204. {
  205. label: '第一班',
  206. value: '1',
  207. },
  208. {
  209. label: '第二班',
  210. value: '2',
  211. },
  212. {
  213. label: '第三班',
  214. value: '3',
  215. },
  216. ],
  217. },
  218. show: ({ values }) => {
  219. return values.special == 1;
  220. },
  221. colProps: {
  222. span: 24,
  223. },
  224. },
  225. {
  226. label: '期望班次',
  227. field: 'sailingSorts',
  228. required: true,
  229. component: 'CheckboxGroup',
  230. componentProps: {
  231. options: [
  232. {
  233. label: '第一班',
  234. value: '1',
  235. },
  236. {
  237. label: '第二班',
  238. value: '2',
  239. },
  240. {
  241. label: '第三班',
  242. value: '3',
  243. },
  244. ],
  245. },
  246. show: ({ values }) => {
  247. return values.special == 1;
  248. },
  249. colProps: {
  250. span: 24,
  251. },
  252. },
  253. ];