Detail.js 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685
  1. import ModuleTitle from '@/components/ManagementPage/moduleTitle';
  2. import TabsContent from '@/components/TabsContent';
  3. import ThresholdDetail from '@/components/ThresholdDetail';
  4. import ThresholdModal from '@/components/ThresholdDetail/ThresholdModal';
  5. import { changeRecordStatus, getDumuDetail } from '@/services/eqSelfInspection';
  6. import { UnityAction } from '@/utils/utils';
  7. import { connect, useRequest } from '@umijs/max';
  8. import {
  9. Col,
  10. DatePicker,
  11. Form,
  12. Input,
  13. Modal,
  14. Row,
  15. Select,
  16. Spin,
  17. Table,
  18. message,
  19. } from 'antd';
  20. import dayjs from 'dayjs';
  21. import { useEffect, useMemo, useState } from 'react';
  22. import ReactZmage from 'react-zmage';
  23. import styles from './PatrolReportDetail.less';
  24. function Detail(props) {
  25. const { data, userList, projectId, dispatch, loading = false } = props;
  26. const [select, setSelect] = useState();
  27. const [dumuList, setDumuList] = useState([]);
  28. const sendMessageToUnity = (select, data) => {
  29. setSelect(select);
  30. if (window.HightlightEquipment) {
  31. window.HightlightEquipment(data);
  32. }
  33. };
  34. const { run: detailRun } = useRequest(getDumuDetail, {
  35. manual: true,
  36. fetchKey: (id) => id,
  37. onSuccess: (data) => {
  38. var item = dumuList?.find((child) => child.id === data.id);
  39. if (item) {
  40. item.url = base64ToImageUrl(data.event_bg);
  41. }
  42. setDumuList([...dumuList]);
  43. },
  44. });
  45. const result = useMemo(() => {
  46. var resultArr = [];
  47. var tempResult = data?.PatrolResult;
  48. var tempArr = tempResult?.split(';');
  49. const getTextColor = (status) => {
  50. switch (status) {
  51. case '警告':
  52. return {
  53. color: '#FFE26D',
  54. className: styles.warn,
  55. };
  56. case '异常':
  57. return {
  58. color: '#FE5850',
  59. className: styles.error,
  60. };
  61. default:
  62. return {
  63. color: '#12CEB3',
  64. className: '',
  65. };
  66. }
  67. };
  68. if (tempArr?.length > 0) {
  69. tempArr?.forEach((item, index) => {
  70. var tempItem = item;
  71. var itemSplit = tempItem.split(':');
  72. if (itemSplit?.length > 1) {
  73. var label = '';
  74. var value = itemSplit[1];
  75. if (index === 0) label = '设备自检';
  76. else if (index === 1) label = '工艺自检';
  77. else {
  78. label = '安全隐患';
  79. value = data?.secureStatus === 0 ? '正常' : '异常';
  80. }
  81. resultArr.push({
  82. ...getTextColor(value),
  83. label,
  84. value,
  85. });
  86. }
  87. });
  88. }
  89. return resultArr;
  90. }, [data]);
  91. useEffect(() => {
  92. dispatch({
  93. type: 'eqSelfInspection/fetchUserList',
  94. payload: {
  95. projectId,
  96. },
  97. });
  98. }, []);
  99. useEffect(() => {
  100. setDumuList(data?.dumuList);
  101. data?.dumuList?.map((item) => {
  102. detailRun(item.id);
  103. });
  104. }, [data?.dumuList]);
  105. return (
  106. <Spin spinning={loading}>
  107. <div className={styles.card}>
  108. <Row>
  109. <Col span={24} className={styles.cardText}>
  110. 自检时间:{data?.CreatedTime}
  111. </Col>
  112. </Row>
  113. <Row>
  114. <Col span={12} className={styles.cardText}>
  115. 自检路线:{data?.RouteInfo?.Name}
  116. </Col>
  117. <Col span={12} className={styles.cardText}>
  118. 工艺段:{data?.RouteInfo?.GroupID}
  119. </Col>
  120. </Row>
  121. <Row>
  122. {result?.map((item) => {
  123. return (
  124. <Col span={8} className={styles.cardText}>
  125. <div className={styles.statusBox}>
  126. <div className={`${styles.orderIcon} ${item.className}`}>
  127. {item.value}
  128. </div>
  129. {item?.label}
  130. </div>
  131. </Col>
  132. );
  133. })}
  134. </Row>
  135. </div>
  136. <div>
  137. <ModuleTitle title="设备自检" />
  138. {/* 设备自检报告 */}
  139. <ReportCom
  140. sendMessageToUnity={sendMessageToUnity}
  141. select={select}
  142. waringData={data?.extendWarningData}
  143. allData={data?.extendWarningAllData}
  144. key="extend"
  145. type={'extend'}
  146. userList={userList}
  147. title={'设备自检报告'}
  148. ></ReportCom>
  149. {/* 液位异常 */}
  150. <LiquidLevelCom
  151. sendMessageToUnity={sendMessageToUnity}
  152. select={select}
  153. allData={data?.FluidLevelList}
  154. key="liquid"
  155. type={'liquid'}
  156. userList={userList}
  157. title="液位异常"
  158. />
  159. {/* 加药流量校验 */}
  160. <DosingFlowCom
  161. sendMessageToUnity={sendMessageToUnity}
  162. select={select}
  163. allData={data?.FluidLevelList}
  164. title="加药流量校验"
  165. />
  166. <WaterInCom
  167. sendMessageToUnity={sendMessageToUnity}
  168. select={select}
  169. allData={data?.WaterInCheckList}
  170. title="进出水流量校验"
  171. />
  172. <PressureGaugeCom
  173. sendMessageToUnity={sendMessageToUnity}
  174. select={select}
  175. allData={data?.PressureCompareList}
  176. title="压力仪表校验"
  177. />
  178. <WaterQualityCom
  179. sendMessageToUnity={sendMessageToUnity}
  180. select={select}
  181. allData={data?.WaterQualityCompareList}
  182. title="水质仪表校验"
  183. />
  184. {/* 工艺自检报告"> */}
  185. <div className={styles.content}>
  186. <div className={styles.tableStatus}>
  187. 异常({data?.FaultAnalysis?.length || 0})
  188. </div>
  189. <ModuleTitle title="工艺自检报告" />
  190. <AalysisTable
  191. onClickItem={sendMessageToUnity}
  192. select={select}
  193. data={data}
  194. />
  195. </div>
  196. {/* 安全隐患自检报告"> */}
  197. <div className={styles.content}>
  198. <ModuleTitle title="安全隐患自检报告" />
  199. {/* 环境异常 */}
  200. <ReportCom
  201. sendMessageToUnity={sendMessageToUnity}
  202. select={select}
  203. waringData={data?.sensorWaringData}
  204. allData={data?.sensor}
  205. data={data?.sensorWaringData}
  206. key="sensor"
  207. type={'sensor'}
  208. userList={userList}
  209. title={'环境异常'}
  210. ></ReportCom>
  211. {/* 液位异常 */}
  212. {/* <LiquidLevelCom
  213. sendMessageToUnity={sendMessageToUnity}
  214. select={select}
  215. allData={data?.FluidLevelList}
  216. key="liquid"
  217. type={'liquid'}
  218. userList={userList}
  219. title={<ModuleTitle title="液位异常" />}
  220. /> */}
  221. {/* 安防检测异常 */}
  222. <ReportDumCom data={dumuList} title={'安防检测异常'} />
  223. {/* 电器检测异常 */}
  224. <ReportCom
  225. sendMessageToUnity={sendMessageToUnity}
  226. select={select}
  227. waringData={[]}
  228. allData={[]}
  229. key="extend"
  230. type={'extend'}
  231. userList={userList}
  232. title={'电气检测异常'}
  233. ></ReportCom>
  234. {/* 密闭空间检测异常 */}
  235. <ReportCom
  236. sendMessageToUnity={sendMessageToUnity}
  237. select={select}
  238. waringData={[]}
  239. allData={[]}
  240. key="extend"
  241. type={'extend'}
  242. userList={userList}
  243. title={'密闭空间检测异常'}
  244. ></ReportCom>
  245. </div>
  246. </div>
  247. {/* </Card> */}
  248. </Spin>
  249. );
  250. }
  251. export function DeviceTable(props) {
  252. const {
  253. onClickItem,
  254. data = {},
  255. items,
  256. onErrorHandle,
  257. select,
  258. userList,
  259. type,
  260. } = props;
  261. const { ProjectId, Id } = data;
  262. const [loading, setLoading] = useState(false);
  263. const [visible, setVisible] = useState(false);
  264. const [errVisible, setErrVisible] = useState(false);
  265. const [currentItem, setCurrentItem] = useState({});
  266. const isSensor = type == 'sensor';
  267. const onClickThreshold = (record) => {
  268. setCurrentItem(record);
  269. setVisible(true);
  270. };
  271. const onClickError = (record) => {
  272. setCurrentItem(record);
  273. setErrVisible(true);
  274. };
  275. const handleError = async (values) => {
  276. setLoading(true);
  277. var res = await changeRecordStatus({
  278. ...values,
  279. Id: currentItem.Id,
  280. DeviceCode: currentItem.DeviceCode,
  281. DeviceName: currentItem.DeviceName,
  282. RecordId: data.Id,
  283. RepairMan: values.RepairMan * 1,
  284. });
  285. setLoading(false);
  286. if (res) {
  287. message.success('操作成功');
  288. setErrVisible(false);
  289. }
  290. };
  291. const columns = [
  292. {
  293. title: '设备名称',
  294. width: '20%',
  295. dataIndex: 'DeviceName',
  296. },
  297. {
  298. title: '巡检项',
  299. width: '20%',
  300. dataIndex: 'TemplateItem.Name',
  301. },
  302. // {
  303. // title: '设备位号',
  304. // width: '16%',
  305. // dataIndex: 'DeviceCode',
  306. // },
  307. {
  308. title: '设定值范围',
  309. width: '30%',
  310. render: (record) => (
  311. <ThresholdDetail
  312. current={record.Value || 0}
  313. data={record || {}}
  314. // onClick={() => onClickThreshold(record)}
  315. />
  316. ),
  317. },
  318. {
  319. title: '状态',
  320. dataIndex: 'Status',
  321. render: (Status) => {
  322. switch (Status) {
  323. case -1:
  324. case 0:
  325. return (
  326. <div>
  327. <i
  328. className={styles.iconStatus}
  329. style={{ background: '#12CEB3' }}
  330. ></i>
  331. 正常
  332. </div>
  333. );
  334. case 1:
  335. return (
  336. <div>
  337. <i
  338. className={styles.iconStatus}
  339. style={{ background: '#FE5850' }}
  340. ></i>
  341. 异常
  342. </div>
  343. );
  344. case 2:
  345. return (
  346. <div>
  347. <i
  348. className={styles.iconStatus}
  349. style={{ background: '#FFE26D' }}
  350. ></i>
  351. 警告
  352. </div>
  353. );
  354. }
  355. },
  356. },
  357. ];
  358. const handleClickItem = (data) => {
  359. if (!isSensor) {
  360. onClickItem(`DeviceTable-${data.Id}`, {
  361. type: data.Status,
  362. deviceCode: data.DeviceCode,
  363. });
  364. } else {
  365. onClickItem(`DeviceTable-${data.Id}`, {
  366. // type: data.Status,
  367. deviceCode: data.DeviceCode,
  368. value: Number(data.Value || 0),
  369. threshold: data.JsonNumThreshold,
  370. });
  371. UnityAction.sendMsg('SinglePowerEnvironFromWeb', JSON.stringify(data));
  372. }
  373. };
  374. useEffect(() => {
  375. console.log('温控', items);
  376. if (isSensor)
  377. UnityAction.sendMsg('PowerEnvironsFromWeb', JSON.stringify(items));
  378. }, [items]);
  379. if (!isSensor) {
  380. columns.push({
  381. title: '操作',
  382. render: (record) =>
  383. record.Status == 1 && (
  384. <a style={{ color: '#FE5850' }} onClick={() => onClickError(record)}>
  385. 异常处理
  386. </a>
  387. ),
  388. });
  389. }
  390. return (
  391. <div>
  392. <Table
  393. columns={columns}
  394. dataSource={items}
  395. rowKey="Id"
  396. locale={{
  397. emptyText: <Empty />,
  398. }}
  399. pagination={false}
  400. />
  401. <ThresholdModal
  402. open={visible}
  403. data={currentItem.JsonNumThreshold}
  404. onClose={() => setVisible(false)}
  405. />
  406. <ErrorHandleModal
  407. open={errVisible}
  408. userList={userList}
  409. onCancel={() => setErrVisible(false)}
  410. onOk={handleError}
  411. />
  412. </div>
  413. );
  414. }
  415. function AalysisTable(props) {
  416. const { onClickItem, data = {}, select } = props;
  417. const { FaultAnalysis } = data;
  418. const columns = [
  419. {
  420. title: '异常名称',
  421. width: '18%',
  422. dataIndex: 'device_name',
  423. },
  424. // {
  425. // title: '位号',
  426. // width: '15%',
  427. // dataIndex: 'device_code',
  428. // },
  429. {
  430. title: '可能原因',
  431. width: '30%',
  432. render: (record) => record.reason,
  433. },
  434. {
  435. title: '解决方案',
  436. width: '52%',
  437. render: (record) => {
  438. if (record.fix_plan instanceof Array) {
  439. return (
  440. <div>
  441. {record.fix_plan.map((item) => (
  442. <div>
  443. {item.content}
  444. <br />
  445. </div>
  446. ))}
  447. </div>
  448. );
  449. } else {
  450. return record.fix_plan;
  451. }
  452. },
  453. },
  454. ];
  455. return (
  456. <div>
  457. <Table
  458. columns={columns}
  459. dataSource={FaultAnalysis}
  460. rowKey="device_code"
  461. locale={{
  462. emptyText: <Empty />,
  463. }}
  464. pagination={false}
  465. />
  466. </div>
  467. );
  468. }
  469. function ErrorHandleModal(props) {
  470. const { visible, onCancel, onOk, userList } = props;
  471. const [form] = Form.useForm();
  472. const status = form.getFieldValue('Status');
  473. const handleOk = () => {
  474. form.validateFields((error, values) => {
  475. if (error) return;
  476. onOk({
  477. ...values,
  478. PlanTime: values?.PlanTime?.format('YYYY-MM-DD HH:mm:ss'),
  479. });
  480. });
  481. };
  482. return (
  483. <Modal
  484. title="异常处理"
  485. open={visible}
  486. onCancel={onCancel}
  487. onOk={handleOk}
  488. destroyOnClose
  489. >
  490. <Form labelCol={{ span: 7 }} wrapperCol={{ span: 16 }}>
  491. <Form.Item label="异常处理备注" name="ExceptionHandling">
  492. <Input.TextArea />
  493. </Form.Item>
  494. <Form.Item
  495. label="审核状态"
  496. name="Status"
  497. rules={[{ required: true, message: '请选择验收状态' }]}
  498. >
  499. <Select style={{ width: '100%' }} placeholder="请选择验收状态">
  500. <Select.Option value={1}>已派遣</Select.Option>
  501. <Select.Option value={2}>已通过</Select.Option>
  502. </Select>
  503. </Form.Item>
  504. <Form.Item
  505. label="维修人"
  506. name="RepairMan"
  507. rules={[{ required: true, message: '请选择维修人' }]}
  508. >
  509. <Select
  510. showSearch
  511. placeholder="请选择维修人"
  512. filterOption={(input, option) =>
  513. option.props.children.indexOf(input) >= 0
  514. }
  515. style={{ width: '100%' }}
  516. >
  517. {userList?.map((item) => (
  518. <Select.Option key={item.ID}>{item.CName}</Select.Option>
  519. ))}
  520. </Select>
  521. </Form.Item>
  522. {status == 1 && (
  523. <>
  524. <Form.Item
  525. label="难度级别"
  526. name="DifficultyLevel"
  527. rules={[{ required: true, message: '请选择难度级别' }]}
  528. >
  529. <Select placeholder="请选择难度级别" style={{ width: '100%' }}>
  530. <Select.Option value={0}>大修</Select.Option>
  531. <Select.Option value={1}>项目维修</Select.Option>
  532. <Select.Option value={2}>小修</Select.Option>
  533. </Select>
  534. </Form.Item>
  535. <Form.Item
  536. label="维修方式"
  537. name="RepairType"
  538. rules={[{ required: true, message: '请选择维修方式' }]}
  539. >
  540. <Select placeholder="请选择维修方式" style={{ width: '100%' }}>
  541. <Select.Option value={0}>自维</Select.Option>
  542. <Select.Option value={1}>外委</Select.Option>
  543. </Select>
  544. </Form.Item>
  545. <Form.Item
  546. label="计划完成日期"
  547. name="PlanTime"
  548. rules={[{ required: true, message: '请选择计划完成日期' }]}
  549. >
  550. <DatePicker inputReadOnly />
  551. </Form.Item>
  552. </>
  553. )}
  554. </Form>
  555. </Modal>
  556. );
  557. }
  558. export function WarningTable(props) {
  559. const {
  560. onClickItem,
  561. data = {},
  562. onErrorHandle,
  563. select,
  564. userList,
  565. type,
  566. items,
  567. } = props;
  568. const { ProjectId, Id } = data;
  569. const [loading, setLoading] = useState(false);
  570. const [visible, setVisible] = useState(false);
  571. const [errVisible, setErrVisible] = useState(false);
  572. const [currentItem, setCurrentItem] = useState({});
  573. const isSensor = type == 'sensor';
  574. const onClickThreshold = (record) => {
  575. setCurrentItem(record);
  576. setVisible(true);
  577. };
  578. const onClickError = (record) => {
  579. setCurrentItem(record);
  580. setErrVisible(true);
  581. };
  582. const handleError = async (values) => {
  583. setLoading(true);
  584. var res = await changeRecordStatus({
  585. ...values,
  586. Id: currentItem.Id,
  587. DeviceCode: currentItem.DeviceCode,
  588. DeviceName: currentItem.DeviceName,
  589. RecordId: data.Id,
  590. RepairMan: values.RepairMan * 1,
  591. });
  592. setLoading(false);
  593. if (res) {
  594. message.success('操作成功');
  595. setErrVisible(false);
  596. }
  597. };
  598. const columns = [
  599. {
  600. title: '设备名称',
  601. width: '20%',
  602. dataIndex: 'DeviceName',
  603. },
  604. {
  605. title: '巡检项',
  606. dataIndex: 'TemplateItem.Name',
  607. },
  608. // {
  609. // title: '设备位号',
  610. // width: '16%',
  611. // dataIndex: 'DeviceCode',
  612. // },
  613. {
  614. title: '设定值范围',
  615. width: '30%',
  616. render: (record) => (
  617. <ThresholdDetail
  618. current={record.Value || 0}
  619. data={record || {}}
  620. // onClick={() => onClickThreshold(record)}
  621. />
  622. ),
  623. },
  624. {
  625. title: '状态',
  626. dataIndex: 'Status',
  627. render: (Status) => {
  628. switch (Status) {
  629. case -1:
  630. case 0:
  631. return (
  632. <div>
  633. <i
  634. className={styles.iconStatus}
  635. style={{ background: '#12CEB3' }}
  636. ></i>
  637. 正常
  638. </div>
  639. );
  640. case 1:
  641. return (
  642. <div>
  643. <i
  644. className={styles.iconStatus}
  645. style={{ background: '#FE5850' }}
  646. ></i>
  647. 异常
  648. </div>
  649. );
  650. case 2:
  651. return (
  652. <div>
  653. <i
  654. className={styles.iconStatus}
  655. style={{ background: '#FFE26D' }}
  656. ></i>
  657. 警告
  658. </div>
  659. );
  660. }
  661. },
  662. },
  663. ];
  664. const handleClickItem = (data) => {
  665. if (!isSensor) {
  666. onClickItem(`DeviceTable-${data.Id}`, {
  667. type: data.Status,
  668. deviceCode: data.DeviceCode,
  669. });
  670. } else {
  671. onClickItem(`DeviceTable-${data.Id}`, {
  672. // type: data.Status,
  673. deviceCode: data.DeviceCode,
  674. value: Number(data.Value || 0),
  675. threshold: data.JsonNumThreshold,
  676. });
  677. UnityAction.sendMsg('SinglePowerEnvironFromWeb', JSON.stringify(data));
  678. }
  679. };
  680. if (!isSensor) {
  681. columns.push({
  682. title: '操作',
  683. render: (record) =>
  684. record.Status == 1 && (
  685. <a style={{ color: '#FE5850' }} onClick={() => onClickError(record)}>
  686. 异常处理
  687. </a>
  688. ),
  689. });
  690. }
  691. useEffect(() => {
  692. if (isSensor)
  693. UnityAction.sendMsg('PowerEnvironsFromWeb', JSON.stringify(items));
  694. }, [items]);
  695. return (
  696. <div>
  697. <Table
  698. columns={columns}
  699. dataSource={items}
  700. rowKey="Id"
  701. locale={{
  702. emptyText: <Empty />,
  703. }}
  704. pagination={false}
  705. />
  706. <ThresholdModal
  707. open={visible}
  708. data={currentItem.JsonNumThreshold}
  709. onClose={() => setVisible(false)}
  710. />
  711. <ErrorHandleModal
  712. open={errVisible}
  713. userList={userList}
  714. onCancel={() => setErrVisible(false)}
  715. onOk={handleError}
  716. />
  717. </div>
  718. );
  719. }
  720. function ReportCom(props) {
  721. const {
  722. sendMessageToUnity,
  723. select,
  724. waringData = [],
  725. allData = [],
  726. userList,
  727. type,
  728. title,
  729. data,
  730. } = props;
  731. const [activeKey, setActiveKey] = useState('1');
  732. const handleTabsChange = (activeKey) => {
  733. setActiveKey(activeKey);
  734. };
  735. return (
  736. <div className={styles.detailCard}>
  737. <div className={styles.tableTop}>
  738. {title}
  739. <TabsContent
  740. defaultActiveKey="1"
  741. onChange={handleTabsChange}
  742. small={true}
  743. items={[
  744. {
  745. key: '1',
  746. label: `异常/警告(${waringData.length || 0})`,
  747. children: <div></div>,
  748. },
  749. {
  750. key: '2',
  751. label: `全部(${allData.length || 0})`,
  752. children: <div></div>,
  753. },
  754. ]}
  755. ></TabsContent>
  756. </div>
  757. {activeKey == '1' && (
  758. <WarningTable
  759. onClickItem={sendMessageToUnity}
  760. select={select}
  761. items={waringData}
  762. key={type}
  763. data={data}
  764. type={type}
  765. userList={userList}
  766. />
  767. )}
  768. {activeKey == '2' && (
  769. <DeviceTable
  770. onClickItem={sendMessageToUnity}
  771. select={select}
  772. items={allData}
  773. data={data}
  774. key={type}
  775. type={type}
  776. userList={userList}
  777. />
  778. )}
  779. </div>
  780. );
  781. }
  782. export function LiquidTable(props) {
  783. const { onClickItem, data = {}, items, select, type } = props;
  784. const { ProjectId, Id } = data;
  785. const [loading, setLoading] = useState(false);
  786. const [currentItem, setCurrentItem] = useState({});
  787. const columns = [
  788. {
  789. title: '设备名称',
  790. width: '20%',
  791. dataIndex: 'device_name',
  792. },
  793. {
  794. title: '类型',
  795. key: 'template_item_name',
  796. dataIndex: 'template_item_name',
  797. },
  798. {
  799. title: '液位数',
  800. width: '20%',
  801. dataIndex: 'origin_value',
  802. },
  803. {
  804. title: '差值',
  805. width: '16%',
  806. dataIndex: 'value',
  807. },
  808. {
  809. title: '设定值范围',
  810. width: '25%',
  811. render: (record) => (
  812. <ThresholdDetail
  813. current={record.value || 0}
  814. data={{
  815. JsonNumThreshold: record?.json_num_threshold,
  816. Type: record.type || 2,
  817. }}
  818. />
  819. ),
  820. },
  821. {
  822. title: '状态',
  823. dataIndex: 'status',
  824. render: (status) => {
  825. switch (status) {
  826. case -1:
  827. case 0:
  828. return (
  829. <div>
  830. <i
  831. className={styles.iconStatus}
  832. style={{ background: '#12CEB3' }}
  833. ></i>
  834. 正常
  835. </div>
  836. );
  837. case 1:
  838. return (
  839. <div>
  840. <i
  841. className={styles.iconStatus}
  842. style={{ background: '#FFE26D' }}
  843. ></i>
  844. 异常
  845. </div>
  846. );
  847. case 2:
  848. return (
  849. <div>
  850. <i
  851. className={styles.iconStatus}
  852. style={{ background: '#FFE26D' }}
  853. ></i>
  854. 警告
  855. </div>
  856. );
  857. }
  858. },
  859. },
  860. ];
  861. const handleClickItem = (data) => {
  862. onClickItem(`DeviceTable-${data.device_code}`, {
  863. type: data.status,
  864. deviceCode: data.device_code,
  865. });
  866. };
  867. return (
  868. <Table
  869. columns={columns}
  870. dataSource={items}
  871. rowKey="device_code"
  872. locale={{
  873. emptyText: <Empty />,
  874. }}
  875. pagination={false}
  876. />
  877. );
  878. }
  879. function LiquidLevelCom(props) {
  880. const { sendMessageToUnity, select, allData = [], type, title } = props;
  881. const [activeKey, setActiveKey] = useState('1');
  882. const errorData = useMemo(() => {
  883. const errorData = allData?.filter((item) => item.status);
  884. return errorData;
  885. }, [allData]);
  886. const handleTabsChange = (activeKey) => {
  887. setActiveKey(activeKey);
  888. };
  889. return (
  890. <div className={styles.detailCard}>
  891. <div className={styles.tableTop}>
  892. {title}
  893. <TabsContent
  894. defaultActiveKey="1"
  895. onChange={handleTabsChange}
  896. small
  897. items={[
  898. {
  899. key: '1',
  900. label: `异常/警告(${errorData?.length || 0})`,
  901. children: <div></div>,
  902. },
  903. {
  904. key: '2',
  905. label: `全部(${allData?.length || 0})`,
  906. children: <div></div>,
  907. },
  908. ]}
  909. ></TabsContent>
  910. </div>
  911. {activeKey == '1' && (
  912. <LiquidTable
  913. onClickItem={sendMessageToUnity}
  914. select={select}
  915. items={errorData}
  916. key={type}
  917. type={type}
  918. />
  919. )}
  920. {activeKey == '2' && (
  921. <LiquidTable
  922. onClickItem={sendMessageToUnity}
  923. select={select}
  924. items={allData}
  925. key={type}
  926. type={type}
  927. />
  928. )}
  929. </div>
  930. );
  931. }
  932. function DosingFlowTable(props) {
  933. const { onClickItem, data = {}, items } = props;
  934. const columns = [
  935. {
  936. title: '设备名称',
  937. width: '1.5rem',
  938. dataIndex: 'device_name',
  939. },
  940. {
  941. title: '类型',
  942. key: 'template_item_name',
  943. dataIndex: 'template_item_name',
  944. },
  945. {
  946. title: '实际流量',
  947. dataIndex: 'origin_value',
  948. },
  949. {
  950. title: '计量流量',
  951. dataIndex: 'value',
  952. },
  953. {
  954. title: '差值/比值',
  955. dataIndex: 'value',
  956. },
  957. {
  958. title: '设定值范围',
  959. width: '20%',
  960. render: (record) => (
  961. <ThresholdDetail
  962. current={record.value || 0}
  963. data={{
  964. JsonNumThreshold: record?.json_num_threshold,
  965. Type: record.type || 2,
  966. }}
  967. />
  968. ),
  969. },
  970. {
  971. title: '状态',
  972. dataIndex: 'status',
  973. width: '1.25rem',
  974. render: (status) => {
  975. switch (status) {
  976. case -1:
  977. case 0:
  978. return (
  979. <div>
  980. <i
  981. className={styles.iconStatus}
  982. style={{ background: '#12CEB3' }}
  983. />
  984. 正常
  985. </div>
  986. );
  987. case 1:
  988. return (
  989. <div>
  990. <i
  991. className={styles.iconStatus}
  992. style={{ background: '#FF8600' }}
  993. />
  994. 异常
  995. </div>
  996. );
  997. case 2:
  998. return (
  999. <div>
  1000. <i
  1001. className={styles.iconStatus}
  1002. style={{ background: '#FFE26D' }}
  1003. />
  1004. 警告
  1005. </div>
  1006. );
  1007. default:
  1008. return null;
  1009. }
  1010. },
  1011. },
  1012. ];
  1013. const handleClickItem = (data) => {
  1014. onClickItem(`DeviceTable-${data.device_code}`, {
  1015. type: data.status,
  1016. deviceCode: data.device_code,
  1017. });
  1018. };
  1019. return (
  1020. <Table
  1021. columns={columns}
  1022. dataSource={items}
  1023. rowKey="device_code"
  1024. locale={{
  1025. emptyText: <Empty />,
  1026. }}
  1027. pagination={false}
  1028. />
  1029. );
  1030. }
  1031. function DosingFlowCom(props) {
  1032. const { sendMessageToUnity, select, allData = [], type, title } = props;
  1033. const [activeKey, setActiveKey] = useState('1');
  1034. const errorData = useMemo(() => {
  1035. const errorData = allData?.filter((item) => item.status);
  1036. return errorData;
  1037. }, [allData]);
  1038. const handleTabsChange = (key) => {
  1039. setActiveKey(key);
  1040. };
  1041. return (
  1042. <div className={styles.detailCard}>
  1043. <div className={styles.tableTop}>
  1044. {title}
  1045. <TabsContent
  1046. defaultActiveKey="1"
  1047. onChange={handleTabsChange}
  1048. small
  1049. items={[
  1050. {
  1051. key: '1',
  1052. label: `异常/警告(${errorData?.length || 0})`,
  1053. children: <div></div>,
  1054. },
  1055. {
  1056. key: '2',
  1057. label: `全部(${allData?.length || 0})`,
  1058. children: <div></div>,
  1059. },
  1060. ]}
  1061. ></TabsContent>
  1062. </div>
  1063. {activeKey === '1' && (
  1064. <DosingFlowTable
  1065. onClickItem={sendMessageToUnity}
  1066. select={select}
  1067. items={errorData}
  1068. />
  1069. )}
  1070. {activeKey === '2' && (
  1071. <DosingFlowTable
  1072. onClickItem={sendMessageToUnity}
  1073. select={select}
  1074. items={allData}
  1075. />
  1076. )}
  1077. </div>
  1078. );
  1079. }
  1080. function WaterInTable(props) {
  1081. const { onClickItem, data = {}, items } = props;
  1082. const columns = [
  1083. {
  1084. title: '设备名称',
  1085. width: '20%',
  1086. dataIndex: 'item_alias',
  1087. },
  1088. {
  1089. title: '差值',
  1090. // width: '15%',
  1091. dataIndex: 'current_val',
  1092. },
  1093. {
  1094. title: '时间',
  1095. // width: '15%',
  1096. dataIndex: 'create_time',
  1097. render: (text) => {
  1098. if (text) {
  1099. return dayjs(text).format('HH:mm:ss');
  1100. }
  1101. return '-';
  1102. },
  1103. },
  1104. {
  1105. title: '设定值范围',
  1106. width: '30%',
  1107. render: (record) => (
  1108. <ThresholdDetail
  1109. current={record.current_val || 0}
  1110. data={{
  1111. JsonNumThreshold: {
  1112. exception: [
  1113. { ThresholdValue: record?.thresholds, ThresholdType: 1 },
  1114. ],
  1115. },
  1116. Type: 2,
  1117. }}
  1118. />
  1119. ),
  1120. },
  1121. {
  1122. title: '状态',
  1123. dataIndex: 'status',
  1124. width: '1.25rem',
  1125. render: (status) => {
  1126. switch (status) {
  1127. case -1:
  1128. case 0:
  1129. return (
  1130. <div>
  1131. <i
  1132. className={styles.iconStatus}
  1133. style={{ background: '#12CEB3' }}
  1134. />
  1135. 正常
  1136. </div>
  1137. );
  1138. case 1:
  1139. return (
  1140. <div>
  1141. <i
  1142. className={styles.iconStatus}
  1143. style={{ background: '#FF8600' }}
  1144. />
  1145. 异常
  1146. </div>
  1147. );
  1148. case 2:
  1149. return (
  1150. <div>
  1151. <i
  1152. className={styles.iconStatus}
  1153. style={{ background: '#FFE26D' }}
  1154. />
  1155. 警告
  1156. </div>
  1157. );
  1158. default:
  1159. return (
  1160. <div>
  1161. <i
  1162. className={styles.iconStatus}
  1163. style={{ background: '#FF8600' }}
  1164. />
  1165. 异常
  1166. </div>
  1167. );
  1168. }
  1169. },
  1170. },
  1171. ];
  1172. const handleClickItem = (params) => {
  1173. onClickItem(`DeviceTable-${params.device_code}`, {
  1174. type: params.status,
  1175. deviceCode: params.device_code,
  1176. });
  1177. };
  1178. return (
  1179. <Table
  1180. columns={columns}
  1181. dataSource={items}
  1182. rowKey="device_code"
  1183. locale={{
  1184. emptyText: <Empty />,
  1185. }}
  1186. pagination={false}
  1187. />
  1188. );
  1189. }
  1190. function WaterInCom(props) {
  1191. const { sendMessageToUnity, select, allData = [], title } = props;
  1192. const [activeKey, setActiveKey] = useState('1');
  1193. const errorData = useMemo(() => {
  1194. const tempData = allData?.filter((item) => item.status);
  1195. return tempData;
  1196. }, [allData]);
  1197. const handleTabsChange = (key) => {
  1198. setActiveKey(key);
  1199. };
  1200. return (
  1201. <div className={styles.detailCard}>
  1202. <div className={styles.tableTop}>
  1203. {title}
  1204. <TabsContent
  1205. defaultActiveKey="1"
  1206. onChange={handleTabsChange}
  1207. small
  1208. items={[
  1209. {
  1210. key: '1',
  1211. label: `异常/警告(${errorData?.length || 0})`,
  1212. children: <div></div>,
  1213. },
  1214. {
  1215. key: '2',
  1216. label: `全部(${allData?.length || 0})`,
  1217. children: <div></div>,
  1218. },
  1219. ]}
  1220. ></TabsContent>
  1221. </div>
  1222. {activeKey === '1' && (
  1223. <WaterInTable
  1224. onClickItem={sendMessageToUnity}
  1225. select={select}
  1226. items={errorData}
  1227. />
  1228. )}
  1229. {activeKey === '2' && (
  1230. <WaterInTable
  1231. onClickItem={sendMessageToUnity}
  1232. select={select}
  1233. items={allData}
  1234. />
  1235. )}
  1236. </div>
  1237. );
  1238. }
  1239. function PressureGaugeTable(props) {
  1240. const { onClickItem, data = {}, items } = props;
  1241. const columns = [
  1242. {
  1243. title: '设备名称',
  1244. width: '15%',
  1245. dataIndex: 'item_alias',
  1246. },
  1247. {
  1248. title: '时间范围',
  1249. key: 'dataRange',
  1250. width: '1.5rem',
  1251. render: (record) => {
  1252. if (record.query_start && record.query_end) {
  1253. return (
  1254. <>
  1255. {dayjs(record.query_start).format('HH:mm:ss')}
  1256. <br />
  1257. {dayjs(record.query_end).format('HH:mm:ss')}
  1258. </>
  1259. );
  1260. }
  1261. return '-';
  1262. },
  1263. },
  1264. {
  1265. title: '仪表最小数',
  1266. width: '2rem',
  1267. dataIndex: 'data_min',
  1268. },
  1269. {
  1270. title: '仪表最大数',
  1271. width: '2rem',
  1272. dataIndex: 'data_max',
  1273. },
  1274. {
  1275. title: '可能原因',
  1276. dataIndex: 'content',
  1277. },
  1278. {
  1279. title: '状态',
  1280. dataIndex: 'status',
  1281. width: '1.25rem',
  1282. render: (status) => {
  1283. switch (status) {
  1284. case -1:
  1285. case 0:
  1286. return (
  1287. <div>
  1288. <i
  1289. className={styles.iconStatus}
  1290. style={{ background: '#12CEB3' }}
  1291. />
  1292. 正常
  1293. </div>
  1294. );
  1295. case 1:
  1296. return (
  1297. <div>
  1298. <i
  1299. className={styles.iconStatus}
  1300. style={{ background: '#FF8600' }}
  1301. />
  1302. 异常
  1303. </div>
  1304. );
  1305. case 2:
  1306. return (
  1307. <div>
  1308. <i
  1309. className={styles.iconStatus}
  1310. style={{ background: '#FFE26D' }}
  1311. />
  1312. 警告
  1313. </div>
  1314. );
  1315. default:
  1316. return (
  1317. <div>
  1318. <i
  1319. className={styles.iconStatus}
  1320. style={{ background: '#FF8600' }}
  1321. />
  1322. 异常
  1323. </div>
  1324. );
  1325. }
  1326. },
  1327. },
  1328. ];
  1329. const handleClickItem = (params) => {
  1330. onClickItem(`DeviceTable-${params.device_code}`, {
  1331. type: params.status,
  1332. deviceCode: params.device_code,
  1333. });
  1334. };
  1335. return (
  1336. <Table
  1337. columns={columns}
  1338. dataSource={items}
  1339. rowKey="device_code"
  1340. locale={{
  1341. emptyText: <Empty />,
  1342. }}
  1343. pagination={false}
  1344. />
  1345. );
  1346. }
  1347. function PressureGaugeCom(props) {
  1348. const { sendMessageToUnity, select, allData = [], title } = props;
  1349. const [activeKey, setActiveKey] = useState('2');
  1350. const errorData = useMemo(() => {
  1351. const tempData = allData?.filter((item) => item.status);
  1352. return tempData;
  1353. }, [allData]);
  1354. const handleTabsChange = (key) => {
  1355. setActiveKey(key);
  1356. };
  1357. return (
  1358. <div className={styles.detailCard}>
  1359. <div className={styles.tableTop}>
  1360. {title}
  1361. <TabsContent
  1362. defaultActiveKey="2"
  1363. onChange={handleTabsChange}
  1364. small
  1365. items={[
  1366. {
  1367. key: '2',
  1368. label: `异常/警告(${errorData?.length || 0})`,
  1369. children: <div></div>,
  1370. },
  1371. ]}
  1372. ></TabsContent>
  1373. </div>
  1374. {activeKey === '2' && (
  1375. <PressureGaugeTable
  1376. onClickItem={sendMessageToUnity}
  1377. select={select}
  1378. items={allData}
  1379. />
  1380. )}
  1381. </div>
  1382. );
  1383. }
  1384. function WaterQualityTable(props) {
  1385. const { onClickItem, data = {}, items } = props;
  1386. const columns = [
  1387. {
  1388. title: '设备名称',
  1389. width: '15%',
  1390. dataIndex: 'item_alias',
  1391. },
  1392. {
  1393. title: '时间范围',
  1394. key: 'dataRange',
  1395. width: '1.5rem',
  1396. render: (record) => {
  1397. if (record.query_start && record.query_end) {
  1398. return (
  1399. <>
  1400. {dayjs(record.query_start).format('HH:mm:ss')}
  1401. <br />
  1402. {dayjs(record.query_end).format('HH:mm:ss')}
  1403. </>
  1404. );
  1405. }
  1406. return '-';
  1407. },
  1408. },
  1409. {
  1410. title: '仪表最小数',
  1411. width: '2rem',
  1412. dataIndex: 'data_min',
  1413. },
  1414. {
  1415. title: '仪表最大数',
  1416. width: '2rem',
  1417. dataIndex: 'data_max',
  1418. },
  1419. {
  1420. title: '可能原因',
  1421. dataIndex: 'content',
  1422. },
  1423. {
  1424. title: '状态',
  1425. dataIndex: 'status',
  1426. width: '1.25rem',
  1427. render: (status) => {
  1428. switch (status) {
  1429. case -1:
  1430. case 0:
  1431. return (
  1432. <div>
  1433. <i
  1434. className={styles.iconStatus}
  1435. style={{ background: '#12CEB3' }}
  1436. />
  1437. 正常
  1438. </div>
  1439. );
  1440. case 1:
  1441. return (
  1442. <div>
  1443. <i
  1444. className={styles.iconStatus}
  1445. style={{ background: '#FF8600' }}
  1446. />
  1447. 异常
  1448. </div>
  1449. );
  1450. case 2:
  1451. return (
  1452. <div>
  1453. <i
  1454. className={styles.iconStatus}
  1455. style={{ background: '#FFE26D' }}
  1456. />
  1457. 警告
  1458. </div>
  1459. );
  1460. default:
  1461. return (
  1462. <div>
  1463. <i
  1464. className={styles.iconStatus}
  1465. style={{ background: '#FF8600' }}
  1466. />
  1467. 异常
  1468. </div>
  1469. );
  1470. }
  1471. },
  1472. },
  1473. ];
  1474. const handleClickItem = (params) => {
  1475. onClickItem(`DeviceTable-${params.device_code}`, {
  1476. type: params.status,
  1477. deviceCode: params.device_code,
  1478. });
  1479. };
  1480. return (
  1481. <Table
  1482. columns={columns}
  1483. dataSource={items}
  1484. rowKey="device_code"
  1485. locale={{
  1486. emptyText: <Empty />,
  1487. }}
  1488. pagination={false}
  1489. />
  1490. );
  1491. }
  1492. function WaterQualityCom(props) {
  1493. const { sendMessageToUnity, select, allData = [], title } = props;
  1494. const [activeKey, setActiveKey] = useState('2');
  1495. const errorData = useMemo(() => {
  1496. const tempData = allData?.filter((item) => item.status);
  1497. return tempData;
  1498. }, [allData]);
  1499. const handleTabsChange = (key) => {
  1500. setActiveKey(key);
  1501. };
  1502. return (
  1503. <div className={styles.detailCard}>
  1504. <div className={styles.tableTop}>
  1505. {title}
  1506. <TabsContent
  1507. defaultActiveKey="2"
  1508. onChange={handleTabsChange}
  1509. small
  1510. items={[
  1511. {
  1512. key: '2',
  1513. label: `异常/警告(${errorData?.length || 0})`,
  1514. children: <div></div>,
  1515. },
  1516. ]}
  1517. ></TabsContent>
  1518. </div>
  1519. {activeKey === '2' && (
  1520. <WaterQualityTable
  1521. onClickItem={sendMessageToUnity}
  1522. select={select}
  1523. items={allData}
  1524. />
  1525. )}
  1526. </div>
  1527. );
  1528. }
  1529. function ReportDumCom(props) {
  1530. const { data = [], title } = props;
  1531. const columns = [
  1532. {
  1533. title: '报警时间',
  1534. dataIndex: 'event_time',
  1535. render: (time) => dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
  1536. },
  1537. {
  1538. title: '设备名称',
  1539. dataIndex: 'device_name',
  1540. },
  1541. {
  1542. title: '报警类型',
  1543. dataIndex: 'event_type',
  1544. // render: type => alarmType[type],
  1545. },
  1546. {
  1547. title: '报警图片',
  1548. render: (item) => (
  1549. <ReactZmage
  1550. controller={{
  1551. // 关闭按钮
  1552. close: true,
  1553. // 旋转按钮
  1554. rotate: true,
  1555. // 缩放按钮
  1556. zoom: false,
  1557. // 下载按钮
  1558. download: false,
  1559. // 翻页按钮
  1560. flip: false,
  1561. // 多页指示
  1562. pagination: false,
  1563. }}
  1564. backdrop="rgba(255,255,255,0.5)"
  1565. style={{ height: '0.9rem' }}
  1566. src={item.path}
  1567. />
  1568. ),
  1569. },
  1570. ];
  1571. return (
  1572. <div style={{ marginBottom: '0.3rem' }}>
  1573. <div className={styles.tabBarExtraContent}>
  1574. <div className={styles.text} style={{ width: '60%' }}>
  1575. {title}
  1576. </div>
  1577. <div className={styles.abnormal}>
  1578. <div className={styles.text} style={{ float: 'right' }}>
  1579. 异常({data?.length || 0})
  1580. </div>
  1581. </div>
  1582. </div>
  1583. <Table
  1584. bordered
  1585. rowKey="event_time"
  1586. columns={columns}
  1587. dataSource={data}
  1588. locale={{
  1589. emptyText: <Empty />,
  1590. }}
  1591. pagination={false}
  1592. />
  1593. </div>
  1594. );
  1595. }
  1596. function base64ToImageUrl(base64String) {
  1597. const byteCharacters = atob(base64String);
  1598. const byteArrays = [];
  1599. for (let i = 0; i < byteCharacters.length; i++) {
  1600. byteArrays.push(byteCharacters.charCodeAt(i));
  1601. }
  1602. const byteArray = new Uint8Array(byteArrays);
  1603. const blob = new Blob([byteArray], { type: 'image/png' });
  1604. const imageUrl = URL.createObjectURL(blob);
  1605. return imageUrl;
  1606. }
  1607. function Empty() {
  1608. return (
  1609. <div>
  1610. <img
  1611. src={require('@/assets/self-empty.png')}
  1612. style={{ margin: '0.2rem 0', width: '1rem' }}
  1613. />
  1614. <p style={{ textAlign: 'center', color: '#555' }}>自检正常</p>
  1615. </div>
  1616. );
  1617. }
  1618. export default connect(({ eqSelfInspection }) => ({
  1619. userList: eqSelfInspection.userList,
  1620. mandateInfo: eqSelfInspection.mandateInfo,
  1621. }))(Detail);