lxh пре 1 година
родитељ
комит
53097db4de
1 измењених фајлова са 21 додато и 11 уклоњено
  1. 21 11
      src/views/vent/monitorManager/alarmMonitor/DetailModalFire.vue

+ 21 - 11
src/views/vent/monitorManager/alarmMonitor/DetailModalFire.vue

@@ -87,8 +87,8 @@ function getMonitor(deviceID) {
   );
 }
 
-async function onSubmit() {
-  activeIndex1.value = 0;
+//清空数据
+ function getClearList(){
   listData.common={}
   listData.bundletube.length=0
   listData.fiber.length=0
@@ -96,7 +96,12 @@ async function onSubmit() {
   listData.smoke.length=0
   listData.spray.length=0
   listData.temperature.length=0
-  clearInterval(timer)
+}
+
+async function onSubmit() {
+  activeIndex1.value = 0;
+  getClearList()
+  clearTimeout(timer)
   emit('close');
   closeModal();
 
@@ -116,7 +121,8 @@ function btnClick(ind) {
           strtype: el.strtype,
         }
       })
-      clearInterval(timer)
+      clearTimeout(timer)
+      getClearList()
       getMonitor(menuList[0].deviceID)
       break;
     case 1:
@@ -131,12 +137,13 @@ function btnClick(ind) {
             strtype: el.strtype,
           }
         })
-        clearInterval(timer)
+        clearTimeout(timer)
+        getClearList()
         getMonitor(menuList[0].deviceID)
         strType.value = menuList[0].strtype
       } else {
         menuList.length = 0
-        clearInterval(timer)
+        clearTimeout(timer)
         current.value = ''
       }
       break;
@@ -146,7 +153,8 @@ function btnClick(ind) {
 function cardClick(ind, item) {
   activeIndex1.value = ind;
   strType.value = item.strtype
-  clearInterval(timer)
+  clearTimeout(timer)
+  getClearList()
   getMonitor(item.deviceID)
 }
 
@@ -178,7 +186,6 @@ function getSysTypeWarnList(data) {
           strtype: el.deviceType
         });
       });
-      clearInterval(timer)
       getMonitor(menuList[0].deviceID);
     } else if (props.moduleObj.moduleName == 'fire') {
       menuList1.external = res.external
@@ -192,7 +199,6 @@ function getSysTypeWarnList(data) {
           strtype: el.strtype
         });
       })
-      clearInterval(timer)
       getMonitor(menuList[0].deviceID);
     } else if (props.moduleObj.moduleName == 'dust') {
       res.forEach((el) => {
@@ -204,7 +210,6 @@ function getSysTypeWarnList(data) {
           strtype: el.strtype
         });
       });
-      clearInterval(timer)
       getMonitor(menuList[0].deviceID);
     } else if (props.moduleObj.moduleName == 'gas') {
       res.forEach((el) => {
@@ -216,7 +221,6 @@ function getSysTypeWarnList(data) {
           strtype: el.strtype
         });
       });
-      clearInterval(timer)
       getMonitor(menuList[0].deviceID);
     }
   });
@@ -242,11 +246,15 @@ watch(
   () => props.moduleObj,
   (val) => {
     if (val.moduleName == 'fire') {
+      menuList.length=0
+      menuList1.external.length=0
+      menuList1.internal.length=0
       current.value = '';
       titleName.value = '火灾监测';
       isShowModule.value = true;
       getSysTypeWarnList('fire');
     } else if (val.moduleName == 'dust') {
+      menuList.length=0
       current.value = '';
       titleName.value = '粉尘监测';
       isShowModule.value = false;
@@ -254,12 +262,14 @@ watch(
       getSysTypeWarnList('dust');
 
     } else if (val.moduleName == 'vent') {
+      menuList.length=0
       current.value = '';
       titleName.value = '通风监测';
       isShowModule.value = false;
       current.value = 'ventilate';
       getSysTypeWarnList('vent');
     } else if (val.moduleName == 'gas') {
+      menuList.length=0
       current.value = '';
       titleName.value = '瓦斯监测';
       isShowModule.value = false;