gate.data.ts 6.3 KB

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