configurable.api.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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. // 塔山火灾预警页面获取数据接口
  209. export const getDeviceSys = (params) => {
  210. const key = `${Api.getDeviceSys}?${JSON.stringify(params)}`;
  211. if (!cache.has(key)) {
  212. cache.set(
  213. key,
  214. defHttp.post({ url: Api.getDeviceSys, params }).finally(() => {
  215. cache.delete(key);
  216. })
  217. );
  218. }
  219. return (cache.get(key) as Promise<any>).then((res) => {
  220. return res;
  221. });
  222. };
  223. export const getAlarmRecord = (params) => {
  224. const key = `${Api.getAlarmRecord}?${JSON.stringify(params)}`;
  225. if (!cache.has(key)) {
  226. cache.set(
  227. key,
  228. defHttp.post({ url: Api.getAlarmRecord, params }).finally(() => {
  229. cache.delete(key);
  230. })
  231. );
  232. }
  233. return (cache.get(key) as Promise<any>).then((res) => {
  234. return res;
  235. });
  236. };
  237. export const getDisHome = (params) => {
  238. // 生成缓存key,基于接口地址和参数
  239. const key = `${Api.getDisHome}?${JSON.stringify(params)}`;
  240. // 缓存不存在时发起请求
  241. if (!cache.has(key)) {
  242. cache.set(
  243. key,
  244. defHttp.post({ url: Api.getDisHome, params }).finally(() => {
  245. // 请求完成后删除缓存,保证下次请求能获取最新数据
  246. cache.delete(key);
  247. })
  248. );
  249. }
  250. // 返回缓存中的Promise并处理响应数据
  251. return (cache.get(key) as Promise<any>).then((res) => {
  252. // 1. 处理 pdArray 中的光纤温度数据(解析JSON字符串)
  253. if (res.pdArray && Array.isArray(res.pdArray)) {
  254. res.pdArray.forEach((e) => {
  255. // 先校验 arrayFiber 是数组,避免forEach报错
  256. if (e.arrayFiber && Array.isArray(e.arrayFiber)) {
  257. e.arrayFiber.forEach((j) => {
  258. // 安全解析 JSON,避免 undefined/无效JSON 导致报错
  259. j.fibreTemperatureArr = safeJsonParse(j.fibreTemperature, []);
  260. });
  261. }
  262. });
  263. }
  264. // 2. 处理 sgGxObj 下的设备数据
  265. if (res.sgGxObj) {
  266. // 2.1 解析 devGxcw 中的光纤温度
  267. if (res.sgGxObj.devGxcw && Array.isArray(res.sgGxObj.devGxcw)) {
  268. res.sgGxObj.devGxcw.forEach((e) => {
  269. e.fibreTemperatureArr = safeJsonParse(e.fibreTemperature, []);
  270. });
  271. }
  272. // 2.2 为 devSgjc 中的气体字段设置默认值
  273. if (res.sgGxObj.devSgjc && Array.isArray(res.sgGxObj.devSgjc)) {
  274. res.sgGxObj.devSgjc.forEach((e) => {
  275. e.o2val = e.o2Val || 0;
  276. e.coval = e.coVal || 0;
  277. e.gasval = e.gasVal || 0;
  278. e.ch2val = e.ch2Val || 0;
  279. e.chval = e.chVal || 0;
  280. });
  281. }
  282. }
  283. // 3. 重组 obfObj 为按气体类型分类的结构
  284. if (res.obfObj && Array.isArray(res.obfObj.arrayDev)) {
  285. res.obfObj.obfObjModded = [
  286. { objType: '氧气', arrayDev: mapObfDev(res.obfObj.arrayDev, 'o2Val') },
  287. { objType: '甲烷', arrayDev: mapObfDev(res.obfObj.arrayDev, 'ch4Val') },
  288. { objType: '一氧化碳', arrayDev: mapObfDev(res.obfObj.arrayDev, 'coVal') },
  289. { objType: '乙炔', arrayDev: mapObfDev(res.obfObj.arrayDev, 'c2h2Val') },
  290. { objType: '二氧化碳', arrayDev: mapObfDev(res.obfObj.arrayDev, 'co2Val') },
  291. { objType: '乙烯', arrayDev: mapObfDev(res.obfObj.arrayDev, 'c2h4Val') },
  292. { objType: '压差', arrayDev: mapObfDev(res.obfObj.arrayDev, 'dpVal') },
  293. { objType: '温度', arrayDev: mapObfDev(res.obfObj.arrayDev, 'tempVal') },
  294. ];
  295. }
  296. return res;
  297. });
  298. };
  299. /**
  300. * 安全解析 JSON 字符串的工具函数
  301. * @param {string} jsonStr - 要解析的JSON字符串
  302. * @param {any} defaultValue - 解析失败/值无效时的默认值
  303. * @returns {any} 解析结果或默认值
  304. */
  305. function safeJsonParse(jsonStr, defaultValue = null) {
  306. // 先校验值是否为有效字符串
  307. if (!jsonStr || typeof jsonStr !== 'string') {
  308. return defaultValue;
  309. }
  310. // 捕获解析异常
  311. try {
  312. return JSON.parse(jsonStr);
  313. } catch (err) {
  314. console.warn('JSON解析失败', jsonStr, err);
  315. return defaultValue;
  316. }
  317. }
  318. /**
  319. * 映射 obfObj.arrayDev 数据的工具函数,减少重复代码
  320. * @param {Array} devArray - 设备数组
  321. * @param {string} valKey - 要取值的字段名
  322. * @returns {Array} 映射后的数组
  323. */
  324. function mapObfDev(devArray, valKey) {
  325. return devArray.map((e) => ({
  326. strinstallpos: e.strinstallpos,
  327. val: e[valKey] || 0,
  328. }));
  329. }
  330. //获取通风监测预警图表数据
  331. export const sysTypeWarnList = (params) => {
  332. const key = `${Api.sysTypeWarnList}?${JSON.stringify(params)}`;
  333. if (!cache.has(key)) {
  334. cache.set(
  335. key,
  336. defHttp.post({ url: Api.sysTypeWarnList, params }).finally(() => {
  337. cache.delete(key);
  338. })
  339. );
  340. }
  341. return (cache.get(key) as Promise<any>).then((res) => {
  342. return res;
  343. });
  344. };
  345. //获取多灾融合预警-风险权重比例数据
  346. export const getDisasterProportion = (params) => {
  347. const key = `${Api.getDisasterProportion}?${JSON.stringify(params)}`;
  348. if (!cache.has(key)) {
  349. cache.set(
  350. key,
  351. defHttp.post({ url: Api.getDisasterProportion, params }).finally(() => {
  352. cache.delete(key);
  353. })
  354. );
  355. }
  356. return (cache.get(key) as Promise<any>).then((res) => {
  357. return res;
  358. });
  359. };
  360. //多灾融合预警
  361. function getLevelNum() {
  362. return new Promise(async (resolve) => {
  363. const list: Record<string, any> = {};
  364. const typeArr = ['fire', 'dust', 'vent', 'gas'];
  365. for (let i = 0; i < typeArr.length; i++) {
  366. const type = typeArr[i];
  367. const result = await sysTypeWarnList({ type });
  368. if (type == 'fire') {
  369. list.fire = result.length || 0;
  370. } else if (type == 'dust') {
  371. list.dust = result.length || 0;
  372. } else if (type == 'vent') {
  373. list.vent = result.length || 0;
  374. } else if (type == 'gas') {
  375. list.gas = result.length || 0;
  376. }
  377. }
  378. resolve(list);
  379. });
  380. }
  381. export const getTotal = (params) => {
  382. const { sysDataType } = useGlobSetting();
  383. const key = `${Api.getTotal}?${JSON.stringify(params)}`;
  384. if (!cache.has(key)) {
  385. cache.set(
  386. key,
  387. defHttp.get({ url: Api.getTotal, params }).finally(() => {
  388. cache.delete(key);
  389. })
  390. );
  391. }
  392. return (cache.get(key) as Promise<any>).then(async (res) => {
  393. console.log(res, '多灾融合预警数据');
  394. let dataVent = await getLevelNum();
  395. const levelsList = [
  396. {
  397. name: '报警',
  398. value: 0,
  399. },
  400. {
  401. name: '重大风险',
  402. value: 0,
  403. },
  404. {
  405. name: '较大风险',
  406. value: 0,
  407. },
  408. {
  409. name: '一般风险',
  410. value: 0,
  411. },
  412. {
  413. name: '低风险',
  414. value: dataVent.vent || 0,
  415. },
  416. ];
  417. //通风监测预警数据
  418. switch (sysDataType) {
  419. case 'monitor':
  420. res.ventWarn = {
  421. ventJf: res.ventInfo.zongjinfeng,
  422. ventXf: res.ventInfo.xufengliang,
  423. ventHf: res.ventInfo.zonghuifeng,
  424. };
  425. res.ventData = [
  426. {
  427. name: '报警',
  428. value: res.info.sysInfo.ventS.levels.alarm,
  429. },
  430. {
  431. name: '重大风险',
  432. value: res.info.sysInfo.ventS.levels.red,
  433. },
  434. {
  435. name: '较大风险',
  436. value: res.info.sysInfo.ventS.levels.orange,
  437. },
  438. {
  439. name: '一般风险',
  440. value: res.info.sysInfo.ventS.levels.yellow,
  441. },
  442. {
  443. name: '低风险',
  444. value: dataVent.vent ? dataVent.vent : res.info.sysInfo.ventS.levels.blue,
  445. },
  446. ];
  447. break;
  448. case 'report':
  449. res.ventWarn = {
  450. ventJf: res.ventInfo.totalIntM3,
  451. ventXf: res.ventInfo.xufengliang,
  452. ventHf: res.ventInfo.totalRetM3,
  453. };
  454. res.ventData = levelsList;
  455. break;
  456. default:
  457. res.ventWarn = {
  458. ventJf: res.ventInfo.totalIntM3,
  459. ventXf: res.ventInfo.xufengliang,
  460. ventHf: res.ventInfo.totalRetM3,
  461. };
  462. res.ventData = levelsList;
  463. }
  464. //设备监测预警数据
  465. res.deviceWarn = reactive({});
  466. Object.keys(res.info.devicekindInfo).forEach((el) => {
  467. res.deviceWarn[`${el}_all`] = res.info.devicekindInfo[el].totalcount;
  468. res.deviceWarn[`${el}_warn`] = res.info.devicekindInfo[el].count;
  469. res.deviceWarn[`${el}_close`] = res.info.devicekindInfo[el].netstatus;
  470. });
  471. //瓦斯监测预警数据
  472. res.gasData = reactive({});
  473. res.gasData.safety_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.gasNumber, 0);
  474. res.gasData.gas_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.pumpNumber, 0);
  475. res.gasData.monitorData = res.info.sysInfo.gasS.devices.map((el) => {
  476. return {
  477. label: el.systemname,
  478. value: el.gasNumber,
  479. value1: el.pumpNumber,
  480. };
  481. });
  482. //火灾监测预警数据
  483. res.fireInfos = reactive({});
  484. res.fireInfos.dataOn = [];
  485. if (res.bundletubeInfo && res.bundletubeInfo.msgTxt.length != 0 && res.bundletubeInfo.msgTxt[0].datalist.length != 0) {
  486. res.bundletubeInfo.msgTxt[0].datalist.forEach((el) => {
  487. res.fireInfos.dataOn.push({
  488. warnLevel: el.syswarnLevel_str,
  489. smokeJd: el.syswarnLevel_des,
  490. value1: el.strinstallpos,
  491. });
  492. });
  493. } else {
  494. res.fireInfos.dataOn = [];
  495. }
  496. res.fireInfos.tempVal = res.info.sysInfo.fireS.summaryInfo
  497. ? res.info.sysInfo.fireS.summaryInfo.external.temperature && res.info.sysInfo.fireS.summaryInfo.external.temperature.maxlevel == '0'
  498. ? '低风险'
  499. : '低风险'
  500. : '';
  501. res.fireInfos.smokeVal = res.info.sysInfo.fireS.summaryInfo
  502. ? res.info.sysInfo.fireS.summaryInfo.external.smokeval &&
  503. res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel &&
  504. res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel == '0'
  505. ? '低风险'
  506. : '低风险'
  507. : '';
  508. res.fireInfos.fireVal = res.info.sysInfo.fireS.summaryInfo
  509. ? res.info.sysInfo.fireS.summaryInfo.external.fireval &&
  510. res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel &&
  511. res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel == '0'
  512. ? '低风险'
  513. : '低风险'
  514. : '';
  515. res.fireInfos.coVal = res.info.sysInfo.fireS.summaryInfo
  516. ? res.info.sysInfo.fireS.summaryInfo.external.coval && res.info.sysInfo.fireS.summaryInfo.external.coval.value
  517. ? res.info.sysInfo.fireS.summaryInfo.external.coval.value
  518. : '-'
  519. : '';
  520. //粉尘监测预警数据
  521. res.dustInfo = [
  522. {
  523. name: '报警',
  524. value: res.info.sysInfo.dustS.levels.alarm,
  525. },
  526. {
  527. name: '重大风险',
  528. value: res.info.sysInfo.dustS.levels.red,
  529. },
  530. {
  531. name: '较大风险',
  532. value: res.info.sysInfo.dustS.levels.orange,
  533. },
  534. {
  535. name: '一般风险',
  536. value: res.info.sysInfo.dustS.levels.yellow,
  537. },
  538. {
  539. name: '低风险',
  540. value: dataVent.dust ? dataVent.dust : res.info.sysInfo.dustS.levels.blue,
  541. },
  542. ];
  543. return res;
  544. });
  545. };
  546. //机电硐室
  547. export const getElectroData = (params) => {
  548. const key = `${Api.system}?${JSON.stringify(params)}`;
  549. if (!cache.has(key)) {
  550. cache.set(
  551. key,
  552. defHttp.post({ url: Api.system, params }).finally(() => {
  553. cache.delete(key);
  554. })
  555. );
  556. }
  557. return (cache.get(key) as Promise<any>).then(async (res) => {
  558. let data = res.msgTxt.find((el) => el.type == 'ballvalve_auto');
  559. data.tempData = data?.datalist?.map((el, index) => {
  560. return {
  561. areaName: el.readData.areaName,
  562. tempStart: el.readData.tempStart,
  563. tempStop: el.readData.tempStop,
  564. CORealtime: el.readData.CORealtime,
  565. };
  566. });
  567. if (data?.datalist) {
  568. data.datalist.forEach((el) => {
  569. el.cardData = {
  570. title: el.strinstallpos,
  571. areaText: '区域',
  572. areaVal: el.readData.areaName,
  573. moduleText: '模式',
  574. moduleVal: el.readData.smokePattern,
  575. statusText: '烟雾传感器状态',
  576. statusVal: el.readData.smokeSensorStatus == 'False' ? '正常-低电平' : '异常',
  577. phoneText: '机号',
  578. phoneVal: el.readData.deviceName,
  579. tempNowText: '实时测温',
  580. tempNowVal: el.readData.tempRealtime,
  581. tempOpenText: '开启温度',
  582. tempOpenVal: el.readData.tempStart,
  583. timeText: '延时t1',
  584. timeVal: 0,
  585. tempMaxText: '最高温度',
  586. tempMaxVal: el.readData.tempMax,
  587. tempCloseText: '关闭温度',
  588. tempCloseVal: el.readData.tempMin,
  589. time3Text: '延时t3',
  590. time3Val: 0,
  591. deviceSTAT: el.readData.deviceSTAT == '1' ? true : false,
  592. };
  593. });
  594. data.chartData = data.datalist.map((el) => {
  595. return {
  596. time: el.readData.areaName,
  597. coRealTime: el.readData.CORealtime,
  598. coWarn: el.readData.COWarn,
  599. };
  600. });
  601. }
  602. return data;
  603. });
  604. };