lxh 1 день тому
батько
коміт
5f22257621

+ 2 - 2
src/views/vent/safetyList/common/detail-130.vue

@@ -5,8 +5,8 @@
       <a-tabs class="tab-box" v-model:activeKey="activeKey" @change="onChangeTab">
         <a-tab-pane tab="分站监测" key="device" />
         <!-- <a-tab-pane tab="历史数据" key="history" /> -->
-        <!-- <a-tab-pane tab="监测详情" key="manageAuto" /> -->
-        <!-- <a-tab-pane tab="操作记录" key="operationRecord" /> -->
+        <a-tab-pane tab="监测详情" key="manageAuto" />
+        <a-tab-pane tab="操作记录" key="operationRecord" />
       </a-tabs>
       <div class="box-content">
         <!-- 分站监测 -->

+ 19 - 4
src/views/vent/safetyList/common/detail.vue

@@ -556,6 +556,19 @@ function getMonitor2(flag = false) {
     flag ? 0 : 3000
   );
 }
+let timer3: null | NodeJS.Timeout = null;
+function getMonitor3(flag = false) {
+  timer3 = setTimeout(
+    async () => {
+      await getStationListAll();
+      if (timer3) {
+        timer3 = null;
+      }
+      getMonitor3();
+    },
+    flag ? 0 : 3000
+  );
+}
 async function getDeviceList() {
   let res = await set158StationRead({ stationId: devStationId.value, deviceId: formEdit.cgq });
   if (res) {
@@ -799,7 +812,7 @@ async function handleClick(data) {
 
 //获取分站实时监测信息
 async function getSubStationList() {
-  let res = await subStationList({ strtype: 'modbus',reqparam:'158' });
+  let res = await subStationList({ strtype: 'modbus', reqparam: '158' });
   if (res.length != 0) {
     cardList.value = res;
     stationId.value = stationId.value ? stationId.value : cardList.value[0].id
@@ -811,6 +824,7 @@ async function getSubStationList() {
 }
 //分站站点选项点击
 function cardClick(item, index) {
+  clearTimeout(timer3)
   selectedIndex.value = index; // 更新选中索引
   activeIndex.value = item.isNewAccess || !item.linkstatus ? index : null;
   stationName.value = item.strname;
@@ -818,6 +832,7 @@ function cardClick(item, index) {
   stationId.value = item.id;
   isShow.value = true;
   getStationList1();
+  getMonitor()
 }
 //分站站点名称编辑
 function changeName(val) {
@@ -886,9 +901,9 @@ async function getStationListAll() {
 }
 //显示全部
 function getAllShow() {
-  // pagination.current = 1;
-  // stationId.value = '';
-  getStationListAll();
+  clearTimeout(timer)
+  getStationListAll()
+  getMonitor3()
 }
 //启动新设备
 async function handlerunDeviceMonitor(record, val) {