data.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Form';
  3. import { radioBoolean } from '/@/utils/filters';
  4. import { listDictModel } from '/@/api/common';
  5. import { ColorEnum } from '@/enums/colorEnum';
  6. export enum TitleEnum {
  7. finish = '已完成',
  8. finishColor = ColorEnum.MUTED,
  9. finishBg = ColorEnum.MUTED_BG,
  10. printable = '可打印',
  11. printableColor = ColorEnum.SUCCESS,
  12. printableBg = ColorEnum.SUCCESS_BG,
  13. unWeighed = '未称量',
  14. unWeighedColor = ColorEnum.PRIMARY,
  15. unWeighedBg = ColorEnum.PRIMARY_BG,
  16. unconfirmed = '待确认',
  17. unconfirmedColor = ColorEnum.WARNING,
  18. unconfirmedBg = ColorEnum.WARNING_BG,
  19. }
  20. export const dataFormSchema: FormSchema[] = [
  21. {
  22. field: 'PlainTitle',
  23. component: 'PlainTitle',
  24. defaultValue: '检测时间',
  25. colProps: {
  26. span: 24,
  27. },
  28. },
  29. {
  30. field: 'PlainText',
  31. component: 'RadioDescGroup',
  32. label: '1、干体重在过去3~6个月总的变化',
  33. componentProps: {
  34. options: [
  35. { label: '干体重没有减少或体重丢失 <0.5kg (0分)', value: 0 },
  36. { label: '体重丢失 ≥0.5kg,但 <1kg (1分)', value: 1 },
  37. ],
  38. },
  39. colProps: {
  40. span: 24,
  41. },
  42. defaultValue: 1,
  43. },
  44. {
  45. field: 'configName',
  46. label: '参数名称',
  47. labelColor: '#818694',
  48. component: 'Input',
  49. componentProps: {
  50. placeholder: '请输入参数名称',
  51. extra: '123123',
  52. },
  53. },
  54. {
  55. field: 'configName1',
  56. label: '参数名称',
  57. labelColor: '#818694',
  58. component: 'Input',
  59. componentProps: {
  60. placeholder: '请输入参数名称',
  61. extra: '123123',
  62. },
  63. },
  64. {
  65. field: 'configName22',
  66. label: '参数名称',
  67. labelColor: '#818694',
  68. component: 'Input',
  69. componentProps: {
  70. placeholder: '请输入参数名称',
  71. extra: '123123',
  72. },
  73. },
  74. {
  75. field: 'configName333',
  76. label: '有无异常',
  77. component: 'ApiComplex',
  78. componentProps: ({ formModel }) => {
  79. return {
  80. placeholder: '请输入异常内容',
  81. api: listDictModel,
  82. params: {
  83. dictCode: 'sys_dict_type',
  84. },
  85. onChange: e => {
  86. console.log('🚀 ~ file: data.ts:81 ~ e:', e);
  87. return (formModel['configName333'] = e);
  88. },
  89. };
  90. },
  91. },
  92. {
  93. field: 'configKey',
  94. label: '参数键名',
  95. labelColor: '#81869 4',
  96. subLabel: '测试',
  97. subLabelColor: '#FF5D39',
  98. component: 'Input',
  99. required: true,
  100. componentProps: {
  101. placeholder: '请输入参数键名',
  102. // style: { width: '200px' },
  103. },
  104. },
  105. {
  106. field: 'configValue',
  107. label: '参数键值',
  108. component: 'InputNumberGroup',
  109. componentProps: ({ formModel }) => {
  110. return {
  111. options: [
  112. { min: 0, max: 200, placeholder: '最小值 0', field: 'min' },
  113. { min: 0, max: 200, placeholder: '最大值 200', field: 'max' },
  114. ],
  115. onChange: e => {
  116. return (formModel['configValue'] = e);
  117. },
  118. };
  119. },
  120. },
  121. {
  122. field: 'idCard',
  123. label: '证件号码',
  124. component: 'ApiInputDict',
  125. componentProps: ({ formModel }) => {
  126. return {
  127. placeholder: '请输入异常内容',
  128. api: listDictModel,
  129. params: {
  130. dictCode: 'sys_dict_type',
  131. dictSort: true,
  132. },
  133. onChange: e => {
  134. console.log('🚀 ~ file: data.ts:81 ~ e:', e);
  135. return (formModel['idCard'] = e);
  136. },
  137. };
  138. },
  139. },
  140. {
  141. field: 'sort',
  142. label: '排序',
  143. component: 'InputNumber',
  144. required: true,
  145. defaultValue: '1',
  146. componentProps: {
  147. placeholder: '请输入排序',
  148. min: 1,
  149. },
  150. },
  151. {
  152. field: 'sysInner',
  153. label: '系统内置',
  154. component: 'RadioGroup',
  155. componentProps: {
  156. options: radioBoolean,
  157. disabled: true,
  158. },
  159. defaultValue: '1',
  160. },
  161. {
  162. field: 'apiCheck',
  163. label: '系统内置',
  164. component: 'ApiCheckboxGroup',
  165. componentProps: {
  166. api: listDictModel,
  167. params: {
  168. dictCode: 'bm_pump',
  169. },
  170. },
  171. // defaultValue: ['pump_single'],
  172. },
  173. // {
  174. // field: 'disable',
  175. // label: '状态',
  176. // component: 'RadioGroup',
  177. // required: true,
  178. // componentProps: {
  179. // options: radioSwitch,
  180. // },
  181. // defaultValue: '0',
  182. // },
  183. {
  184. label: '备注',
  185. field: 'remark',
  186. component: 'InputTextArea',
  187. componentProps: {
  188. placeholder: '请输入备注',
  189. },
  190. },
  191. ];
  192. export const columns: BasicColumn[] = [
  193. {
  194. title: '名称',
  195. dataIndex: 'name',
  196. width: 100,
  197. edit: true,
  198. editable: true,
  199. editComponent: 'Input',
  200. },
  201. {
  202. title: '类型',
  203. dataIndex: 'type',
  204. width: 150,
  205. },
  206. {
  207. title: '联系人',
  208. dataIndex: 'contractUser',
  209. width: 150,
  210. },
  211. {
  212. title: '联系人电话',
  213. dataIndex: 'contactMobile',
  214. width: 150,
  215. },
  216. {
  217. title: '名称',
  218. dataIndex: 'name',
  219. width: 100,
  220. },
  221. {
  222. title: '类型',
  223. dataIndex: 'type',
  224. width: 150,
  225. },
  226. {
  227. title: '联系人',
  228. dataIndex: 'contractUser',
  229. width: 150,
  230. },
  231. {
  232. title: '联系人电话',
  233. dataIndex: 'contactMobile',
  234. width: 150,
  235. },
  236. {
  237. title: '管理账号',
  238. dataIndex: 'username',
  239. width: 150,
  240. },
  241. {
  242. title: '套餐名称',
  243. dataIndex: 'packageName',
  244. width: 150,
  245. },
  246. {
  247. title: '联系人',
  248. dataIndex: 'contractUser',
  249. width: 150,
  250. },
  251. {
  252. title: '联系人电话',
  253. dataIndex: 'contactMobile',
  254. width: 150,
  255. },
  256. {
  257. title: '管理账号',
  258. dataIndex: 'username',
  259. width: 150,
  260. },
  261. {
  262. title: '套餐名称',
  263. dataIndex: 'packageName',
  264. width: 150,
  265. fixed: 'right',
  266. },
  267. {
  268. title: '状态',
  269. dataIndex: 'disable',
  270. fixed: 'right',
  271. },
  272. ];