瀏覽代碼

158分站更新

lxh 2 周之前
父節點
當前提交
e4e80d237a
共有 2 個文件被更改,包括 619 次插入482 次删除
  1. 484 478
      src/views/vent/safetyList/common/detail.vue
  2. 135 4
      src/views/vent/safetyList/safetyList.data.ts

+ 484 - 478
src/views/vent/safetyList/common/detail.vue

@@ -179,7 +179,7 @@
         <!-- 监测详情 -->
         <div class="detail-content" v-if="activeKey == 'manageAuto'">
           <!-- <a-button preIcon="ant-design:sync-outlined" @click="visibleModalEdit1 = true">重置</a-button> -->
-          <a-table size="small" :scroll="{ y: 710 }" :columns="columnsDetail" :data-source="tableData1"
+          <a-table size="small" :scroll="{ y: 710 }" :row-key="(record)=>record.stationId" :expandedRowKeys="expandedRowKeys" :columns="columnsDetail" :data-source="tableData1"
             @expand="tableExpand">
             <template #action="{ record }">
               <a-button v-if="hasPermission('operateRecord:return') && record.deviceList" type="primary" size="small"
@@ -191,7 +191,7 @@
                 <template #action="{ record }"></template>
                 <template #bodyCell="{ column }"></template>
               </a-table>
-              </template>
+            </template>
           </a-table>
           <!-- 编辑弹窗 -->
           <a-modal v-model:visible="visibleModalEdit1" :width="1100" @cancel="cancenModal"
@@ -379,12 +379,13 @@ import {
   remove158Device
 } from '../safetyList.api';
 import { historyColumns } from '../historyLsit.data';
-import { columnsDetail, columns,deviceColumns } from '../safetyList.data';
+import { columnsDetail, columns, deviceColumns } from '../safetyList.data';
 import HistoryTable from './HistoryTable.vue';
 import customHeader from '/@/components/vent/customHeader.vue';
 import operateRecord from './operateRecord.vue'
 import dayjs from 'dayjs';
 
+let expandedRowKeys=reactive<any[]>([])
 const { hasPermission } = usePermission();
 let activeKey = ref('device');
 let cardList = ref<any[]>([]);
@@ -401,7 +402,7 @@ let openNum = ref(0);
 let clsoeNum = ref(0);
 let tableData = ref<any[]>([]);
 let tableData1 = ref<any[]>([]);
