|
|
@@ -4,6 +4,7 @@ import { get } from '../billboard/utils';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import { ref, reactive } from 'vue';
|
|
|
import _ from 'lodash';
|
|
|
+import LongList from './components/preset/LongList.vue';
|
|
|
|
|
|
enum Api {
|
|
|
list = '/safety/ventanalyDevice/homedata2',
|
|
|
@@ -42,698 +43,3 @@ export const getMonitorAndAlertBelt = (params) => defHttp.post({ url: Api.monito
|
|
|
// 这会导致相同的请求被同时发送多次。
|
|
|
const cache = new Map<string, Promise<any>>();
|
|
|
|
|
|
-/**
|
|
|
- * 列表接口,5.5专用,和6.0的getHomeData基本一致
|
|
|
- * @param params
|
|
|
- */
|
|
|
-export const list = (params) => {
|
|
|
- const key = `${Api.list}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.list, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- if (res.fanmain) {
|
|
|
- // 处理频率字段,为了兼容旧版保留,现配置项已支持一级动态字段
|
|
|
- res.fanmain.forEach((e) => {
|
|
|
- if (e.readData.Fan2StartStatus === '1') {
|
|
|
- e.current = '二号';
|
|
|
- e.readData.FanFreqHz = e.readData.Fan2FreqHz;
|
|
|
- } else {
|
|
|
- e.current = '一号';
|
|
|
- e.readData.FanFreqHz = e.readData.Fan1FreqHz;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.fanlocal) {
|
|
|
- res.fanlocal.forEach((e) => {
|
|
|
- e.chartData = [
|
|
|
- {
|
|
|
- x: '吸风量',
|
|
|
- yRealtime: e.readData.windQuantity1,
|
|
|
- yMock: floor(parseFloat(e.inletAirVolume_merge) * random(0.98, 1, false), 2),
|
|
|
- y: e.inletAirVolume_merge,
|
|
|
- },
|
|
|
- {
|
|
|
- x: '供风量',
|
|
|
- yRealtime: e.readData.windQuantity2,
|
|
|
- yMock: floor(parseFloat(e.ductOutletAirVolume_merge) * random(0.98, 1, false), 2),
|
|
|
- y: e.ductOutletAirVolume_merge,
|
|
|
- },
|
|
|
- ];
|
|
|
- if (e.readData.Fan2StartStatus === '1') {
|
|
|
- e.current = '二号';
|
|
|
- e.readData.FanfHz = e.readData.Fan2fHz;
|
|
|
- } else {
|
|
|
- e.current = '一号';
|
|
|
- e.readData.FanfHz = e.readData.Fan1fHz;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.sys_majorpath) {
|
|
|
- res.sys_majorpath.forEach((e) => {
|
|
|
- const { drag_1, drag_2, drag_3, drag_total } = e.majorpath;
|
|
|
- const { fy_merge = { value: '1' } } = e.readData;
|
|
|
- const drag_merge = parseInt(fy_merge.value);
|
|
|
- // const m3_merge = parseInt(retM3_merge.value);
|
|
|
-
|
|
|
- e.piechart = [
|
|
|
- { val: drag_1, valMock: floor((drag_1 / drag_total) * drag_merge), label: '进风区' },
|
|
|
- { val: drag_2, valMock: floor((drag_2 / drag_total) * drag_merge), label: '用风区' },
|
|
|
- { val: drag_3, valMock: floor((drag_3 / drag_total) * drag_merge), label: '回风区' },
|
|
|
- ];
|
|
|
- e.readData.dengjikong_merge = get(res, 'midinfo[0].sysinfo.equalarea');
|
|
|
- e.readData.fy_merge_int = drag_merge;
|
|
|
- // e.dengjikong_merge = floor((1.19 * (m3_merge / 60)) / Math.sqrt(drag_merge), 2);
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.sys_surface_caimei) {
|
|
|
- res.sys_surface_caimei.forEach((e) => {
|
|
|
- if (isArray(e.history)) {
|
|
|
- e.history = slice(e.history, e.history.length - 30, e.history.length);
|
|
|
- }
|
|
|
- if (isArray(e.history_report)) {
|
|
|
- e.history_report = slice(e.history_report, e.history_report.length - 30, e.history_report.length);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.device_arr) {
|
|
|
- res.device_arr = Object.values(res.device);
|
|
|
- }
|
|
|
- if (res.sys_wind) {
|
|
|
- res.sys_wind.forEach((e) => {
|
|
|
- if (e.readData.m3) {
|
|
|
- e.readData.m3 = e.readData.m3.replace('-', '');
|
|
|
- }
|
|
|
- if (e.readData.va) {
|
|
|
- e.readData.va = e.readData.va.replace('-', '');
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.windrect) {
|
|
|
- res.windrect.forEach((e) => {
|
|
|
- if (e.readData.m3) {
|
|
|
- e.readData.m3 = e.readData.m3.replace('-', '');
|
|
|
- }
|
|
|
- if (e.readData.va) {
|
|
|
- e.readData.va = e.readData.va.replace('-', '');
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (res.safetymonitor) {
|
|
|
- const { sysOrgCode } = useGlobSetting();
|
|
|
- // 沙坪
|
|
|
- if (sysOrgCode === 'jsnyspmy') {
|
|
|
- res.safetymonitor = _.sortBy(res.safetymonitor, (e) => {
|
|
|
- const map = new Map([
|
|
|
- ['1960160466651189249', 1],
|
|
|
- ['1960160465543892994', 2],
|
|
|
- ['1960160465376120833', 3],
|
|
|
- ['1960160466168844289', 4],
|
|
|
- ['1960160465736830977', 5],
|
|
|
- ['1960160466026237954', 6],
|
|
|
- ['1960160407146598402', 7],
|
|
|
- ]);
|
|
|
-
|
|
|
- const inx = map.get(e.deviceID) || 9999;
|
|
|
-
|
|
|
- return inx;
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-export const getHomeData = (params) => {
|
|
|
- const key = `${Api.getHomeData}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getHomeData, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- res.fanmain.forEach((e) => {
|
|
|
- if (e.readData.Fan2StartStatus === '1') {
|
|
|
- e.current = '二号';
|
|
|
- e.readData.FanFreqHz = e.readData.Fan2FreqHz;
|
|
|
- } else {
|
|
|
- e.current = '一号';
|
|
|
- e.readData.FanFreqHz = e.readData.Fan1FreqHz;
|
|
|
- }
|
|
|
- });
|
|
|
- res.fanlocal.forEach((e) => {
|
|
|
- e.chartData = [
|
|
|
- {
|
|
|
- x: '吸风量',
|
|
|
- y: e.readData.windQuantity1,
|
|
|
- },
|
|
|
- {
|
|
|
- x: '供风量',
|
|
|
- y: e.readData.windQuantity2,
|
|
|
- },
|
|
|
- ];
|
|
|
- if (e.readData.Fan2StartStatus === '1') {
|
|
|
- e.current = '二号';
|
|
|
- e.readData.FanfHz = e.readData.Fan2fHz;
|
|
|
- } else {
|
|
|
- e.current = '一号';
|
|
|
- e.readData.FanfHz = e.readData.Fan1fHz;
|
|
|
- }
|
|
|
- });
|
|
|
- res.sys_majorpath.forEach((e) => {
|
|
|
- e.piechart = [
|
|
|
- { val: e.majorpath.drag_1, label: '进风区' },
|
|
|
- { val: e.majorpath.drag_2, label: '用风区' },
|
|
|
- { val: e.majorpath.drag_3, label: '回风区' },
|
|
|
- ];
|
|
|
- });
|
|
|
-
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-export const getBDDustData = (params) => {
|
|
|
- const key = `${Api.getBDDustData}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getBDDustData, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return cache.get(key) as Promise<any>;
|
|
|
-};
|
|
|
-
|
|
|
-// 塔山火灾预警页面获取数据接口
|
|
|
-export const getDeviceSys = (params) => {
|
|
|
- const key = `${Api.getDeviceSys}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getDeviceSys, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-export const getAlarmRecord = (params) => {
|
|
|
- const key = `${Api.getAlarmRecord}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getAlarmRecord, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-export const getDisHome = (params) => {
|
|
|
- // 生成缓存key,基于接口地址和参数
|
|
|
- const key = `${Api.getDisHome}?${JSON.stringify(params)}`;
|
|
|
-
|
|
|
- // 缓存不存在时发起请求
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getDisHome, params }).finally(() => {
|
|
|
- // 请求完成后删除缓存,保证下次请求能获取最新数据
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- // 返回缓存中的Promise并处理响应数据
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- // 1. 处理 pdArray 中的光纤温度数据(解析JSON字符串)
|
|
|
- if (res.pdArray && Array.isArray(res.pdArray)) {
|
|
|
- res.pdArray.forEach((e) => {
|
|
|
- // 先校验 arrayFiber 是数组,避免forEach报错
|
|
|
- if (e.arrayFiber && Array.isArray(e.arrayFiber)) {
|
|
|
- e.arrayFiber.forEach((j) => {
|
|
|
- // 安全解析 JSON,避免 undefined/无效JSON 导致报错
|
|
|
- j.fibreTemperatureArr = safeJsonParse(j.fibreTemperature, []);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 2. 处理 sgGxObj 下的设备数据
|
|
|
- if (res.sgGxObj) {
|
|
|
- // 2.1 解析 devGxcw 中的光纤温度
|
|
|
- if (res.sgGxObj.devGxcw && Array.isArray(res.sgGxObj.devGxcw)) {
|
|
|
- res.sgGxObj.devGxcw.forEach((e) => {
|
|
|
- e.fibreTemperatureArr = safeJsonParse(e.fibreTemperature, []);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 2.2 为 devSgjc 中的气体字段设置默认值
|
|
|
- if (res.sgGxObj.devSgjc && Array.isArray(res.sgGxObj.devSgjc)) {
|
|
|
- res.sgGxObj.devSgjc.forEach((e) => {
|
|
|
- e.o2val = e.o2Val || 0;
|
|
|
- e.coval = e.coVal || 0;
|
|
|
- e.gasval = e.gasVal || 0;
|
|
|
- e.ch2val = e.ch2Val || 0;
|
|
|
- e.chval = e.chVal || 0;
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 3. 重组 obfObj 为按气体类型分类的结构
|
|
|
- if (res.obfObj && Array.isArray(res.obfObj.arrayDev)) {
|
|
|
- res.obfObj.obfObjModded = [
|
|
|
- { objType: '氧气', arrayDev: mapObfDev(res.obfObj.arrayDev, 'o2Val') },
|
|
|
- { objType: '甲烷', arrayDev: mapObfDev(res.obfObj.arrayDev, 'ch4Val') },
|
|
|
- { objType: '一氧化碳', arrayDev: mapObfDev(res.obfObj.arrayDev, 'coVal') },
|
|
|
- { objType: '乙炔', arrayDev: mapObfDev(res.obfObj.arrayDev, 'c2h2Val') },
|
|
|
- { objType: '二氧化碳', arrayDev: mapObfDev(res.obfObj.arrayDev, 'co2Val') },
|
|
|
- { objType: '乙烯', arrayDev: mapObfDev(res.obfObj.arrayDev, 'c2h4Val') },
|
|
|
- { objType: '压差', arrayDev: mapObfDev(res.obfObj.arrayDev, 'dpVal') },
|
|
|
- { objType: '温度', arrayDev: mapObfDev(res.obfObj.arrayDev, 'tempVal') },
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-/**
|
|
|
- * 安全解析 JSON 字符串的工具函数
|
|
|
- * @param {string} jsonStr - 要解析的JSON字符串
|
|
|
- * @param {any} defaultValue - 解析失败/值无效时的默认值
|
|
|
- * @returns {any} 解析结果或默认值
|
|
|
- */
|
|
|
-function safeJsonParse(jsonStr, defaultValue = null) {
|
|
|
- // 先校验值是否为有效字符串
|
|
|
- if (!jsonStr || typeof jsonStr !== 'string') {
|
|
|
- return defaultValue;
|
|
|
- }
|
|
|
- // 捕获解析异常
|
|
|
- try {
|
|
|
- return JSON.parse(jsonStr);
|
|
|
- } catch (err) {
|
|
|
- console.warn('JSON解析失败', jsonStr, err);
|
|
|
- return defaultValue;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 映射 obfObj.arrayDev 数据的工具函数,减少重复代码
|
|
|
- * @param {Array} devArray - 设备数组
|
|
|
- * @param {string} valKey - 要取值的字段名
|
|
|
- * @returns {Array} 映射后的数组
|
|
|
- */
|
|
|
-function mapObfDev(devArray, valKey) {
|
|
|
- return devArray.map((e) => ({
|
|
|
- strinstallpos: e.strinstallpos,
|
|
|
- val: e[valKey] || 0,
|
|
|
- }));
|
|
|
-}
|
|
|
-//获取通风监测预警图表数据
|
|
|
-export const sysTypeWarnList = (params) => {
|
|
|
- const key = `${Api.sysTypeWarnList}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.sysTypeWarnList, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-//获取多灾融合预警-风险权重比例数据
|
|
|
-export const getDisasterProportion = (params) => {
|
|
|
- const key = `${Api.getDisasterProportion}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getDisasterProportion, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then((res) => {
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-//多灾融合预警
|
|
|
-function getLevelNum() {
|
|
|
- return new Promise(async (resolve) => {
|
|
|
- const list: Record<string, any> = {};
|
|
|
- const typeArr = ['fire', 'dust', 'vent', 'gas'];
|
|
|
- for (let i = 0; i < typeArr.length; i++) {
|
|
|
- const type = typeArr[i];
|
|
|
- const result = await sysTypeWarnList({ type });
|
|
|
- if (type == 'fire') {
|
|
|
- list.fire = result.length || 0;
|
|
|
- } else if (type == 'dust') {
|
|
|
- list.dust = result.length || 0;
|
|
|
- } else if (type == 'vent') {
|
|
|
- list.vent = result.length || 0;
|
|
|
- } else if (type == 'gas') {
|
|
|
- list.gas = result.length || 0;
|
|
|
- }
|
|
|
- }
|
|
|
- resolve(list);
|
|
|
- });
|
|
|
-}
|
|
|
-export const getTotal = (params) => {
|
|
|
- const { sysDataType } = useGlobSetting();
|
|
|
-
|
|
|
- const key = `${Api.getTotal}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.get({ url: Api.getTotal, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then(async (res) => {
|
|
|
- let dataVent = await getLevelNum();
|
|
|
- const levelsList = [
|
|
|
- {
|
|
|
- name: '报警',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '重大风险',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '较大风险',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '一般风险',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '低风险',
|
|
|
- value: dataVent.vent || 0,
|
|
|
- },
|
|
|
- ];
|
|
|
- //通风监测预警数据
|
|
|
- switch (sysDataType) {
|
|
|
- case 'monitor':
|
|
|
- res.ventWarn = {
|
|
|
- ventJf: res.ventInfo.zongjinfeng,
|
|
|
- ventXf: res.ventInfo.xufengliang,
|
|
|
- ventHf: res.ventInfo.zonghuifeng,
|
|
|
- };
|
|
|
- res.ventData = [
|
|
|
- {
|
|
|
- name: '报警',
|
|
|
- value: res.info.sysInfo.ventS.levels.alarm,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '重大风险',
|
|
|
- value: res.info.sysInfo.ventS.levels.red,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '较大风险',
|
|
|
- value: res.info.sysInfo.ventS.levels.orange,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '一般风险',
|
|
|
- value: res.info.sysInfo.ventS.levels.yellow,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '低风险',
|
|
|
- value: dataVent.vent ? dataVent.vent : res.info.sysInfo.ventS.levels.blue,
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- break;
|
|
|
- case 'report':
|
|
|
- res.ventWarn = {
|
|
|
- ventJf: res.ventInfo.totalIntM3,
|
|
|
- ventXf: res.ventInfo.xufengliang,
|
|
|
- ventHf: res.ventInfo.totalRetM3,
|
|
|
- };
|
|
|
- res.ventData = levelsList;
|
|
|
- break;
|
|
|
- default:
|
|
|
- res.ventWarn = {
|
|
|
- ventJf: res.ventInfo.totalIntM3,
|
|
|
- ventXf: res.ventInfo.xufengliang,
|
|
|
- ventHf: res.ventInfo.totalRetM3,
|
|
|
- };
|
|
|
- res.ventData = levelsList;
|
|
|
- }
|
|
|
- //设备监测预警数据
|
|
|
- res.deviceWarn = reactive({});
|
|
|
- Object.keys(res.info.devicekindInfo).forEach((el) => {
|
|
|
- res.deviceWarn[`${el}_all`] = res.info.devicekindInfo[el].totalcount;
|
|
|
- res.deviceWarn[`${el}_warn`] = res.info.devicekindInfo[el].count;
|
|
|
- res.deviceWarn[`${el}_close`] = res.info.devicekindInfo[el].netstatus;
|
|
|
- });
|
|
|
- //瓦斯监测预警数据
|
|
|
- res.gasData = reactive({});
|
|
|
- res.gasData.safety_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.gasNumber, 0);
|
|
|
- res.gasData.gas_sum = res.info.sysInfo.gasS.devices.reduce((a, b) => a + b.pumpNumber, 0);
|
|
|
- res.gasData.monitorData = res.info.sysInfo.gasS.devices.map((el) => {
|
|
|
- return {
|
|
|
- label: el.systemname,
|
|
|
- value: el.gasNumber,
|
|
|
- value1: el.pumpNumber,
|
|
|
- };
|
|
|
- });
|
|
|
-
|
|
|
- //火灾监测预警数据
|
|
|
- res.fireInfos = reactive({});
|
|
|
- res.fireInfos.dataOn = [];
|
|
|
-
|
|
|
- if (res.bundletubeInfo && res.bundletubeInfo.msgTxt.length != 0 && res.bundletubeInfo.msgTxt[0].datalist.length != 0) {
|
|
|
- res.bundletubeInfo.msgTxt[0].datalist.forEach((el) => {
|
|
|
- res.fireInfos.dataOn.push({
|
|
|
- warnLevel: el.syswarnLevel_str,
|
|
|
- smokeJd: el.syswarnLevel_des,
|
|
|
- value1: el.strinstallpos,
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- res.fireInfos.dataOn = [];
|
|
|
- }
|
|
|
- res.fireInfos.tempVal = res.info.sysInfo.fireS.summaryInfo
|
|
|
- ? res.info.sysInfo.fireS.summaryInfo.external.temperature && res.info.sysInfo.fireS.summaryInfo.external.temperature.maxlevel == '0'
|
|
|
- ? '低风险'
|
|
|
- : '低风险'
|
|
|
- : '';
|
|
|
- res.fireInfos.smokeVal = res.info.sysInfo.fireS.summaryInfo
|
|
|
- ? res.info.sysInfo.fireS.summaryInfo.external.smokeval &&
|
|
|
- res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel &&
|
|
|
- res.info.sysInfo.fireS.summaryInfo.external.smokeval.maxlevel == '0'
|
|
|
- ? '低风险'
|
|
|
- : '低风险'
|
|
|
- : '';
|
|
|
-
|
|
|
- res.fireInfos.fireVal = res.info.sysInfo.fireS.summaryInfo
|
|
|
- ? res.info.sysInfo.fireS.summaryInfo.external.fireval &&
|
|
|
- res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel &&
|
|
|
- res.info.sysInfo.fireS.summaryInfo.external.fireval.maxlevel == '0'
|
|
|
- ? '低风险'
|
|
|
- : '低风险'
|
|
|
- : '';
|
|
|
-
|
|
|
- res.fireInfos.coVal = res.info.sysInfo.fireS.summaryInfo
|
|
|
- ? res.info.sysInfo.fireS.summaryInfo.external.coval && res.info.sysInfo.fireS.summaryInfo.external.coval.value
|
|
|
- ? res.info.sysInfo.fireS.summaryInfo.external.coval.value
|
|
|
- : '-'
|
|
|
- : '';
|
|
|
- //粉尘监测预警数据
|
|
|
- res.dustInfo = [
|
|
|
- {
|
|
|
- name: '报警',
|
|
|
- value: res.info.sysInfo.dustS.levels.alarm,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '重大风险',
|
|
|
- value: res.info.sysInfo.dustS.levels.red,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '较大风险',
|
|
|
- value: res.info.sysInfo.dustS.levels.orange,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '一般风险',
|
|
|
- value: res.info.sysInfo.dustS.levels.yellow,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '低风险',
|
|
|
- value: dataVent.dust ? dataVent.dust : res.info.sysInfo.dustS.levels.blue,
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-//机电硐室
|
|
|
-export const getElectroData = (params) => {
|
|
|
- const key = `${Api.system}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.system, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then(async (res) => {
|
|
|
- let data = res.msgTxt.find((el) => el.type == 'ballvalve_auto');
|
|
|
- data.tempData = data?.datalist?.map((el, index) => {
|
|
|
- return {
|
|
|
- areaName: el.readData.areaName,
|
|
|
- tempStart: el.readData.tempStart,
|
|
|
- tempStop: el.readData.tempStop,
|
|
|
- CORealtime: el.readData.CORealtime,
|
|
|
- };
|
|
|
- });
|
|
|
- if (data?.datalist) {
|
|
|
- data.datalist.forEach((el) => {
|
|
|
- el.cardData = {
|
|
|
- title: el.strinstallpos,
|
|
|
- areaText: '区域',
|
|
|
- areaVal: el.readData.areaName,
|
|
|
- moduleText: '模式',
|
|
|
- moduleVal: el.readData.smokePattern,
|
|
|
- statusText: '烟雾传感器状态',
|
|
|
- statusVal: el.readData.smokeSensorStatus == 'False' ? '正常-低电平' : '异常',
|
|
|
- phoneText: '机号',
|
|
|
- phoneVal: el.readData.deviceName,
|
|
|
- tempNowText: '实时测温',
|
|
|
- tempNowVal: el.readData.tempRealtime,
|
|
|
- tempOpenText: '开启温度',
|
|
|
- tempOpenVal: el.readData.tempStart,
|
|
|
- timeText: '延时t1',
|
|
|
- timeVal: 0,
|
|
|
- tempMaxText: '最高温度',
|
|
|
- tempMaxVal: el.readData.tempMax,
|
|
|
- tempCloseText: '关闭温度',
|
|
|
- tempCloseVal: el.readData.tempMin,
|
|
|
- time3Text: '延时t3',
|
|
|
- time3Val: 0,
|
|
|
- deviceSTAT: el.readData.deviceSTAT == '1' ? true : false,
|
|
|
- };
|
|
|
- });
|
|
|
- data.chartData = data.datalist.map((el) => {
|
|
|
- return {
|
|
|
- time: el.readData.areaName,
|
|
|
- coRealTime: el.readData.CORealtime,
|
|
|
- coWarn: el.readData.COWarn,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- return data;
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-//获取红沙泉露天煤矿数据
|
|
|
-export const getSystemApi = (params) => {
|
|
|
- const key = `${Api.getSystem}?${JSON.stringify(params)}`;
|
|
|
- if (!cache.has(key)) {
|
|
|
- cache.set(
|
|
|
- key,
|
|
|
- defHttp.post({ url: Api.getSystem, params }).finally(() => {
|
|
|
- cache.delete(key);
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- return (cache.get(key) as Promise<any>).then(async (res) => {
|
|
|
- //设备状态总览
|
|
|
- res.deviceStatusNum = {
|
|
|
- zxNum: 5,
|
|
|
- lxNum: 5,
|
|
|
- gzNum: 5,
|
|
|
- bjNum: 5,
|
|
|
- };
|
|
|
- res.deviceStatusData = [
|
|
|
- { deviceName: 'CAM-001', status: '在线', remark: '正常' },
|
|
|
- { deviceName: 'CAM-002', status: '在线', remark: '正常' },
|
|
|
- { deviceName: 'CAM-003', status: '报警', remark: '高温' },
|
|
|
- { deviceName: 'CAM-001', status: '在线', remark: '正常' },
|
|
|
- { deviceName: 'CAM-002', status: '在线', remark: '正常' },
|
|
|
- { deviceName: 'CAM-003', status: '报警', remark: '高温' },
|
|
|
- ];
|
|
|
- //实时温度曲线
|
|
|
- res.temptureLineData = [
|
|
|
- { pos: '1', value: '12' },
|
|
|
- { pos: '2', value: '44' },
|
|
|
- { pos: '3', value: '44' },
|
|
|
- { pos: '4', value: '20' },
|
|
|
- ];
|
|
|
- //最近处理记录
|
|
|
- res.processingRecordData = [
|
|
|
- { time: '14:25:10', deviceName: 'CAM-001', status: '在线' },
|
|
|
- { time: '14:25:10', deviceName: 'CAM-002', status: '在线' },
|
|
|
- { time: '14:25:10', deviceName: 'CAM-003', status: '报警' },
|
|
|
- { time: '14:25:10', deviceName: 'CAM-001', status: '在线' },
|
|
|
- { time: '14:25:10', deviceName: 'CAM-002', status: '在线' },
|
|
|
- { time: '14:25:10', deviceName: 'CAM-003', status: '报警' },
|
|
|
- ];
|
|
|
- //报警监控
|
|
|
- res.alarmMonitoringDataT = {
|
|
|
- dayWarn: 12,
|
|
|
- warnOk: 2,
|
|
|
- warnUnOk: 10,
|
|
|
- };
|
|
|
- res.alarmMonitoringData = [
|
|
|
- { time: '14:25:10', address: '采掘场A区', grade: '一级' },
|
|
|
- { time: '14:25:10', address: '采掘场B区', grade: '一级' },
|
|
|
- { time: '14:25:10', address: '采掘场C区', grade: '一级' },
|
|
|
- { time: '14:25:10', address: '采掘场D区', grade: '一级' },
|
|
|
- { time: '14:25:10', address: '采掘场E区', grade: '一级' },
|
|
|
- { time: '14:25:10', address: '采掘场F区', grade: '一级' },
|
|
|
- ];
|
|
|
- //
|
|
|
- res.areaTemptureData = [
|
|
|
- { x: '1', y: '12' },
|
|
|
- { x: '2', y: '44' },
|
|
|
- { x: '3', y: '44' },
|
|
|
- { x: '4', y: '20' },
|
|
|
- ];
|
|
|
- //环境监测数据
|
|
|
- res.environmentalMonitoringData = {
|
|
|
- tempHj: '-8.5',
|
|
|
- fsfx: '3.2',
|
|
|
- temp: '42',
|
|
|
- coval: '12',
|
|
|
- co2val: '380',
|
|
|
- o2val: '20.9',
|
|
|
- ch4val: '0.02',
|
|
|
- fcnd: '0.08',
|
|
|
- ywzs: '0.15',
|
|
|
- tempDb: '28',
|
|
|
- };
|
|
|
- //快捷操作
|
|
|
- res.quickOperationData = {
|
|
|
- time: '128天06:32:18',
|
|
|
- sjsx: '实时',
|
|
|
- wlyc: '12s',
|
|
|
- };
|
|
|
- console.log(res, '红沙泉---');
|
|
|
- return res;
|
|
|
- });
|
|
|
-};
|