Parcourir la source

安全监控分站修改

bobo04052021@163.com il y a 4 mois
Parent
commit
ae9decf17b

+ 30 - 3
src/views/vent/safetyList/common/detail.vue

@@ -347,6 +347,7 @@ import { ref, nextTick, reactive, onMounted, onUnmounted } from 'vue';
 import {
   subStationList,
   getList,
+  getListAll,
   getEdit,
   runDeviceMonitor,
   update158DevName,
@@ -762,11 +763,37 @@ async function getStationList1() {
   tableData.value = res;
   pagination.total = res.total;
 }
+async function getStationListAll() {
+  let res = await getListAll();
+  res.forEach((el) => {
+    el.key = el.id;
+    el.linkIdC = el.linkId || '';
+    el.stripC = el.strip || '';
+    el.linkstatusC = el.linkstatus ? '连接' : '断开';
+    el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : '';
+    // el.debugTitle = '调试'
+    el.children = el.devInfoList;
+    el.children.forEach((v) => {
+      v.key = v.id;
+      v.debugTitle = '调试';
+      v.stripC = v.strserno || '';
+      v.linkstatusC = v.netStatus ? '连接' : '断开';
+      v.linkIdC = v.linkId == '0' ? '未启用' : v.linkId == '1' ? '启用' : v.linkId == '2' ? '设备异常' : '';
+      v.updateTime = v.time;
+      v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : '';
+      v.valueJc = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${
+        v.difPress || ''
+      }Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`;
+    });
+  });
+  tableData.value = res;
+  // pagination.total = res.total;
+}
 //显示全部
 function getAllShow() {
-  pagination.current = 1;
-  stationId.value = '';
-  getStationList1({ pageNo: pagination.current, pageSize: pagination.pageSize });
+  // pagination.current = 1;
+  // stationId.value = '';
+  getStationListAll();
 }
 //启动新设备
 function handlerunDeviceMonitor(record, val) {

+ 15 - 14
src/views/vent/safetyList/safetyList.api.ts

@@ -2,22 +2,23 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
   subStationList = '/safety/ventanalySubStation/alllist',
-  getList='/safety/ventanalyDeviceInfo/getDeviceListBySubId',
-  getEdit='/safety/ventanalySubStation/edit',
-  runDeviceMonitor='/safety/ventanalyDeviceInfo/runDeviceMonitor',
-  update158DevName='/safety/ventanalyDeviceInfo/update158DevName',
-  updateDebugStatus='/safety/ventanalyDeviceInfo/updateDebugStatus',
-  get158StationData='/safety/ventanalyDeviceInfo/get158StationData',
-  set158StationData='/safety/ventanalyDeviceInfo/set158StationData',
-  get158StationDevices='/safety/ventanalyDeviceInfo/get158StationDevices',
-  set158StationRead='/safety/ventanalyDeviceInfo/set158StationRead'
+  getList = '/safety/ventanalyDeviceInfo/getDeviceListBySubId',
+  getEdit = '/safety/ventanalySubStation/edit',
+  runDeviceMonitor = '/safety/ventanalyDeviceInfo/runDeviceMonitor',
+  update158DevName = '/safety/ventanalyDeviceInfo/update158DevName',
+  updateDebugStatus = '/safety/ventanalyDeviceInfo/updateDebugStatus',
+  get158StationData = '/safety/ventanalyDeviceInfo/get158StationData',
+  set158StationData = '/safety/ventanalyDeviceInfo/set158StationData',
+  get158StationDevices = '/safety/ventanalyDeviceInfo/get158StationDevices',
+  set158StationRead = '/safety/ventanalyDeviceInfo/set158StationRead',
 }
 
-
 // 分站查询接口
 export const subStationList = (params) => defHttp.get({ url: Api.subStationList, params });
 // 分站详细信息列表
 export const getList = (params) => defHttp.post({ url: Api.getList, params });
+//分站全部列表
+export const getListAll = () => defHttp.post({ url: Api.getList });
 //分站编辑
 export const getEdit = (params) => defHttp.put({ url: Api.getEdit, params });
 //启动新设备
@@ -25,12 +26,12 @@ export const runDeviceMonitor = (params) => defHttp.post({ url: Api.runDeviceMon
 //编辑设备名称
 export const update158DevName = (params) => defHttp.post({ url: Api.update158DevName, params });
 // 分站设备调试
-export const updateDebugStatus = (params) => defHttp.post({ url: Api.updateDebugStatus,params },{ joinParamsToUrl: true });
+export const updateDebugStatus = (params) => defHttp.post({ url: Api.updateDebugStatus, params }, { joinParamsToUrl: true });
 // 分站详情列表
 export const get158StationData = () => defHttp.post({ url: Api.get158StationData });
 // 分站详情下发
-export const set158StationData = (params) => defHttp.post({ url: Api.set158StationData,params },{ joinParamsToUrl: true });
+export const set158StationData = (params) => defHttp.post({ url: Api.set158StationData, params }, { joinParamsToUrl: true });
 // 根据分站ID获取分站下设备
-export const get158StationDevices = (params) => defHttp.post({ url: Api.get158StationDevices,params },{ joinParamsToUrl: true });
+export const get158StationDevices = (params) => defHttp.post({ url: Api.get158StationDevices, params }, { joinParamsToUrl: true });
 //读取分站设备数据
-export const set158StationRead = (params) => defHttp.post({ url: Api.set158StationRead,params },{ joinParamsToUrl: true });
+export const set158StationRead = (params) => defHttp.post({ url: Api.set158StationRead, params }, { joinParamsToUrl: true });