-let tableData2=ref<any[]>([])
+let tableData2 = ref<any[]>([])
 //分页参数配置
 let pagination = reactive({
   current: 1, // 当前页码
@@ -549,261 +550,292 @@ async function getShowReadList() {
   }
 }
 async function tableExpand(expaned, record) {
-  let res = await set158StationDevicesRead({ stationId: record.stationId })
-  if (res) {
+  let res=await set158StationDevicesRead({ stationId: record.stationId })
+  if(res && expaned){
+    expandedRowKeys.length=0
     let data = await get158StationData();
-    tableData2.value=data.filter(v=>v.stationId==record.stationId)[0].deviceList || []
+    tableData2.value = data.filter(v => v.stationId == record.stationId)[0].deviceList || []
+    expandedRowKeys.push(record.stationId)
+  }else {
+    expandedRowKeys.length=0
   }
-
 }
-//tab选项切换
-async function onChangeTab(tab) {
-  activeKey.value = tab;
-  stationId.value = ''
-  clearTimeout(timer1);
-  clearTimeout(timer);
-  if (activeKey.value == 'device') {
-    await getSubStationList();
-    await getStationList1();
-    getMonitor()
-  } else if (activeKey.value == 'history') {
-    await getSubStationList();
-    await getStationList();
-    getMonitor()
-  } else if (activeKey.value == 'manageAuto') {
-    await getStationList();
-    getMonitor1(true);
-  } else if (activeKey.value == 'operationRecord') {
-    await getSearchRecord({ stationId: '', deviceId: '' })
+
+  
+  //tab选项切换
+  async function onChangeTab(tab) {
+    activeKey.value = tab;
+    stationId.value = ''
+    clearTimeout(timer1);
+    clearTimeout(timer);
+    if (activeKey.value == 'device') {
+      await getSubStationList();
+      await getStationList1();
+      getMonitor()
+    } else if (activeKey.value == 'history') {
+      await getSubStationList();
+      await getStationList();
+      getMonitor()
+    } else if (activeKey.value == 'manageAuto') {
+      await getStationList();
+      getMonitor1(true);
+    } else if (activeKey.value == 'operationRecord') {
+      await getSearchRecord({ stationId: '', deviceId: '' })
+    }
   }
-}
 
-//弹窗关闭
-function cancenModal() {
-  clearTimeout(timer2)
-  formEdit.id = ''
-  formEdit.cgq = ''
-  formEdit.rs485modbusdz = ''
-  formEdit.ttazjl = ''
-  formEdit.jxjl = ''
-  formEdit.azjd = ''
-  formEdit.szsz = ''
-  formEdit.sjpjzq = ''
-  formEdit.dylyfesPGz = ''
-  formEdit.dylefysPGz = ''
-  formEdit.fdjmj = ''
-  formEdit.dylztxsk = ''
-  formEdit.dyldydxs1 = ''
-  formEdit.dyldedxs2 = ''
-  formEdit.dyldsdxs3 = ''
-  formEdit.dyldsdxs4 = ''
-  formEdit.dyldwdxs5 = ''
-  formEdit.dyldldxs6 = ''
-  formEdit.xsKB = ''
-  formEdit.xsKBfh = ''
-  formEdit.gbjyz = ''
-  formEdit.dbjyz = ''
-  formEdit.bjsn = ''
-  formEdit.dyl485btl = ''
-  formEdit.sgzjbcmm = ''
-
-  formView.dylfsfx = ''
-  formView.dylbjzt = ''
-  formView.dyl1f2sADz = ''
-  formView.dyl2f1sADz = ''
-  formView.tfl = ''
-  formView.yjbb = ''
-  formView.rjbb = ''
-  formView.zxlxbz = ''
-  formView.rqsj = ''
-}
-//获取详细信息列表
-async function getStationList() {
-  let res = await get158StationData();
-  res.forEach((el) => {
-    el.linkstatusC = el.linkstatus ? '连接' : '断开';
-    el.key=el.stationId
-  });
-  tableData1.value =res;
-}
-//传感器选项切换
-function changeCgq(val) {
-  formEdit.cgq = val;
-}
-//编辑
-async function handleEdit(record) {
-  cgqList.length = 0;
-  visibleModalEdit1.value = true;
-  devStationId.value = record.stationId;
-  let res = await get158StationDevices({ stationId: devStationId.value });
-  console.log(res, '分站下设备下拉选项-------------');
-  if (res.length != 0) {
+  //弹窗关闭
+  function cancenModal() {
+    clearTimeout(timer2)
+    formEdit.id = ''
+    formEdit.cgq = ''
+    formEdit.rs485modbusdz = ''
+    formEdit.ttazjl = ''
+    formEdit.jxjl = ''
+    formEdit.azjd = ''
+    formEdit.szsz = ''
+    formEdit.sjpjzq = ''
+    formEdit.dylyfesPGz = ''
+    formEdit.dylefysPGz = ''
+    formEdit.fdjmj = ''
+    formEdit.dylztxsk = ''
+    formEdit.dyldydxs1 = ''
+    formEdit.dyldedxs2 = ''
+    formEdit.dyldsdxs3 = ''
+    formEdit.dyldsdxs4 = ''
+    formEdit.dyldwdxs5 = ''
+    formEdit.dyldldxs6 = ''
+    formEdit.xsKB = ''
+    formEdit.xsKBfh = ''
+    formEdit.gbjyz = ''
+    formEdit.dbjyz = ''
+    formEdit.bjsn = ''
+    formEdit.dyl485btl = ''
+    formEdit.sgzjbcmm = ''
+
+    formView.dylfsfx = ''
+    formView.dylbjzt = ''
+    formView.dyl1f2sADz = ''
+    formView.dyl2f1sADz = ''
+    formView.tfl = ''
+    formView.yjbb = ''
+    formView.rjbb = ''
+    formView.zxlxbz = ''
+    formView.rqsj = ''
+  }
+  //获取详细信息列表
+  async function getStationList() {
+    let res = await get158StationData();
     res.forEach((el) => {
-      cgqList.push({ label: el.strinstallpos, value: el.id });
+      el.linkstatusC = el.linkstatus ? '连接' : '断开';
+      el.key = el.stationId
     });
+    tableData1.value = res;
+  }
+  //传感器选项切换
+  function changeCgq(val) {
+    formEdit.cgq = val;
+  }
+  //编辑
+  async function handleEdit(record) {
+    cgqList.length = 0;
+    visibleModalEdit1.value = true;
+    devStationId.value = record.stationId;
+    let res = await get158StationDevices({ stationId: devStationId.value });
+    console.log(res, '分站下设备下拉选项-------------');
+    if (res.length != 0) {
+      res.forEach((el) => {
+        cgqList.push({ label: el.strinstallpos, value: el.id });
+      });
+    }
   }
-}
 
-//下发
-async function handleClick(data) {
-  switch (data) {
-    case 'RS485_MODBUS地址':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'rs485modbusdz', value: formEdit.rs485modbusdz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '探头安装距离':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'ttazjl', value: formEdit.ttazjl });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '基线距离':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'jxjl', value: formEdit.jxjl });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '安装角度':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'azjd', value: formEdit.azjd });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '设置时长':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'szsz', value: formEdit.szsz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '数据平均周期':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sjpjzq', value: formEdit.sjpjzq });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路一发二收PG值':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylyfesPGz', value: formEdit.dylyfesPGz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路二发一收PG值':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylefysPGz', value: formEdit.dylefysPGz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '风道截面积':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'fdjmj', value: formEdit.fdjmj });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路整体系数k':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylztxsk', value: formEdit.dylztxsk });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第一段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldydxs1', value: formEdit.dyldydxs1 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第二段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldedxs2', value: formEdit.dyldedxs2 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第三段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs3', value: formEdit.dyldsdxs3 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第四段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs4', value: formEdit.dyldsdxs4 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第五段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldwdxs5', value: formEdit.dyldwdxs5 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路第六段系数':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldldxs6', value: formEdit.dyldldxs6 });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '系数KB':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKB', value: formEdit.xsKB });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '系数KB符号':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKBfh', value: formEdit.xsKBfh });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '高报警阈值':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'gbjyz', value: formEdit.gbjyz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '低报警阈值':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dbjyz', value: formEdit.dbjyz });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '报警使能':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'bjsn', value: formEdit.bjsn });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '第一路485波特率':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyl485btl', value: formEdit.dyl485btl });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
-    case '四个字节保存密码':
-      await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sgzjbcmm', value: formEdit.sgzjbcmm });
-      visibleModalEdit1.value = false;
-      getStationList();
-      break;
+  //下发
+  async function handleClick(data) {
+    switch (data) {
+      case 'RS485_MODBUS地址':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'rs485modbusdz', value: formEdit.rs485modbusdz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '探头安装距离':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'ttazjl', value: formEdit.ttazjl });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '基线距离':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'jxjl', value: formEdit.jxjl });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '安装角度':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'azjd', value: formEdit.azjd });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '设置时长':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'szsz', value: formEdit.szsz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '数据平均周期':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sjpjzq', value: formEdit.sjpjzq });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路一发二收PG值':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylyfesPGz', value: formEdit.dylyfesPGz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路二发一收PG值':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylefysPGz', value: formEdit.dylefysPGz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '风道截面积':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'fdjmj', value: formEdit.fdjmj });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路整体系数k':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dylztxsk', value: formEdit.dylztxsk });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第一段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldydxs1', value: formEdit.dyldydxs1 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第二段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldedxs2', value: formEdit.dyldedxs2 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第三段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs3', value: formEdit.dyldsdxs3 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第四段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldsdxs4', value: formEdit.dyldsdxs4 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第五段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldwdxs5', value: formEdit.dyldwdxs5 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路第六段系数':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyldldxs6', value: formEdit.dyldldxs6 });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '系数KB':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKB', value: formEdit.xsKB });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '系数KB符号':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'xsKBfh', value: formEdit.xsKBfh });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '高报警阈值':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'gbjyz', value: formEdit.gbjyz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '低报警阈值':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dbjyz', value: formEdit.dbjyz });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '报警使能':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'bjsn', value: formEdit.bjsn });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '第一路485波特率':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'dyl485btl', value: formEdit.dyl485btl });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+      case '四个字节保存密码':
+        await set158StationData({ stationId: devStationId.value, deviceId: formEdit.cgq, plcCode: 'sgzjbcmm', value: formEdit.sgzjbcmm });
+        visibleModalEdit1.value = false;
+        getStationList();
+        break;
+    }
   }
