1
0

main.data.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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. },
  10. {
  11. title: '安装位置',
  12. dataIndex: 'strinstallpos',
  13. width: 100,
  14. },
  15. {
  16. title: '是否为常闭型',
  17. dataIndex: 'bnormalclose',
  18. width: 100,
  19. // customRender: render.renderAvatar,
  20. },
  21. {
  22. title: '净宽',
  23. dataIndex: 'fclearwidth',
  24. width: 80,
  25. },
  26. {
  27. title: '净高',
  28. dataIndex: 'fclearheight',
  29. width: 100,
  30. },
  31. {
  32. title: '风门道数',
  33. dataIndex: 'ndoorcount',
  34. width: 100,
  35. },
  36. {
  37. title: '所属分站',
  38. width: 150,
  39. dataIndex: 'stationname',
  40. },
  41. {
  42. title: '点表',
  43. width: 100,
  44. dataIndex: 'strtype',
  45. },
  46. {
  47. title: '监测类型',
  48. dataIndex: 'monitorflag',
  49. width: 100,
  50. },
  51. {
  52. title: '是否模拟数据',
  53. dataIndex: 'testflag',
  54. width: 100,
  55. },
  56. ];
  57. export const recycleColumns: BasicColumn[] = [
  58. {
  59. title: '名称',
  60. dataIndex: 'strname',
  61. width: 100,
  62. },
  63. {
  64. title: '是否为常闭型',
  65. dataIndex: 'bnormalclose',
  66. width: 100,
  67. },
  68. ];
  69. export const searchFormSchema: FormSchema[] = [
  70. {
  71. label: '名称',
  72. field: 'strname',
  73. component: 'Input',
  74. colProps: { span: 6 },
  75. },
  76. {
  77. label: '安装位置',
  78. field: 'strinstallpos',
  79. component: 'Input',
  80. colProps: { span: 6 },
  81. },
  82. {
  83. label: '是否为常闭型',
  84. field: 'bnormalclose',
  85. component: 'JDictSelectTag',
  86. componentProps: {
  87. dictCode: 'user_status',
  88. placeholder: '请选择读写类型',
  89. stringToNumber: true,
  90. },
  91. colProps: { span: 6 },
  92. },
  93. ];
  94. export const formSchema: FormSchema[] = [
  95. {
  96. label: '',
  97. field: 'id',
  98. component: 'Input',
  99. show: false,
  100. },
  101. {
  102. label: '名称',
  103. field: 'strname',
  104. component: 'Input',
  105. },
  106. {
  107. label: '安装位置',
  108. field: 'strinstallpos',
  109. component: 'Input',
  110. },
  111. {
  112. label: '是否为常闭型',
  113. field: 'bnormalclose',
  114. component: 'RadioGroup',
  115. defaultValue: 1,
  116. componentProps: () => {
  117. return {
  118. options: [
  119. { label: '是', value: 1, key: '1' },
  120. { label: '否', value: 0, key: '2' },
  121. ],
  122. };
  123. },
  124. },
  125. {
  126. label: '净宽',
  127. field: 'fclearwidth',
  128. component: 'Input',
  129. },
  130. {
  131. label: '净高',
  132. field: 'fclearheight',
  133. component: 'Input',
  134. },
  135. {
  136. label: '风门道数',
  137. field: 'ndoorcount',
  138. component: 'Input',
  139. },
  140. {
  141. label: '所属分站',
  142. field: 'stationname',
  143. component: 'JDictSelectTag',
  144. componentProps: {
  145. dictCode: 'user_status',
  146. placeholder: '请选择状态',
  147. stringToNumber: true,
  148. },
  149. },
  150. {
  151. label: '点表',
  152. field: 'strtype',
  153. component: 'JDictSelectTag',
  154. componentProps: {
  155. dictCode: 'user_status',
  156. placeholder: '请选择状态',
  157. stringToNumber: true,
  158. },
  159. },
  160. {
  161. label: '监测类型',
  162. field: 'monitorflag',
  163. component: 'JDictSelectTag',
  164. componentProps: {
  165. dictCode: 'user_status',
  166. placeholder: '请选择状态',
  167. stringToNumber: true,
  168. },
  169. },
  170. {
  171. label: '是否模拟数据',
  172. field: 'testflag',
  173. component: 'RadioGroup',
  174. defaultValue: 1,
  175. componentProps: () => {
  176. return {
  177. options: [
  178. { label: '是', value: 1, key: '1' },
  179. { label: '否', value: 0, key: '2' },
  180. ],
  181. };
  182. },
  183. },
  184. ];
  185. export const formPasswordSchema: FormSchema[] = [
  186. {
  187. label: '用户账号',
  188. field: 'username',
  189. component: 'Input',
  190. componentProps: { readOnly: true },
  191. },
  192. {
  193. label: '登录密码',
  194. field: 'password',
  195. component: 'StrengthMeter',
  196. componentProps: {
  197. placeholder: '请输入登录密码',
  198. },
  199. rules: [
  200. {
  201. required: true,
  202. message: '请输入登录密码',
  203. },
  204. ],
  205. },
  206. {
  207. label: '确认密码',
  208. field: 'confirmPassword',
  209. component: 'InputPassword',
  210. dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  211. },
  212. ];
  213. export const formAgentSchema: FormSchema[] = [
  214. {
  215. label: '',
  216. field: 'id',
  217. component: 'Input',
  218. show: false,
  219. },
  220. {
  221. field: 'userName',
  222. label: '用户名',
  223. component: 'Input',
  224. componentProps: {
  225. readOnly: true,
  226. allowClear: false,
  227. },
  228. },
  229. {
  230. field: 'agentUserName',
  231. label: '代理人用户名',
  232. required: true,
  233. component: 'JSelectUser',
  234. componentProps: {
  235. rowKey: 'username',
  236. labelKey: 'realname',
  237. maxSelectCount: 10,
  238. },
  239. },
  240. {
  241. field: 'startTime',
  242. label: '代理开始时间',
  243. component: 'DatePicker',
  244. required: true,
  245. componentProps: {
  246. showTime: true,
  247. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  248. placeholder: '请选择代理开始时间',
  249. },
  250. },
  251. {
  252. field: 'endTime',
  253. label: '代理结束时间',
  254. component: 'DatePicker',
  255. required: true,
  256. componentProps: {
  257. showTime: true,
  258. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  259. placeholder: '请选择代理结束时间',
  260. },
  261. },
  262. {
  263. field: 'status',
  264. label: '状态',
  265. component: 'JDictSelectTag',
  266. defaultValue: '1',
  267. componentProps: {
  268. dictCode: 'valid_status',
  269. type: 'radioButton',
  270. },
  271. },
  272. ];
  273. export const tableColumns = [
  274. {
  275. title: '',
  276. dataIndex: 'isCheck',
  277. customCell: (_, index) => {
  278. if (index % 2 == 0) {
  279. return { rowSpan: 2 };
  280. } else {
  281. return { rowSpan: 0 };
  282. }
  283. },
  284. },
  285. {
  286. title: '安装位置',
  287. dataIndex: 'address',
  288. customCell: (_, index) => {
  289. if (index % 2 == 0) {
  290. return { rowSpan: 2 };
  291. } else {
  292. return { rowSpan: 0 };
  293. }
  294. },
  295. },
  296. {
  297. title: '运行风机',
  298. dataIndex: 'childName',
  299. },
  300. {
  301. title: '风机静压(Pa)',
  302. dataIndex: 'yc2',
  303. },
  304. {
  305. title: '风机全压(Pa)',
  306. dataIndex: 'dqPa',
  307. },
  308. {
  309. title: '电机流量(m³/s)',
  310. dataIndex: 'fanM3',
  311. },
  312. {
  313. title: '电机速度(rpm/s)',
  314. dataIndex: 'fanSD',
  315. },
  316. {
  317. title: '电机电压(V)',
  318. dataIndex: 'fanU',
  319. },
  320. {
  321. title: '电机电流(A)',
  322. dataIndex: 'fanA',
  323. },
  324. {
  325. title: '电机频率(Hz/s)',
  326. dataIndex: 'fanPL',
  327. },
  328. {
  329. title: '电机功率(KW/s)',
  330. dataIndex: 'fanGL',
  331. },
  332. {
  333. title: '振动X1(mm/s)',
  334. dataIndex: 'zdX1',
  335. },
  336. {
  337. title: '振动Y1(mm/s)',
  338. dataIndex: 'zdY1',
  339. },
  340. ];
  341. export const dataColumns = () => {
  342. return [
  343. {
  344. id: 'UXC',
  345. name: '电机轴温设定(℃)',
  346. id2: 'bearingFront2_F1',
  347. },
  348. { id: 'VXC', name: '电机定温设定(℃)', id2: 'bearingBack2_F1' },
  349. {
  350. id: 'WXC',
  351. name: '电机前轴温度(℃)',
  352. id2: 'stator2A_F1',
  353. },
  354. {
  355. id: 'QZC',
  356. name: '电机后轴温度(℃)',
  357. id2: 'stator2B_F1',
  358. },
  359. { id: 'ZCZ1C', name: '电机定子1温度(℃)', id2: 'fIA2_F1' },
  360. { id: 'ZCZ2C', name: '电机定子2温度(℃)', id2: 'fIB2_F1' },
  361. { id: 'FTZ1C', name: '电机定3温度(℃)', id2: 'fIC2_F1' },
  362. ];
  363. };
  364. export const stateColumns = () => {
  365. return [
  366. // {
  367. // id: 'lubeBoxTemperatureF1High',
  368. // name: '润滑站油箱油温高报警',
  369. // flag: false,
  370. // },
  371. {
  372. id: 'lubeBoxTemperatureF1Low',
  373. name: '润滑站1油箱油温低报警',
  374. flag: true,
  375. },
  376. {
  377. id: 'lubeTemperatureF1High',
  378. name: '润滑站1供油油温高报警',
  379. flag: true,
  380. },
  381. // {
  382. // id: 'lubeTemperatureF1Low',
  383. // name: '润滑站1供油油温低报警',
  384. // flag: false,
  385. // },
  386. { id: 'lubePaF1High', name: '润滑站1供油油压高报警', flag: true },
  387. { id: 'lubePaF1Low', name: '润滑站1供油油压低报警', flag: true },
  388. // { id: "ch4_F1High", name: "瓦斯值1高报警", flag: false },
  389. { id: 'singleDoorF1Warn', name: '侧开风门单模报警', flag: true },
  390. { id: 'lubeF1SlightFault', name: '稀油润滑站轻故障', flag: true },
  391. { id: 'lubeF1SevereFault', name: '稀油润滑站重故障', flag: true },
  392. { id: 'f1B1Fault', name: '变频器1故障', flag: true },
  393. { id: 'f1B2Fault', name: '变频器2故障', flag: true },
  394. { id: 'f1Fault', name: '通风机故障', flag: true },
  395. ];
  396. };
  397. export const getData = () => {
  398. return [
  399. {
  400. id: 0,
  401. isCheck: true,
  402. address: '1号回风立井',
  403. strName: '1号回风立井主机',
  404. childName: '1#风机',
  405. isRun: false,
  406. frequency: 0,
  407. windVal: 0,
  408. gasVal1: 0,
  409. gasVal2: 0,
  410. zdX1: 0,
  411. zdX2: 0,
  412. zdY1: 0,
  413. zdY2: 0,
  414. yc1: 0,
  415. yc2: 0,
  416. dqPa: 0,
  417. co1: 0,
  418. fanSD: 0,
  419. fanA: 0,
  420. fanU: 0,
  421. fanPL: 0,
  422. fanGL: 0,
  423. fanM3: 0,
  424. WXC: 0,
  425. UXC: 0,
  426. VXC: 0,
  427. QZC: 0,
  428. HZC: 0,
  429. ZCZ1C: 0,
  430. ZCZ2C: 0,
  431. FTZ1C: 0,
  432. FTZ2C: 0,
  433. DJQZ1C: 0,
  434. C: 0,
  435. RH: 0,
  436. lubeBoxTemperatureF1High: undefined,
  437. lubeBoxTemperatureF1Low: undefined,
  438. lubeTemperatureF1High: undefined,
  439. lubeTemperatureF1Low: undefined,
  440. lubePaF1High: undefined,
  441. lubePaF1Low: undefined,
  442. singleDoorF1Warn: undefined,
  443. lubeF1SlightFault: undefined,
  444. lubeF1SevereFault: undefined,
  445. f1B1Fault: undefined,
  446. f1B2Fault: undefined,
  447. f1Fault: undefined,
  448. },
  449. {
  450. id: 1,
  451. isCheck: false,
  452. address: '1号回风立井',
  453. strName: '1号回风立井备机',
  454. childName: '2#风机',
  455. isRun: false,
  456. frequency: 0,
  457. windVal: 0,
  458. gasVal1: 0,
  459. gasVal2: 0,
  460. zdX1: 0,
  461. zdX2: 0,
  462. zdY1: 0,
  463. zdY2: 0,
  464. yc1: 0,
  465. yc2: 0,
  466. dqPa: 0,
  467. co1: 0,
  468. fanSD: 0,
  469. fanA: 0,
  470. fanU: 0,
  471. fanPL: 0,
  472. fanGL: 0,
  473. fanM3: 0,
  474. WXC: 0,
  475. UXC: 0,
  476. VXC: 0,
  477. QZC: 0,
  478. HZC: 0,
  479. ZCZ1C: 0,
  480. ZCZ2C: 0,
  481. FTZ1C: 0,
  482. FTZ2C: 0,
  483. DJQZ1C: 0,
  484. C: 0,
  485. RH: 0,
  486. lubeBoxTemperatureF1High: undefined,
  487. lubeBoxTemperatureF1Low: undefined,
  488. lubeTemperatureF1High: undefined,
  489. lubeTemperatureF1Low: undefined,
  490. lubePaF1High: undefined,
  491. lubePaF1Low: undefined,
  492. singleDoorF1Warn: undefined,
  493. lubeF1SlightFault: undefined,
  494. lubeF1SevereFault: undefined,
  495. f1B1Fault: undefined,
  496. f1B2Fault: undefined,
  497. f1Fault: undefined,
  498. },
  499. ];
  500. };
  501. export const getMonitorData: any = () => {
  502. return {
  503. id: 0,
  504. isCheck: true,
  505. address: '1号回风立井',
  506. strName: '1号回风立井主机',
  507. childName: '1#风机',
  508. isRun: false,
  509. frequency: 40,
  510. windVal: Math.round((Math.random() * 6 + 4) * 100) / 100,
  511. gasVal1: Math.round((Math.random() * 0.03 + 0) * 100) / 100,
  512. gasVal2: Math.round((Math.random() * 0.03 + 0) * 100) / 100,
  513. zdX1: Math.round((Math.random() + 1) * 100) / 100,
  514. zdX2: Math.round((Math.random() * 10 + 10) * 100) / 100,
  515. zdY1: Math.round((Math.random() + 1) * 100) / 100,
  516. zdY2: Math.round((Math.random() * 10 + 10) * 100) / 100,
  517. yc1: Math.round((Math.random() * 70 + 800) * 100) / 100,
  518. yc2: Math.round((Math.random() * 100 + 1400) * 100) / 100,
  519. dqPa: Math.round((Math.random() * 50 + 1000) * 100) / 100,
  520. co1: 0,
  521. fanSD: Math.round((Math.random() * 60 + 550) * 100) / 100,
  522. fanA: Math.round((Math.random() * 60 + 250) * 100) / 100,
  523. fanU: Math.round((Math.random() * 100 + 500) * 100) / 100,
  524. fanPL: Math.round((Math.random() * 10 + 40) * 100) / 100,
  525. fanGL: Math.round((Math.random() * 100 + 150) * 100) / 100,
  526. fanM3: Math.round((Math.random() * 26 + 200) * 100) / 100,
  527. WXC: Math.round((Math.random() * 26 + 10) * 100) / 100,
  528. UXC: Math.round((Math.random() * 26 + 10) * 100) / 100,
  529. VXC: Math.round((Math.random() * 26 + 10) * 100) / 100,
  530. QZC: Math.round((Math.random() * 26 + 10) * 100) / 100,
  531. HZC: Math.round((Math.random() * 26 + 10) * 100) / 100,
  532. ZCZ1C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  533. ZCZ2C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  534. FTZ1C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  535. FTZ2C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  536. DJQZ1C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  537. C: Math.round((Math.random() * 26 + 10) * 100) / 100,
  538. RH: Math.round((Math.random() * 26 + 14) * 100) / 100,
  539. lubeBoxTemperatureF1High: true,
  540. lubeBoxTemperatureF1Low: true,
  541. lubeTemperatureF1High: true,
  542. lubeTemperatureF1Low: true,
  543. lubePaF1High: true,
  544. lubePaF1Low: true,
  545. singleDoorF1Warn: true,
  546. lubeF1SlightFault: true,
  547. lubeF1SevereFault: true,
  548. f1B1Fault: true,
  549. f1B2Fault: true,
  550. f1Fault: true,
  551. };
  552. };