warning.data.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { initDictOptions } from '/@/utils/dict';
  3. import type { TableColumnType } from 'ant-design-vue';
  4. import { workFaceDeviceList } from './warning.api';
  5. export const levelColumns: BasicColumn[] = [
  6. {
  7. title: '下限',
  8. width: 100,
  9. editRow: true,
  10. dataIndex: 'fmin',
  11. editComponent: 'InputNumber',
  12. },
  13. {
  14. title: '上限',
  15. dataIndex: 'fmax',
  16. width: 100,
  17. editRow: true,
  18. editComponent: 'InputNumber',
  19. },
  20. {
  21. title: '持续时间(s)',
  22. dataIndex: 'timelength',
  23. editRow: true,
  24. width: 100,
  25. editComponent: 'InputNumber',
  26. },
  27. {
  28. title: '报警等级',
  29. dataIndex: 'leveltype',
  30. editRow: true,
  31. editRule: true,
  32. width: 100,
  33. editComponent: 'ApiSelect',
  34. editComponentProps: {
  35. api: initDictOptions.bind(null, 'leveltype'),
  36. labelField: 'label',
  37. valueField: 'value',
  38. },
  39. },
  40. {
  41. title: '报警描述',
  42. width: 180,
  43. editRow: true,
  44. dataIndex: 'des',
  45. editComponent: 'Input',
  46. },
  47. ];
  48. export const warningColumns: BasicColumn[] = [
  49. {
  50. title: '',
  51. dataIndex: 'id',
  52. ifShow: false,
  53. },
  54. {
  55. title: '监测参数',
  56. dataIndex: 'monitorcode',
  57. width: 150,
  58. editRow: true,
  59. editComponent: 'Input',
  60. editRule: async (text) => {
  61. if (!text) {
  62. return '请选择';
  63. }
  64. return '';
  65. },
  66. },
  67. {
  68. title: '模拟最小值',
  69. width: 150,
  70. dataIndex: 'ftestmin',
  71. editRow: true,
  72. editComponent: 'InputNumber',
  73. },
  74. {
  75. title: '模拟最大值',
  76. dataIndex: 'ftestmax',
  77. editRow: true,
  78. width: 150,
  79. editComponent: 'InputNumber',
  80. },
  81. {
  82. title: '备注',
  83. dataIndex: 'des',
  84. editRow: true,
  85. width: 200,
  86. editComponent: 'Input',
  87. },
  88. ];
  89. export const deviceColumns: BasicColumn[] = [
  90. {
  91. title: '名称',
  92. dataIndex: 'deviceName',
  93. align: 'center',
  94. width: 120,
  95. },
  96. {
  97. title: '安装位置',
  98. dataIndex: 'devicePos',
  99. align: 'center',
  100. width: 100,
  101. },
  102. {
  103. title: '设备类型',
  104. dataIndex: 'deviceType',
  105. align: 'center',
  106. width: 100,
  107. },
  108. {
  109. title: '所属分站',
  110. width: 150,
  111. align: 'center',
  112. dataIndex: 'subStationName',
  113. },
  114. ];
  115. export const workFaceColumns: BasicColumn[] = [
  116. {
  117. title: '安装位置',
  118. dataIndex: 'devicePos',
  119. width: 100,
  120. },
  121. {
  122. title: '排序',
  123. width: 100,
  124. dataIndex: 'sort',
  125. edit: true,
  126. editComponent: 'InputNumber',
  127. },
  128. {
  129. title: '是否在关键通风路线上',
  130. width: 100,
  131. dataIndex: 'pathflag',
  132. edit: true,
  133. editComponent: 'Switch',
  134. editValueMap: (value) => {
  135. return value ? '是' : '否';
  136. },
  137. },
  138. {
  139. title: '传感器类型',
  140. width: 100,
  141. dataIndex: 'sensorType',
  142. edit: true,
  143. editComponent: 'Select',
  144. editComponentProps: {
  145. options: [
  146. {
  147. label: '多参',
  148. value: '1',
  149. },
  150. {
  151. label: '测风',
  152. value: '2',
  153. },
  154. ],
  155. },
  156. },
  157. {
  158. title: '风向',
  159. width: 100,
  160. dataIndex: 'winddir',
  161. edit: true,
  162. editComponent: 'Select',
  163. editComponentProps: {
  164. options: [
  165. {
  166. label: '多参',
  167. value: '1',
  168. },
  169. {
  170. label: '测风',
  171. value: '2',
  172. },
  173. ],
  174. },
  175. },
  176. {
  177. title: '是否参与计算风量',
  178. width: 100,
  179. dataIndex: 'windflag',
  180. edit: true,
  181. editComponent: 'Switch',
  182. editValueMap: (value) => {
  183. return value ? '是' : '否';
  184. },
  185. },
  186. ];
  187. export const workFaceWarningColumns: BasicColumn[] = [
  188. {
  189. title: '报警条目',
  190. dataIndex: 'alarmName',
  191. align: 'center',
  192. },
  193. {
  194. title: '预警等级',
  195. dataIndex: 'alarmLevel',
  196. align: 'center',
  197. },
  198. {
  199. title: '创建人',
  200. dataIndex: 'createBy',
  201. align: 'center',
  202. },
  203. {
  204. title: '创建日期',
  205. dataIndex: 'createTime',
  206. align: 'center',
  207. },
  208. ];
  209. export const workFaceWarningFormSchemas: FormSchema[] = [
  210. {
  211. label: 'ID',
  212. field: 'id',
  213. component: 'Input',
  214. show: false,
  215. },
  216. {
  217. label: '预警名称',
  218. field: 'alarmName',
  219. component: 'Input',
  220. required: true,
  221. },
  222. {
  223. label: '预警等级',
  224. field: 'alarmLevel',
  225. component: 'JDictSelectTag',
  226. componentProps: { dictCode: 'leveltype' },
  227. },
  228. ];
  229. export const manageWarningPointColumns: BasicColumn[] = [
  230. {
  231. title: '设备名称',
  232. dataIndex: 'deviceName',
  233. align: 'center',
  234. },
  235. {
  236. title: '报警条目',
  237. dataIndex: 'alarmName',
  238. align: 'center',
  239. },
  240. {
  241. title: '报警下限',
  242. dataIndex: 'fmin',
  243. align: 'center',
  244. edit: true,
  245. editComponent: 'InputNumber',
  246. },
  247. {
  248. title: '报警上限',
  249. dataIndex: 'fmax',
  250. align: 'center',
  251. edit: true,
  252. editComponent: 'InputNumber',
  253. },
  254. {
  255. title: '报警持续时间(s)',
  256. dataIndex: 'cxTime',
  257. align: 'center',
  258. edit: true,
  259. editComponent: 'InputNumber',
  260. },
  261. {
  262. title: '更新人',
  263. dataIndex: 'updateBy',
  264. align: 'center',
  265. width: 100,
  266. },
  267. ];
  268. export const controlFormSchemas = (param) =>
  269. <FormSchema[]>[
  270. {
  271. label: 'ID',
  272. field: 'id',
  273. component: 'Input',
  274. show: false,
  275. },
  276. {
  277. label: '点表',
  278. field: 'strtype',
  279. component: 'Input',
  280. show: false,
  281. },
  282. {
  283. label: '设备名称',
  284. field: 'deviceId',
  285. component: 'ApiSelect',
  286. required: true,
  287. componentProps: ({ formModel }) => {
  288. return {
  289. api: workFaceDeviceList.bind(null, param),
  290. labelField: 'strname',
  291. valueField: 'id',
  292. onChange: (e, option) => {
  293. if (option) formModel['strtype'] = option['strtype'];
  294. },
  295. };
  296. },
  297. },
  298. {
  299. label: '点位',
  300. field: 'monitorId',
  301. component: 'Select',
  302. slot: 'monitor',
  303. required: true,
  304. },
  305. {
  306. label: '执行顺序',
  307. field: 'orderNum',
  308. component: 'InputNumber',
  309. },
  310. ];
  311. export const controlDevicePointColumns: BasicColumn[] = [
  312. {
  313. title: '报警条目',
  314. dataIndex: 'alarmName',
  315. align: 'center',
  316. },
  317. {
  318. title: '设备安装位置',
  319. dataIndex: 'devicePos',
  320. align: 'center',
  321. },
  322. {
  323. title: '控制点位描述',
  324. dataIndex: 'monitorName',
  325. align: 'center',
  326. },
  327. {
  328. title: '值',
  329. dataIndex: 'value',
  330. align: 'center',
  331. },
  332. // {
  333. // title: '审批状态',
  334. // dataIndex: 'bpmStatus',
  335. // align: 'center',
  336. // edit: true,
  337. // editComponent: 'Select',
  338. // editComponentProps: {
  339. // options: [
  340. // {
  341. // label: '审批',
  342. // value: '1',
  343. // },
  344. // {
  345. // label: '不审批',
  346. // value: '0',
  347. // },
  348. // ],
  349. // },
  350. // },
  351. {
  352. title: '执行顺序',
  353. dataIndex: 'orderNum',
  354. align: 'center',
  355. },
  356. {
  357. title: '更新人',
  358. dataIndex: 'updateBy',
  359. align: 'center',
  360. width: 100,
  361. },
  362. {
  363. title: '操作',
  364. dataIndex: 'operation',
  365. width: 100,
  366. },
  367. ];
  368. export const monitorWarningFormSchemas = (param) =>
  369. <FormSchema[]>[
  370. {
  371. label: 'ID',
  372. field: 'id',
  373. component: 'Input',
  374. show: false,
  375. },
  376. {
  377. label: '点表',
  378. field: 'strtype',
  379. component: 'Input',
  380. show: false,
  381. },
  382. {
  383. label: '设备名称',
  384. field: 'deviceId',
  385. component: 'ApiSelect',
  386. required: true,
  387. componentProps: ({ formModel }) => {
  388. return {
  389. api: workFaceDeviceList.bind(null, param),
  390. labelField: 'strname',
  391. valueField: 'id',
  392. onChange: (e, option) => {
  393. if (option) formModel['strtype'] = option['strtype'];
  394. },
  395. };
  396. },
  397. },
  398. {
  399. label: '且关系关联id',
  400. field: 'relId',
  401. component: 'Input',
  402. show: false,
  403. },
  404. {
  405. label: '点位',
  406. field: 'monitorId',
  407. component: 'Select',
  408. slot: 'monitor',
  409. required: true,
  410. },
  411. {
  412. label: '报警上限值',
  413. field: 'fmax',
  414. component: 'InputNumber',
  415. },
  416. {
  417. label: '报警下限值',
  418. field: 'fmin',
  419. component: 'InputNumber',
  420. },
  421. {
  422. label: '报警持续时间(s)',
  423. field: 'cxTime',
  424. component: 'InputNumber',
  425. },
  426. ];
  427. export const controlWarningFormSchemas: FormSchema[] = [
  428. {
  429. label: 'ID',
  430. field: 'id',
  431. component: 'Input',
  432. show: false,
  433. },
  434. {
  435. label: '设备名称',
  436. field: 'deviceName',
  437. component: 'Input',
  438. required: true,
  439. },
  440. {
  441. label: '控制点位描述',
  442. field: 'monitorName',
  443. component: 'Input',
  444. },
  445. {
  446. label: '值',
  447. field: 'value',
  448. component: 'Input',
  449. },
  450. {
  451. label: '执行顺序',
  452. field: 'orderNum',
  453. component: 'Input',
  454. },
  455. ];
  456. export const BackWindDevicePointColumns: BasicColumn[] = [
  457. {
  458. title: '设备名称',
  459. dataIndex: 'deviceName',
  460. align: 'center',
  461. },
  462. {
  463. title: '设备安装位置',
  464. dataIndex: 'devicePos',
  465. align: 'center',
  466. },
  467. {
  468. title: '控制点位描述',
  469. dataIndex: 'monitorName',
  470. align: 'center',
  471. },
  472. {
  473. title: '值',
  474. dataIndex: 'value',
  475. edit: true,
  476. editComponent: 'Input',
  477. align: 'center',
  478. },
  479. // {
  480. // title: '审批状态',
  481. // dataIndex: 'bpmStatus',
  482. // align: 'center',
  483. // edit: true,
  484. // editComponent: 'Select',
  485. // editComponentProps: {
  486. // options: [
  487. // {
  488. // label: '审批',
  489. // value: '1',
  490. // },
  491. // {
  492. // label: '不审批',
  493. // value: '0',
  494. // },
  495. // ],
  496. // },
  497. // },
  498. {
  499. title: '执行顺序',
  500. dataIndex: 'orderNum',
  501. align: 'center',
  502. edit: true,
  503. editComponent: 'InputNumber',
  504. },
  505. {
  506. title: '更新人',
  507. dataIndex: 'updateBy',
  508. align: 'center',
  509. width: 100,
  510. },
  511. ];
  512. export const rowOrColSpanMap = new Map();
  513. const sharedOnCell = (record, rowIndex, column) => {
  514. const arr = rowOrColSpanMap.get(record.id);
  515. if (arr) {
  516. const col = arr.find((item) => {
  517. return item.code === column.dataIndex;
  518. });
  519. if (col) return { rowSpan: col.rowSpan, colSpan: col.colSpan };
  520. }
  521. };
  522. export const MonitorColumns: TableColumnType[] = [
  523. {
  524. title: '组合',
  525. dataIndex: 'key',
  526. customCell: sharedOnCell,
  527. },
  528. {
  529. title: '预警名称',
  530. dataIndex: 'alarmName',
  531. customCell: sharedOnCell,
  532. },
  533. {
  534. title: '设备名称',
  535. dataIndex: 'deviceName',
  536. customCell: sharedOnCell,
  537. },
  538. {
  539. title: '监测点位',
  540. dataIndex: 'monitorName',
  541. customCell: sharedOnCell,
  542. },
  543. {
  544. title: '报警下限值',
  545. dataIndex: 'fmin',
  546. customCell: sharedOnCell,
  547. },
  548. {
  549. title: '报警上限值',
  550. dataIndex: 'fmax',
  551. customCell: sharedOnCell,
  552. },
  553. {
  554. title: '报警持续时间',
  555. dataIndex: 'cxTime',
  556. customCell: sharedOnCell,
  557. },
  558. {
  559. title: '操作',
  560. colSpan: 2,
  561. dataIndex: 'operation',
  562. width: 120,
  563. customCell: sharedOnCell,
  564. },
  565. {
  566. title: '操作',
  567. colSpan: 0,
  568. dataIndex: 'operation1',
  569. width: 80,
  570. customCell: sharedOnCell,
  571. },
  572. ];
  573. export const controlColumns: TableColumnType[] = [
  574. {
  575. title: '预警名称',
  576. dataIndex: 'alarmName',
  577. align: 'center',
  578. },
  579. {
  580. title: '设备名称',
  581. dataIndex: 'deviceName',
  582. align: 'center',
  583. },
  584. {
  585. title: '控制点位',
  586. dataIndex: 'monitorName',
  587. align: 'center',
  588. },
  589. {
  590. title: '执行顺序',
  591. dataIndex: 'orderNum',
  592. align: 'center',
  593. },
  594. {
  595. title: '操作',
  596. colSpan: 2,
  597. dataIndex: 'operation',
  598. width: 120,
  599. align: 'center',
  600. },
  601. ];
  602. export const testData = [
  603. {
  604. key: '1',
  605. name: '气源压力超限',
  606. age: 32,
  607. tel: '0571-22098909',
  608. phone: 18889898989,
  609. address: 'New York No. 1 Lake Park',
  610. rowSpan: 1,
  611. colSpan: 1,
  612. },
  613. {
  614. key: '2',
  615. name: '气源压力超限',
  616. tel: '0571-22098333',
  617. phone: 18889898888,
  618. age: 42,
  619. address: 'London No. 1 Lake Park',
  620. rowSpan: 1,
  621. colSpan: 1,
  622. },
  623. {
  624. key: '3',
  625. name: '气源压力超限',
  626. age: 32,
  627. tel: '0575-22098909',
  628. phone: 18900010002,
  629. address: 'Sidney No. 1 Lake Park',
  630. rowSpan: 1,
  631. colSpan: 1,
  632. },
  633. {
  634. key: '4',
  635. name: '气源压力超限',
  636. age: 18,
  637. tel: '0575-22098909',
  638. phone: 18900010002,
  639. address: 'London No. 2 Lake Park',
  640. rowSpan: 1,
  641. colSpan: 1,
  642. },
  643. {
  644. key: '5',
  645. name: '气源压力超限',
  646. age: 18,
  647. tel: '0575-22098909',
  648. phone: 18900010002,
  649. address: 'Dublin No. 2 Lake Park',
  650. rowSpan: 1,
  651. colSpan: 1,
  652. },
  653. ];
  654. export const testData1 = [
  655. {
  656. key: '1',
  657. alarmName: '气源压力超限',
  658. devicePos: 32,
  659. monitorName: '0571-22098909',
  660. value: 18889898989,
  661. orderNum: '1',
  662. updateBy: 'New York No. 1 Lake Park',
  663. },
  664. {
  665. key: '2',
  666. alarmName: '气源压力超限',
  667. devicePos: 42,
  668. monitorName: '0571-22098333',
  669. value: 18889898888,
  670. orderNum: '2',
  671. updateBy: 'London No. 1 Lake Park',
  672. },
  673. {
  674. key: '3',
  675. alarmName: '气源压力超限',
  676. devicePos: 32,
  677. monitorName: '0575-22098909',
  678. value: 18900010002,
  679. orderNum: '3',
  680. updateBy: 'Sidney No. 1 Lake Park',
  681. },
  682. {
  683. key: '4',
  684. alarmName: '气源压力超限',
  685. devicePos: 18,
  686. monitorName: '0575-22098909',
  687. value: 18900010002,
  688. orderNum: '4',
  689. updateBy: 'London No. 2 Lake Park',
  690. },
  691. {
  692. key: '5',
  693. alarmName: '气源压力超限',
  694. devicePos: 18,
  695. monitorName: '0575-22098909',
  696. value: 18900010002,
  697. orderNum: '5',
  698. updateBy: 'Dublin No. 2 Lake Park',
  699. },
  700. {
  701. key: '6',
  702. alarmName: '气源压力超限',
  703. devicePos: 18,
  704. monitorName: '0575-22098909',
  705. value: 18900010002,
  706. orderNum: '5',
  707. updateBy: 'Dublin No. 2 Lake Park',
  708. },
  709. ];