-}
 
-//获取分站实时监测信息
-async function getSubStationList() {
-  let res = await subStationList({ strtype: 'modbus' });
-  if (res.length != 0) {
-    cardList.value = res;
-    stationId.value = stationId.value ? stationId.value : cardList.value[0].id
-    openNum.value = cardList.value?.filter((v) => v.linkstatus == 1)['length'];
-    clsoeNum.value = cardList.value?.filter((v) => v.linkstatus == 0)['length'];
-  } else {
-    cardList.value = [];
+  //获取分站实时监测信息
+  async function getSubStationList() {
+    let res = await subStationList({ strtype: 'modbus' });
+    if (res.length != 0) {
+      cardList.value = res;
+      stationId.value = stationId.value ? stationId.value : cardList.value[0].id
+      openNum.value = cardList.value?.filter((v) => v.linkstatus == 1)['length'];
+      clsoeNum.value = cardList.value?.filter((v) => v.linkstatus == 0)['length'];
+    } else {
+      cardList.value = [];
+    }
   }
-}
-//分站站点选项点击
-function cardClick(item, index) {
-  selectedIndex.value = index; // 更新选中索引
-  activeIndex.value = item.isNewAccess || !item.linkstatus ? index : null;
-  stationName.value = item.strname;
-  stationStatus.value = item.linkstatus;
-  stationId.value = item.id;
-  isShow.value = true;
-  getStationList1();
-}
-//分站站点名称编辑
-function changeName(val) {
-  getChangeStation();
-}
-async function getChangeStation() {
-  let res = await getEdit({ id: stationId.value, strname: stationName.value, linkstatus: stationStatus.value });
-  getSubStationList();
-  isShow.value = false;
-}
-//站点连接状态修改
-function changeStatus(val) {
-  getChangeStation();
-}
-//获取详细信息列表
-async function getStationList1() {
-  let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize });
-  if (res && res.length != 0) {
+  //分站站点选项点击
+  function cardClick(item, index) {
+    selectedIndex.value = index; // 更新选中索引
+    activeIndex.value = item.isNewAccess || !item.linkstatus ? index : null;
+    stationName.value = item.strname;
+    stationStatus.value = item.linkstatus;
+    stationId.value = item.id;
+    isShow.value = true;
+    getStationList1();
+  }
+  //分站站点名称编辑
+  function changeName(val) {
+    getChangeStation();
+  }
+  async function getChangeStation() {
+    let res = await getEdit({ id: stationId.value, strname: stationName.value, linkstatus: stationStatus.value });
+    getSubStationList();
+    isShow.value = false;
+  }
+  //站点连接状态修改
+  function changeStatus(val) {
+    getChangeStation();
+  }
+  //获取详细信息列表
+  async function getStationList1() {
+    let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize });
+    if (res && res.length != 0) {
+      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.children = el.devInfoList;
+        el.children.forEach((v) => {
+          v.key = v.id;
+          v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? '调试' : '';
+          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;
+  }
+  async function getStationListAll() {
+    let res = await getListAll();
     res.forEach((el) => {
       el.key = el.id;
       el.linkIdC = el.linkId || '';
@@ -823,253 +855,227 @@ async function getStationList1() {
           }Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`;
       });
     });
+    tableData.value = res;
+    // pagination.total = res.total;
   }
-
-  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.children = el.devInfoList;
-    el.children.forEach((v) => {
-      v.key = v.id;
-      v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? '调试' : '';
-      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 = '';
-  getStationListAll();
-}
-//启动新设备
-async function handlerunDeviceMonitor(record, val) {
-  devId.value = record.id;
-  switch (val) {
-    case '编辑':
-      visibleModalEdit.value = true;
-      startupDataEdit.address = record.strinstallpos;
-      paramId.value = record.devInfoList ? 'subId' : 'devId';
-      break;
-    case '启动':
-      visibleModal.value = true;
-      startupData.address = record.strinstallpos;
-      break;
-    case '删除':
-      await remove158Device({ devId: devId.value })
-      getStationList1()
-      break;
+  //显示全部
+  function getAllShow() {
+    // pagination.current = 1;
+    // stationId.value = '';
+    getStationListAll();
   }
-}
-//分站,设备调试
-function debugClick(record) {
-  if (record.debugTitle == '调试') {
-    //正在调试中
-    startupDataDebug.speed = '';
-    startupDataDebug.direction = '';
-    visibleModalDebug.value = true;
-    debugFlag.value = 'device';
-    debugDeviceId.value = record.id;
-    tableData.value.forEach((el) => {
-      el.devInfoList.forEach((v) => {
-        if (v.id == debugDeviceId.value) {
-          debugStationId.value = el.id;
-        }
+  //启动新设备
+  async function handlerunDeviceMonitor(record, val) {
+    devId.value = record.id;
+    switch (val) {
+      case '编辑':
+        visibleModalEdit.value = true;
+        startupDataEdit.address = record.strinstallpos;
+        paramId.value = record.devInfoList ? 'subId' : 'devId';
+        break;
+      case '启动':
+        visibleModal.value = true;
+        startupData.address = record.strinstallpos;
+        break;
+      case '删除':
+        await remove158Device({ devId: devId.value })
+        getStationList1()
+        break;
+    }
+  }
+  //分站,设备调试
+  function debugClick(record) {
+    if (record.debugTitle == '调试') {
+      //正在调试中
+      startupDataDebug.speed = '';
+      startupDataDebug.direction = '';
+      visibleModalDebug.value = true;
+      debugFlag.value = 'device';
+      debugDeviceId.value = record.id;
+      tableData.value.forEach((el) => {
+        el.devInfoList.forEach((v) => {
+          if (v.id == debugDeviceId.value) {
+            debugStationId.value = el.id;
+          }
+        });
       });
-    });
-    record.debugTitle = '结束调试';
-    // if (record.devInfoList) {
-    //     debugFlag.value = 'station'
-    //     debugStationId.value = record.id
-    //     tableData.value.forEach(el => {
-    //         el.debugTitle = '结束调试'
-    //         el.devInfoList.forEach(v => {
-    //             v.debugTitle = '结束调试'
-    //         })
-    //     })
-    // } else {
-    //     debugFlag.value = 'device'
-    //     debugDeviceId.value = record.id
-    //     tableData.value.forEach(el => {
-    //         el.devInfoList.forEach(v => {
-    //             if (v.id == debugDeviceId.value) {
-    //                 debugStationId.value = el.id
-    //             }
-    //         })
-    //     })
-    //     record.debugTitle = '结束调试'
-    // }
-  } else if (record.debugTitle == '结束调试') {
-    debugFlag.value = 'device';
-    debugDeviceId.value = record.id;
-    tableData.value.forEach((el) => {
-      el.devInfoList.forEach((v) => {
-        if (v.id == debugDeviceId.value) {
-          debugStationId.value = el.id;
-        }
+      record.debugTitle = '结束调试';
+      // if (record.devInfoList) {
+      //     debugFlag.value = 'station'
+      //     debugStationId.value = record.id
+      //     tableData.value.forEach(el => {
+      //         el.debugTitle = '结束调试'
+      //         el.devInfoList.forEach(v => {
+      //             v.debugTitle = '结束调试'
+      //         })
+      //     })
+      // } else {
+      //     debugFlag.value = 'device'
+      //     debugDeviceId.value = record.id
+      //     tableData.value.forEach(el => {
+      //         el.devInfoList.forEach(v => {
+      //             if (v.id == debugDeviceId.value) {
+      //                 debugStationId.value = el.id
+      //             }
+      //         })
+      //     })
+      //     record.debugTitle = '结束调试'
+      // }
+    } else if (record.debugTitle == '结束调试') {
+      debugFlag.value = 'device';
+      debugDeviceId.value = record.id;
+      tableData.value.forEach((el) => {
+        el.devInfoList.forEach((v) => {
+          if (v.id == debugDeviceId.value) {
+            debugStationId.value = el.id;
+          }
+        });
       });
-    });
-    record.debugTitle = '调试';
-    stopDebug();
-    // if (record.devInfoList) {
-    //     debugFlag.value = 'station'
-    //     debugStationId.value = record.id
-    //     tableData.value.forEach(el => {
-    //         el.debugTitle = '调试'
-    //         el.devInfoList.forEach(v => {
-    //             v.debugTitle = '调试'
-    //         })
-    //     })
-    //     stopDebug()
+      record.debugTitle = '调试';
+      stopDebug();
+      // if (record.devInfoList) {
+      //     debugFlag.value = 'station'
+      //     debugStationId.value = record.id
+      //     tableData.value.forEach(el => {
+      //         el.debugTitle = '调试'
+      //         el.devInfoList.forEach(v => {
+      //             v.debugTitle = '调试'
+      //         })
+      //     })
+      //     stopDebug()
+      // } else {
+      //     debugFlag.value = 'device'
+      //     debugDeviceId.value = record.id
+      //     tableData.value.forEach(el => {
+      //         el.devInfoList.forEach(v => {
+      //             if (v.id == debugDeviceId.value) {
+      //                 debugStationId.value = el.id
+      //             }
+      //         })
+      //     })
+      //     record.debugTitle = '调试'
+      //     stopDebug()
+      // }
+    }
+  }
+  //停止调试
+  async function stopDebug() {
+    let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' });
+    if (res) {
+      getStationList1();
+    }
+    // if (debugFlag.value == 'station') {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, debugFlag: '0' })
+    //     getStationList1()
     // } else {
-    //     debugFlag.value = 'device'
-    //     debugDeviceId.value = record.id
-    //     tableData.value.forEach(el => {
-    //         el.devInfoList.forEach(v => {
-    //             if (v.id == debugDeviceId.value) {
-    //                 debugStationId.value = el.id
-    //             }
-    //         })
-    //     })
-    //     record.debugTitle = '调试'
-    //     stopDebug()
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' })
+    //     getStationList1()
     // }
   }
-}
-//停止调试
-async function stopDebug() {
-  let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' });
-  if (res) {
-    getStationList1();
+  async function handleOk() {
+    let res = await runDeviceMonitor({ devId: devId.value, devName: startupData.address });
+    visibleModal.value = false;
+    getStationList1({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize });
   }
-  // if (debugFlag.value == 'station') {
-  //     let res = await updateDebugStatus({ stationId: debugStationId.value, debugFlag: '0' })
-  //     getStationList1()
-  // } else {
-  //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, debugFlag: '0' })
-  //     getStationList1()
-  // }
-}
-async function handleOk() {
-  let res = await runDeviceMonitor({ devId: devId.value, devName: startupData.address });
-  visibleModal.value = false;
-  getStationList1({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize });
-}
-function handleCancel() {
-  visibleModal.value = false;
-  startupData.address = '';
-}
-//编辑
-async function handleOkEdit() {
-  if (paramId.value == 'subId') {
-    let res = await update158DevName({ subId: devId.value, devName: startupDataEdit.address });
-    console.log(res, '设备名称编辑---');
-    visibleModalEdit.value = false;
-    getStationList1();
-  } else {
-    let res = await update158DevName({ devId: devId.value, devName: startupDataEdit.address });
-    console.log(res, '设备名称编辑---');
+  function handleCancel() {
+    visibleModal.value = false;
+    startupData.address = '';
+  }
+  //编辑
+  async function handleOkEdit() {
+    if (paramId.value == 'subId') {
+      let res = await update158DevName({ subId: devId.value, devName: startupDataEdit.address });
+      console.log(res, '设备名称编辑---');
+      visibleModalEdit.value = false;
+      getStationList1();
+    } else {
+      let res = await update158DevName({ devId: devId.value, devName: startupDataEdit.address });
+      console.log(res, '设备名称编辑---');
+      visibleModalEdit.value = false;
+      getStationList1();
+    }
+  }
+  //取消编辑
+  function handleCancelEdit() {
     visibleModalEdit.value = false;
-    getStationList1();
+    startupDataEdit.address = '';
   }
-}
-//取消编辑
-function handleCancelEdit() {
-  visibleModalEdit.value = false;
-  startupDataEdit.address = '';
-}
-//调试确认
-async function handleOkDebug() {
-  let res = await updateDebugStatus({
-    stationId: debugStationId.value,
-    deviceId: debugDeviceId.value,
-    speed: startupDataDebug.speed,
-    direction: startupDataDebug.direction,
-    debugFlag: '1',
-  });
-  if (res) {
-    visibleModalDebug.value = false;
-    getStationList1();
+  //调试确认
+  async function handleOkDebug() {
+    let res = await updateDebugStatus({
+      stationId: debugStationId.value,
+      deviceId: debugDeviceId.value,
+      speed: startupDataDebug.speed,
+      direction: startupDataDebug.direction,
+      debugFlag: '1',
+    });
+    if (res) {
+      visibleModalDebug.value = false;
+      getStationList1();
+    }
+    // if (debugFlag.value == 'station') {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    //     visibleModalDebug.value = false
+    //     getStationList1()
+    // } else {
+    //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
+    //     visibleModalDebug.value = false
+    //     getStationList1()
+    // }
   }
-  // if (debugFlag.value == 'station') {
-  //     let res = await updateDebugStatus({ stationId: debugStationId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
-  //     visibleModalDebug.value = false
-  //     getStationList1()
-  // } else {
-  //     let res = await updateDebugStatus({ stationId: debugStationId.value, deviceId: debugDeviceId.value, speed: startupDataDebug.speed, direction: startupDataDebug.direction, debugFlag: '1' })
-  //     visibleModalDebug.value = false
-  //     getStationList1()
-  // }
-}
-//调试取消
-function handleCancelDebug() {
-  visibleModalDebug.value = false;
-  tableData.value.forEach((el) => {
-    el.devInfoList.forEach((v) => {
-      v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? '调试' : '';
+  //调试取消
+  function handleCancelDebug() {
+    visibleModalDebug.value = false;
+    tableData.value.forEach((el) => {
+      el.devInfoList.forEach((v) => {
+        v.debugTitle = v.deviceType == 'windrect_ds_25x' || v.deviceType == 'windrect_ds_two' ? '调试' : '';
+      });
     });
-  });
-  debugFlag.value = '';
-  debugStationId.value = '';
-  debugDeviceId.value = '';
-}
-//分页切换
-function pageChange(val) {
-  pagination.current = val.current;
-  pagination.pageSize = val.pageSize;
-  getStationList1();
-}
-
-//删除左侧分站
-async function handleDelStation() {
-  let res = await remove158Substation({ stationId: stationId.value })
-  console.log(res, '删除左侧分站')
-  if (res) {
-    getSubStationList();
-    getStationList1();
+    debugFlag.value = '';
+    debugStationId.value = '';
+    debugDeviceId.value = '';
   }
-}
-//取消删除左侧分站
-function handleCancelDelStation() { }
-
-//操作记录查询
-async function getSearchRecord(param) {
-  let res = await get158SetLog({ ...param })
-  if (res && res.length != 0) {
-    operationData.value = res.records
+  //分页切换
+  function pageChange(val) {
+    pagination.current = val.current;
+    pagination.pageSize = val.pageSize;
+    getStationList1();
   }
-}
-onMounted(async () => {
-  await getSubStationList();
-  await getStationList1();
-  getMonitor()
-});
-onUnmounted(() => {
-  if (timer) {
-    clearTimeout(timer);
-    timer = undefined;
+
+  //删除左侧分站
+  async function handleDelStation() {
+    let res = await remove158Substation({ stationId: stationId.value })
+    console.log(res, '删除左侧分站')
+    if (res) {
+      getSubStationList();
+      getStationList1();
+    }
   }
-  if (timer1) {
-    clearTimeout(timer1);
-    timer1 = undefined;
+  //取消删除左侧分站
+  function handleCancelDelStation() { }
+
+  //操作记录查询
+  async function getSearchRecord(param) {
+    let res = await get158SetLog({ ...param })
+    if (res && res.length != 0) {
+      operationData.value = res.records
+    }
   }
-});
+  onMounted(async () => {
+    await getSubStationList();
+    await getStationList1();
+    getMonitor()
+  });
+  onUnmounted(() => {
+    if (timer) {
+      clearTimeout(timer);
+      timer = undefined;
+    }
+    if (timer1) {
+      clearTimeout(timer1);
+      timer1 = undefined;
+    }
+  });
 </script>
 
 <style lang="less" scoped>

+ 135 - 4
src/views/vent/safetyList/safetyList.data.ts

@@ -240,11 +240,142 @@ export const deviceColumns: BasicColumn[] = [
     align: 'center',
   },
   {
-    title: '操作',
-    dataIndex: 'action',
-    width: 150,
+    title: 'RS485_MODBUS地址',
+    dataIndex: 'rs485modbusdz',
+    key: 'rs485modbusdz',
+    align: 'center',
+  },
+  {
+    title: '探头安装距离',
+    dataIndex: 'ttazjl',
+    key: 'ttazjl',
+    align: 'center',
+  },
+  {
+    title: '基线距离',
+    dataIndex: 'jxjl',
+    key: 'jxjl',
+    align: 'center',
+  },
+  {
+    title: '安装角度',
+    dataIndex: 'azjd',
+    key: 'azjd',
+    align: 'center',
+  },
+  {
+    title: '设置时长',
+    dataIndex: 'szsz',
+    key: 'szsz',
+    align: 'center',
+  },
+  {
+    title: '数据平均周期',
+    dataIndex: 'sjpjzq',
+    key: 'sjpjzq',
+    align: 'center',
+  },
+  {
+    title: '第一路一发二收PG值',
+    dataIndex: 'dylyfesPGz',
+    key: 'dylyfesPGz',
+    align: 'center',
+  },
+  {
+    title: '第一路二发一收PG值',
+    dataIndex: 'dylefysPGz',
+    key: 'dylefysPGz',
+    align: 'center',
+  },
+  {
+    title: '风道截面积',
+    dataIndex: 'fdjmj',
+    key: 'fdjmj',
+    align: 'center',
+  },
+  {
+    title: '第一路整体系数k',
+    dataIndex: 'dylztxsk',
+    key: 'dylztxsk',
+    align: 'center',
+  },
+  {
+    title: '第一路第一段系数',
+    dataIndex: 'dyldydxs1',
+    key: 'dyldydxs1',
+    align: 'center',
+  },
+  {
+    title: '第一路第二段系数',
+    dataIndex: 'dyldedxs2',
+    key: 'dyldedxs2',
+    align: 'center',
+  },
+  {
+    title: '第一路第三段系数',
+    dataIndex: 'dyldsdxs3',
+    key: 'dyldsdxs3',
+    align: 'center',
+  },
+  {
+    title: '第一路第四段系数',
+    dataIndex: 'dyldsdxs4',
+    key: 'dyldsdxs4',
+    align: 'center',
+  },
+  {
+    title: '第一路第五段系数',
+    dataIndex: 'dyldwdxs5',
+    key: 'dyldwdxs5',
+    align: 'center',
+  },
+  {
+    title: '第一路第六段系数',
+    dataIndex: 'dyldldxs6',
+    key: 'dyldldxs6',
+    align: 'center',
+  },
+  {
+    title: '系数KB',
+    dataIndex: 'xsKB',
+    key: 'xsKB',
+    align: 'center',
+  },
+  {
+    title: '系数KB符号',
+    dataIndex: 'xsKBfh',
+    key: 'xsKBfh',
+    align: 'center',
+  },
+  {
+    title: '高报警阈值',
+    dataIndex: 'gbjyz',
+    key: 'gbjyz',
+    align: 'center',
+  },
+  {
+    title: '低报警阈值',
+    dataIndex: 'dbjyz',
+    key: 'dbjyz',
+    align: 'center',
+  },
+  {
+    title: '报警使能',
+    dataIndex: 'bjsn',
+    key: 'bjsn',
+    align: 'center',
+  },
+  {
+    title: '第一路485波特率',
+    dataIndex: 'dyl485btl',
+    key: 'dyl485btl',
+    align: 'center',
+  },
+  {
+    title: '四个字节保存密码',
+    dataIndex: 'sgzjbcmm',
+    key: 'sgzjbcmm',
     align: 'center',
-    slots: { customRender: 'action' },
   },
 ];