damper.data.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { rules } from '/@/utils/helper/validator';
  4. import { list } from '../substationTabel/substation.api';
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '名称',
  8. dataIndex: 'strname',
  9. width: 120,
  10. },
  11. {
  12. title: '安装位置',
  13. dataIndex: 'strinstallpos',
  14. width: 100,
  15. },
  16. {
  17. title: '是否为常闭型',
  18. dataIndex: 'bnormalclose',
  19. width: 100,
  20. // customRender: render.renderAvatar,
  21. },
  22. {
  23. title: '净宽',
  24. dataIndex: 'fclearwidth',
  25. width: 80,
  26. sorter: true,
  27. },
  28. {
  29. title: '净高',
  30. dataIndex: 'fclearheight',
  31. width: 100,
  32. sorter: true,
  33. },
  34. {
  35. title: '风门道数',
  36. dataIndex: 'ndoorcount',
  37. width: 100,
  38. },
  39. {
  40. title: '所属分站',
  41. width: 150,
  42. dataIndex: 'stationname',
  43. },
  44. {
  45. title: '点表',
  46. width: 100,
  47. dataIndex: 'strtype_dictText',
  48. },
  49. {
  50. title: '是否开启监测',
  51. dataIndex: 'monitorflag_dictText',
  52. width: 100,
  53. },
  54. {
  55. title: '是否模拟数据',
  56. dataIndex: 'testflag_dictText',
  57. width: 100,
  58. },
  59. ];
  60. export const recycleColumns: BasicColumn[] = [
  61. {
  62. title: '名称',
  63. dataIndex: 'strname',
  64. width: 100,
  65. },
  66. {
  67. title: '是否为常闭型',
  68. dataIndex: 'bnormalclose',
  69. width: 100,
  70. },
  71. ];
  72. export const searchFormSchema: FormSchema[] = [
  73. {
  74. label: '名称',
  75. field: 'strname',
  76. component: 'Input',
  77. colProps: { span: 6 },
  78. },
  79. {
  80. label: '安装位置',
  81. field: 'strinstallpos',
  82. component: 'Input',
  83. colProps: { span: 6 },
  84. },
  85. {
  86. label: '是否为常闭型',
  87. field: 'bnormalclose',
  88. component: 'JDictSelectTag',
  89. componentProps: {
  90. dictCode: 'user_status',
  91. placeholder: '请选择读写类型',
  92. stringToNumber: true,
  93. },
  94. colProps: { span: 6 },
  95. },
  96. ];
  97. export const formSchema: FormSchema[] = [
  98. {
  99. label: '',
  100. field: 'id',
  101. component: 'Input',
  102. show: false,
  103. },
  104. {
  105. label: '名称',
  106. field: 'strname',
  107. component: 'Input',
  108. },
  109. {
  110. label: '安装位置',
  111. field: 'strinstallpos',
  112. component: 'Input',
  113. },
  114. {
  115. label: '设备类型',
  116. field: 'ndoortype',
  117. component: 'JDictSelectTag',
  118. componentProps: {
  119. dictCode: 'ndoortype',
  120. placeholder: '请选择状态',
  121. },
  122. },
  123. {
  124. label: '是否为常闭型',
  125. field: 'bnormalclose',
  126. component: 'RadioGroup',
  127. defaultValue: 1,
  128. componentProps: () => {
  129. return {
  130. options: [
  131. { label: '是', value: 1, key: '1' },
  132. { label: '否', value: 0, key: '2' },
  133. ],
  134. };
  135. },
  136. },
  137. {
  138. label: '净宽',
  139. field: 'fclearwidth',
  140. component: 'Input',
  141. },
  142. {
  143. label: '净高',
  144. field: 'fclearheight',
  145. component: 'Input',
  146. },
  147. {
  148. label: '风门道数',
  149. field: 'ndoorcount',
  150. component: 'Input',
  151. },
  152. {
  153. label: '所属分站',
  154. field: 'nsubstationid',
  155. component: 'ApiSelect',
  156. componentProps: {
  157. api: list,
  158. labelField: 'strname',
  159. valueField: 'nsubstationid',
  160. },
  161. },
  162. {
  163. label: '点表',
  164. field: 'strtype',
  165. component: 'JDictSelectTag',
  166. componentProps: {
  167. dictCode: 'gatekind',
  168. placeholder: '请选择状态',
  169. },
  170. },
  171. {
  172. label: '监测类型',
  173. field: 'monitorflag_dictText',
  174. component: 'JDictSelectTag',
  175. componentProps: {
  176. dictCode: 'monitorflag',
  177. placeholder: '请选择状态',
  178. },
  179. },
  180. {
  181. label: '是否模拟数据',
  182. field: 'testflag',
  183. component: 'RadioGroup',
  184. defaultValue: 1,
  185. componentProps: () => {
  186. return {
  187. options: [
  188. { label: '是', value: 1, key: '1' },
  189. { label: '否', value: 0, key: '2' },
  190. ],
  191. };
  192. },
  193. },
  194. ];
  195. export const formPasswordSchema: FormSchema[] = [
  196. {
  197. label: '用户账号',
  198. field: 'username',
  199. component: 'Input',
  200. componentProps: { readOnly: true },
  201. },
  202. {
  203. label: '登录密码',
  204. field: 'password',
  205. component: 'StrengthMeter',
  206. componentProps: {
  207. placeholder: '请输入登录密码',
  208. },
  209. rules: [
  210. {
  211. required: true,
  212. message: '请输入登录密码',
  213. },
  214. ],
  215. },
  216. {
  217. label: '确认密码',
  218. field: 'confirmPassword',
  219. component: 'InputPassword',
  220. dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  221. },
  222. ];
  223. export const formAgentSchema: FormSchema[] = [
  224. {
  225. label: '',
  226. field: 'id',
  227. component: 'Input',
  228. show: false,
  229. },
  230. {
  231. field: 'userName',
  232. label: '用户名',
  233. component: 'Input',
  234. componentProps: {
  235. readOnly: true,
  236. allowClear: false,
  237. },
  238. },
  239. {
  240. field: 'agentUserName',
  241. label: '代理人用户名',
  242. required: true,
  243. component: 'JSelectUser',
  244. componentProps: {
  245. rowKey: 'username',
  246. labelKey: 'realname',
  247. maxSelectCount: 10,
  248. },
  249. },
  250. {
  251. field: 'startTime',
  252. label: '代理开始时间',
  253. component: 'DatePicker',
  254. required: true,
  255. componentProps: {
  256. showTime: true,
  257. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  258. placeholder: '请选择代理开始时间',
  259. },
  260. },
  261. {
  262. field: 'endTime',
  263. label: '代理结束时间',
  264. component: 'DatePicker',
  265. required: true,
  266. componentProps: {
  267. showTime: true,
  268. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  269. placeholder: '请选择代理结束时间',
  270. },
  271. },
  272. {
  273. field: 'status',
  274. label: '状态',
  275. component: 'JDictSelectTag',
  276. defaultValue: '1',
  277. componentProps: {
  278. dictCode: 'valid_status',
  279. type: 'radioButton',
  280. },
  281. },
  282. ];