configurable.api.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. import { floor, isArray, random, slice } from 'lodash-es';
  2. import { defHttp } from '/@/utils/http/axios';
  3. import { get } from '../billboard/utils';
  4. import { useGlobSetting } from '/@/hooks/setting';
  5. import { reactive } from 'vue';
  6. import _ from 'lodash';
  7. enum Api {
  8. list = '/safety/ventanalyDevice/homedata2',
  9. getHomeData = '/safety/ventanalyDevice/homedata',
  10. getDisHome = '/monitor/disaster/getDisHome',
  11. getBDDustData = '/monitor/disaster/getDisDustHome',
  12. getBDFireData = '/monitor/disaster/getDisFireHome',
  13. getDeviceSys = '/ventanaly-device/monitor/getSysFireHomeInfo',
  14. getAlarmRecord = '/ventanaly-device/safety/ventanalyAlarmLog/sysLinkDevAlarmLog',
  15. getTotal = '/safety/ventanalyAlarmLog/total',
  16. sysTypeWarnList = '/safety/ventanalyAlarmLog/sysTypeWarn',
  17. getDisasterProportion = '/safety/ventanalyAlarmLog/getDisasterProportion',
  18. system = '/ventanaly-device/monitor/device',
  19. }
  20. // 搞这个缓存是由于:目前代码上的设计是多个模块发出多次请求,每个模块自己负责消费前者的响应。
  21. // 这会导致相同的请求被同时发送多次。
  22. const cache = new Map<string, Promise<any>>();
  23. /**
  24. * 列表接口,5.5专用,和6.0的getHomeData基本一致
  25. * @param params
  26. */
  27. export const list = (params) => {
  28. const key = `${Api.list}?${JSON.stringify(params)}`;
  29. if (!cache.has(key)) {
  30. cache.set(
  31. key,
  32. defHttp.post({ url: Api.list, params }).finally(() => {
  33. cache.delete(key);
  34. })
  35. );
  36. }
  37. return (cache.get(key) as Promise<any>).then((res) => {
  38. if (res.fanmain) {
  39. // 处理频率字段,为了兼容旧版保留,现配置项已支持一级动态字段
  40. res.fanmain.forEach((e) => {
  41. if (e.readData.Fan2StartStatus === '1') {
  42. e.current = '二号';
  43. e.readData.FanFreqHz = e.readData.Fan2FreqHz;
  44. } else {
  45. e.current = '一号';
  46. e.readData.FanFreqHz = e.readData.Fan1FreqHz;
  47. }
  48. });
  49. }
  50. if (res.fanlocal) {
  51. res.fanlocal.forEach((e) => {
  52. e.chartData = [
  53. {
  54. x: '吸风量',
  55. yRealtime: e.readData.windQuantity1,
  56. yMock: floor(parseFloat(e.inletAirVolume_merge) * random(0.98, 1, false), 2),
  57. y: e.inletAirVolume_merge,
  58. },
  59. {
  60. x: '供风量',
  61. yRealtime: e.readData.windQuantity2,
  62. yMock: floor(parseFloat(e.ductOutletAirVolume_merge) * random(0.98, 1, false), 2),
  63. y: e.ductOutletAirVolume_merge,
  64. },
  65. ];
  66. if (e.readData.Fan2StartStatus === '1') {
  67. e.current = '二号';
  68. e.readData.FanfHz = e.readData.Fan2fHz;
  69. } else {
  70. e.current = '一号';
  71. e.readData.FanfHz = e.readData.Fan1fHz;
  72. }
  73. });
  74. }
  75. if (res.sys_majorpath) {
  76. res.sys_majorpath.forEach((e) => {
  77. const { drag_1, drag_2, drag_3, drag_total } = e.majorpath;
  78. const { fy_merge = { value: '1' } } = e.readData;
  79. const drag_merge = parseInt(fy_merge.value);
  80. // const m3_merge = parseInt(retM3_merge.value);
  81. e.piechart = [
  82. { val: drag_1, valMock: floor((drag_1 / drag_total) * drag_merge), label: '进风区' },
  83. { val: drag_2, valMock: floor((drag_2 / drag_total) * drag_merge), label: '用风区' },
  84. { val: drag_3, valMock: floor((drag_3 / drag_total) * drag_merge), label: '回风区' },
  85. ];
  86. e.readData.dengjikong_merge = get(res, 'midinfo[0].sysinfo.equalarea');
  87. e.readData.fy_merge_int = drag_merge;
  88. // e.dengjikong_merge = floor((1.19 * (m3_merge / 60)) / Math.sqrt(drag_merge), 2);
  89. });
  90. }
  91. if (res.sys_surface_caimei) {
  92. res.sys_surface_caimei.forEach((e) => {
  93. if (isArray(e.history)) {
  94. e.history = slice(e.history, e.history.length - 30, e.history.length);
  95. }
  96. if (isArray(e.history_report)) {
  97. e.history_report = slice(e.history_report, e.history_report.length - 30, e.history_report.length);
  98. console.log(e, '999000');
  99. }
  100. });
  101. }
  102. if (res.device_arr) {
  103. res.device_arr = Object.values(res.device);
  104. }
  105. if (res.sys_wind) {
  106. res.sys_wind.forEach((e) => {
  107. if (e.readData.m3) {
  108. e.readData.m3 = e.readData.m3.replace('-', '');
  109. }
  110. if (e.readData.va) {
  111. e.readData.va = e.readData.va.replace('-', '');
  112. }
  113. });
  114. }
  115. if (res.windrect) {
  116. res.windrect.forEach((e) => {
  117. if (e.readData.m3) {
  118. e.readData.m3 = e.readData.m3.replace('-', '');
  119. }
  120. if (e.readData.va) {
  121. e.readData.va = e.readData.va.replace('-', '');
  122. }
  123. });
  124. }
  125. if (res.safetymonitor) {
  126. const { sysOrgCode } = useGlobSetting();
  127. // 沙坪
  128. if (sysOrgCode === 'jsnyspmy') {
  129. res.safetymonitor = _.sortBy(res.safetymonitor, (e) => {
  130. const map = new Map([
  131. ['1960160466651189249', 1],
  132. ['1960160465543892994', 2],
  133. ['1960160465376120833', 3],
  134. ['1960160466168844289', 4],
  135. ['1960160465736830977', 5],
  136. ['1960160466026237954', 6],
  137. ['1960160407146598402', 7],
  138. ]);
  139. const inx = map.get(e.deviceID) || 9999;
  140. return inx;
  141. });
  142. }
  143. }
  144. return res;
  145. });
  146. };
  147. export const getHomeData = (params) => {
  148. const key = `${Api.getHomeData}?${JSON.stringify(params)}`;
  149. if (!cache.has(key)) {
  150. cache.set(
  151. key,
  152. defHttp.post({ url: Api.getHomeData, params }).finally(() => {
  153. cache.delete(key);
  154. })
  155. );
  156. }
  157. return (cache.get(key) as Promise<any>).then((res) => {
  158. res.fanmain.forEach((e) => {
  159. if (e.readData.Fan2StartStatus === '1') {
  160. e.current = '二号';
  161. e.readData.FanFreqHz = e.readData.Fan2FreqHz;
  162. } else {
  163. e.current = '一号';
  164. e.readData.FanFreqHz = e.readData.Fan1FreqHz;
  165. }
  166. });
  167. res.fanlocal.forEach((e) => {
  168. e.chartData = [
  169. {
  170. x: '吸风量',
  171. y: e.readData.windQuantity1,
  172. },
  173. {
  174. x: '供风量',
  175. y: e.readData.windQuantity2,
  176. },
  177. ];
  178. if (e.readData.Fan2StartStatus === '1') {
  179. e.current = '二号';
  180. e.readData.FanfHz = e.readData.Fan2fHz;
  181. } else {
  182. e.current = '一号';
  183. e.readData.FanfHz = e.readData.Fan1fHz;
  184. }
  185. });
  186. res.sys_majorpath.forEach((e) => {
  187. e.piechart = [
  188. { val: e.majorpath.drag_1, label: '进风区' },
  189. { val: e.majorpath.drag_2, label: '用风区' },
  190. { val: e.majorpath.drag_3, label: '回风区' },
  191. ];
  192. });
  193. return res;
  194. });
  195. };
  196. export const getBDDustData = (params) => {
  197. const key = `${Api.getBDDustData}?${JSON.stringify(params)}`;
  198. if (!cache.has(key)) {
  199. cache.set(
  200. key,
  201. defHttp.post({ url: Api.getBDDustData, params }).finally(() => {
  202. cache.delete(key);
  203. })
  204. );
  205. }
  206. return cache.get(key) as Promise<any>;
  207. };
  208. export const getBDFireData = (params) => {
  209. const key = `${Api.getBDFireData}?${JSON.stringify(params)}`;
  210. if (!cache.has(key)) {
  211. cache.set(
  212. key,
  213. defHttp.post({ url: Api.getBDFireData, params }).finally(() => {
  214. cache.delete(key);
  215. })
  216. );
  217. }
  218. return (cache.get(key) as Promise<any>).then((res) => {
  219. res.pdArray.forEach((e) => {
  220. e.arrayFiber.forEach((j) => {
  221. j.fibreTemperatureArr = JSON.parse(j.fibreTemperature);
  222. });
  223. });
  224. res.sgGxObj.devGxcw.forEach((e) => {
  225. e.fibreTemperatureArr = JSON.parse(e.fibreTemperature);
  226. });
  227. res.sgGxObj.devSgjc.forEach((e) => {
  228. e.o2val = e.o2Val || 0;
  229. e.coval = e.coVal || 0;
  230. e.gasval = e.gasVal || 0;
  231. e.ch2val = e.ch2Val || 0;
  232. e.chval = e.chVal || 0;
  233. });
  234. return res;
  235. });
  236. };
  237. // 塔山火灾预警页面获取数据接口
  238. export const getDeviceSys = (params) => {
  239. const key = `${Api.getDeviceSys}?${JSON.stringify(params)}`;
  240. if (!cache.has(key)) {
  241. cache.set(
  242. key,
  243. defHttp.post({ url: Api.getDeviceSys, params }).finally(() => {
  244. cache.delete(key);
  245. })
  246. );
  247. }
  248. return (cache.get(key) as Promise<any>).then((res) => {
  249. return res;
  250. });
  251. };
  252. export const getAlarmRecord = (params) => {
  253. const key = `${Api.getAlarmRecord}?${JSON.stringify(params)}`;
  254. if (!cache.has(key)) {
  255. cache.set(
  256. key,
  257. defHttp.post({ url: Api.getAlarmRecord, params }).finally(() => {
  258. cache.delete(key);
  259. })
  260. );
  261. }
  262. return (cache.get(key) as Promise<any>).then((res) => {
  263. return res;
  264. });
  265. };
  266. export const getDisHome = (params) => {
  267. const key = `${Api.getDisHome}?${JSON.stringify(params)}`;
  268. if (!cache.has(key)) {
  269. cache.set(
  270. key,
  271. defHttp.post({ url: Api.getDisHome, params }).finally(() => {
  272. cache.delete(key);
  273. })
  274. );
  275. }
  276. return (cache.get(key) as Promise<any>).then((res) => {
  277. if (res.pdArray) {
  278. res.pdArray.forEach((e) => {
  279. e.arrayFiber.forEach((j) => {
  280. j.fibreTemperatureArr = JSON.parse(j.fibreTemperature);
  281. });
  282. });
  283. }
  284. if (res.sgGxObj) {
  285. res.sgGxObj.devGxcw.forEach((e) => {
  286. e.fibreTemperatureArr = JSON.parse(e.fibreTemperature);
  287. });
  288. res.sgGxObj.devSgjc.forEach((e) => {
  289. e.o2val = e.o2Val || 0;
  290. e.coval = e.coVal || 0;
  291. e.gasval = e.gasVal || 0;
  292. e.ch2val = e.ch2Val || 0;
  293. e.chval = e.chVal || 0;
  294. });
  295. }
  296. if (res.obfObj) {
  297. res.obfObj.obfObjModded = [
  298. {
  299. objType: '氧气',
  300. arrayDev: res.obfObj.arrayDev.map((e) => {
  301. return {
  302. strinstallpos: e.strinstallpos,
  303. val: e.o2Val || 0,
  304. };
  305. }),
  306. },
  307. {
  308. objType: '甲烷',
  309. arrayDev: res.obfObj.arrayDev.map((e) => {
  310. return {
  311. strinstallpos: e.strinstallpos,
  312. val: e.ch4Val || 0,
  313. };
  314. }),
  315. },
  316. {
  317. objType: '一氧化碳',
  318. arrayDev: res.obfObj.arrayDev.map((e) => {
  319. return {
  320. strinstallpos: e.strinstallpos,
  321. val: e.coVal || 0,
  322. };
  323. }),
  324. },
  325. {
  326. objType: '乙炔',
  327. arrayDev: res.obfObj.arrayDev.map((e) => {
  328. return {
  329. strinstallpos: e.strinstallpos,
  330. val: e.c2h2Val || 0,
  331. };
  332. }),
  333. },
  334. {
  335. objType: '二氧化碳',
  336. arrayDev: res.obfObj.arrayDev.map((e) => {
  337. return {
  338. strinstallpos: e.strinstallpos,
  339. val: e.co2Val || 0,
  340. };
  341. }),
  342. },
  343. {
  344. objType: '乙烯',
  345. arrayDev: res.obfObj.arrayDev.map((e) => {
  346. return {
  347. strinstallpos: e.strinstallpos,
  348. val: e.c2h4Val || 0,
  349. };
  350. }),
  351. },
  352. {
  353. objType: '压差',
  354. arrayDev: res.obfObj.arrayDev.map((e) => {
  355. return {
  356. strinstallpos: e.strinstallpos,
  357. val: e.dpVal || 0,
  358. };
  359. }),
  360. },
  361. {
  362. objType: '温度',
  363. arrayDev: res.obfObj.arrayDev.map((e) => {
  364. return {
  365. strinstallpos: e.strinstallpos,
  366. val: e.tempVal || 0,
  367. };
  368. }),
  369. },
  370. ];
  371. }
  372. return res;
  373. });
  374. };
  375. //获取通风监测预警图表数据
  376. export const sysTypeWarnList = (params) => {
  377. const key = `${Api.sysTypeWarnList}?${JSON.stringify(params)}`;
  378. if (!cache.has(key)) {
  379. cache.set(
  380. key,
  381. defHttp.post({ url: Api.sysTypeWarnList, params }).finally(() => {
  382. cache.delete(key);
  383. })
  384. );
  385. }
  386. return (cache.get(key) as Promise<any>).then((res) => {
  387. return res;
  388. });
  389. };
  390. //获取多灾融合预警-风险权重比例数据
  391. export const getDisasterProportion = (params) => {
  392. const key = `${Api.getDisasterProportion}?${JSON.stringify(params)}`;
  393. if (!cache.has(key)) {
  394. cache.set(
  395. key,
  396. defHttp.post({ url: Api.getDisasterProportion, params }).finally(() => {
  397. cache.delete(key);
  398. })
  399. );
  400. }
  401. return (cache.get(key) as Promise<any>).then((res) => {
  402. return res;
  403. });
  404. };
  405. //多灾融合预警
  406. function getLevelNum() {
  407. return new Promise(async (resolve) => {
  408. const list: Record<string, any> = {};
  409. const typeArr = ['fire', 'dust', 'vent', 'gas'];
  410. for (let i = 0; i < typeArr.length; i++) {
  411. const type = typeArr[i];
  412. const result = await sysTypeWarnList({ type });
  413. if (type == 'fire') {
  414. list.fire = result.length || 0;
  415. } else if (type == 'dust') {
  416. list.dust = result.length || 0;
  417. } else if (type == 'vent') {
  418. list.vent = result.length || 0;
  419. } else if (type == 'gas') {
  420. list.gas = result.length || 0;
  421. }
  422. }
  423. resolve(list);
  424. });
  425. }
  426. export const getTotal = (params) => {
  427. const { sysDataType } = useGlobSetting();
  428. const key = `${Api.getTotal}?${JSON.stringify(params)}`;
  429. if (!cache.has(key)) {
  430. cache.set(
  431. key,
  432. defHttp.get({ url: Api.getTotal, params }).finally(() => {
  433. cache.delete(key);
  434. })
  435. );
  436. }
  437. return (cache.get(key) as Promise<any>).then(async (res) => {
  438. console.log(res, '多灾融合预警数据');
  439. let dataVent = await getLevelNum();
  440. const levelsList = [
  441. {
  442. name: '报警',
  443. value: 0,
  444. },
  445. {
  446. name: '重大风险',
  447. value: 0,
  448. },
  449. {
  450. name: '较大风险',
  451. value: 0,
  452. },
  453. {
  454. name: '一般风险',
  455. value: 0,
  456. },
  457. {
  458. name: '低风险',
  459. value: dataVent.vent || 0,
  460. },
  461. ];
  462. //通风监测预警数据
  463. switch (sysDataType) {
  464. case 'monitor':
  465. res.ventWarn = {
  466. ventJf: res.ventInfo.zongjinfeng,
  467. ventXf: res.ventInfo.xufengliang,
  468. ventHf: res.ventInfo.zonghuifeng,
  469. };
  470. res.ventData = [
  471. {
  472. name: '报警',
  473. value: res.info.sysInfo.ventS.levels.alarm,
  474. },
  475. {
  476. name: '重大风险',
  477. value: res.info.sysInfo.ventS.levels.red,
  478. },
  479. {
  480. name: '较大风险',
  481. value: res.info.sysInfo.ventS.levels.orange,
  482. },
  483. {
  484. name: '一般风险',
  485. value: res.info.sysInfo.ventS.levels.yellow,
  486. },
  487. {
  488. name: '低风险',
  489. value: dataVent.vent ? dataVent.vent : res.info.sysInfo.ventS.levels.blue,
  490. },
  491. ];
  492. break;
  493. case 'report':
  494. res.ventWarn = {
  495. ventJf: res.ventInfo.totalIntM3,
  496. ventXf: res.ventInfo.xufengliang,
  497. ventHf: res.ventInfo.totalRetM3,
  498. };
  499. res.ventData = levelsList;
  500. break;
  501. default:
  502. res.ventWarn = {
  503. ventJf: res.ventInfo.totalIntM3,
  504. ventXf: res.ventInfo.xufengliang,
  505. ventHf: res.ventInfo.totalRetM3,
  506. };
  507. res.ventData = levelsList;
  508. }
  509. //设备监测预警数据
  510. res.deviceWarn = reactive({});
  511. Object.keys(res.info.devicekindInfo).forEach((el) => {
  512. res.deviceWarn[`${el}_all`] = res.info.devicekindInfo[el].totalcount;
  513. res.deviceWarn[`${el}_warn`] = res.info.devicekindInfo[el].count;
  514. res.deviceWarn[`${el}_close`] = res.info.devicekindInfo[el].netstatus;
  515. });
  516. //瓦斯监测预警数据
  517. res.gasData = reactive({});
  518. res.gasData.safety_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.gasNumber, 0);
  519. res.gasData.gas_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.pumpNumber, 0);
  520. res.gasData.monitorData = res.info.sysInfo.gasS.devices.map((el) => {
  521. return {
  522. label: el.systemname,
  523. value: el.gasNumber,
  524. value1: el.pumpNumber,
  525. };
  526. });
  527. //火灾监测预警数据
  528. res.fireInfos = reactive({});
  529. res.fireInfos.dataOn = [];
  530. if (res.bundletubeInfo && res.bundletubeInfo.msgTxt.length != 0 && res.bundletubeInfo.msgTxt[0].datalist.length != 0) {
  531. res.bundletubeInfo.msgTxt[0].datalist.forEach((el) => {
  532. res.fireInfos.dataOn.push({
  533. warnLevel: el.syswarnLevel_str,
  534. smokeJd: el.syswarnLevel_des,
  535. value1: el.strinstallpos,
  536. });
  537. });
  538. } else {
  539. res.fireInfos.dataOn = [];
  540. }
  541. res.fireInfos.tempVal = res.info.sysInfo.fireS.summaryInfo
  542. ? res.info.sysInfo.fireS.summaryInfo.external.temperature && res.info.sysInfo.fireS.summaryInfo.external.temperature.maxlevel == '0'
  543. ? '低风险'
  544. : '低风险'
  545. : '';
  546. res.fireInfos.smokeVal = res.info.sysInfo.fireS.summaryInfo
  547. ? res.info.sysInfo.fireS.summaryInfo.external.smokeval &&
  548. res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel &&
  549. res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel == '0'
  550. ? '低风险'
  551. : '低风险'
  552. : '';
  553. res.fireInfos.fireVal = res.info.sysInfo.fireS.summaryInfo
  554. ? res.info.sysInfo.fireS.summaryInfo.external.fireval &&
  555. res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel &&
  556. res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel == '0'
  557. ? '低风险'
  558. : '低风险'
  559. : '';
  560. res.fireInfos.coVal = res.info.sysInfo.fireS.summaryInfo
  561. ? res.info.sysInfo.fireS.summaryInfo.external.coval && res.info.sysInfo.fireS.summaryInfo.external.coval.value
  562. ? res.info.sysInfo.fireS.summaryInfo.external.coval.value
  563. : '-'
  564. : '';
  565. //粉尘监测预警数据
  566. res.dustInfo = [
  567. {
  568. name: '报警',
  569. value: res.info.sysInfo.dustS.levels.alarm,
  570. },
  571. {
  572. name: '重大风险',
  573. value: res.info.sysInfo.dustS.levels.red,
  574. },
  575. {
  576. name: '较大风险',
  577. value: res.info.sysInfo.dustS.levels.orange,
  578. },
  579. {
  580. name: '一般风险',
  581. value: res.info.sysInfo.dustS.levels.yellow,
  582. },
  583. {
  584. name: '低风险',
  585. value: dataVent.dust ? dataVent.dust : res.info.sysInfo.dustS.levels.blue,
  586. },
  587. ];
  588. return res;
  589. });
  590. };
  591. //机电硐室
  592. export const getElectroData = (params) => {
  593. const key = `${Api.system}?${JSON.stringify(params)}`;
  594. if (!cache.has(key)) {
  595. cache.set(
  596. key,
  597. defHttp.post({ url: Api.system, params }).finally(() => {
  598. cache.delete(key);
  599. })
  600. );
  601. }
  602. return (cache.get(key) as Promise<any>).then(async (res) => {
  603. let data = res.msgTxt.find((el) => el.type == 'ballvalve_auto');
  604. data.tempData = data?.datalist?.map((el, index) => {
  605. return {
  606. areaName: el.readData.areaName,
  607. tempStart: el.readData.tempStart,
  608. tempStop: el.readData.tempStop,
  609. CORealtime: el.readData.CORealtime,
  610. };
  611. });
  612. if (data?.datalist) {
  613. data.datalist.forEach((el) => {
  614. el.cardData = {
  615. title: el.strinstallpos,
  616. areaText: '区域',
  617. areaVal: el.readData.areaName,
  618. moduleText: '模式',
  619. moduleVal: el.readData.smokePattern,
  620. statusText: '烟雾传感器状态',
  621. statusVal: el.readData.smokeSensorStatus == 'False' ? '正常-低电平' : '异常',
  622. phoneText: '机号',
  623. phoneVal: el.readData.deviceName,
  624. tempNowText: '实时测温',
  625. tempNowVal: el.readData.tempRealtime,
  626. tempOpenText: '开启温度',
  627. tempOpenVal: el.readData.tempStart,
  628. timeText: '延时t1',
  629. timeVal: 0,
  630. tempMaxText: '最高温度',
  631. tempMaxVal: el.readData.tempMax,
  632. tempCloseText: '关闭温度',
  633. tempCloseVal: el.readData.tempMin,
  634. time3Text: '延时t3',
  635. time3Val: 0,
  636. deviceSTAT: el.readData.deviceSTAT == '1' ? true : false,
  637. };
  638. });
  639. data.chartData = data.datalist.map((el) => {
  640. return {
  641. time: el.readData.areaName,
  642. coRealTime: el.readData.CORealtime,
  643. coWarn: el.readData.COWarn,
  644. };
  645. });
  646. }
  647. return data;
  648. });
  649. };