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

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

@@ -88,14 +88,14 @@ function getMonitor(deviceID) {
 }
 
 //清空数据
- function getClearList(){
-  listData.common={}
-  listData.bundletube.length=0
-  listData.fiber.length=0
-  listData.fire.length=0
-  listData.smoke.length=0
-  listData.spray.length=0
-  listData.temperature.length=0
+function getClearList() {
+  listData.common = {}
+  listData.bundletube.length = 0
+  listData.fiber.length = 0
+  listData.fire.length = 0
+  listData.smoke.length = 0
+  listData.spray.length = 0
+  listData.temperature.length = 0
 }
 
 async function onSubmit() {
@@ -112,14 +112,16 @@ function btnClick(ind) {
   switch (ind) {
     case 0:
       activeIndex1.value = 0;
-      menuList = menuList1.internal.map(el => {
-        return {
+      menuList.length = 0
+      current.value = '';
+      menuList1.internal.forEach(el => {
+        menuList.push({
           name: el.systemname,
           warn: '低风险',
           type: 'on',
           deviceID: el.id,
           strtype: el.strtype,
-        }
+        })
       })
       clearTimeout(timer)
       getClearList()
@@ -127,15 +129,18 @@ function btnClick(ind) {
       break;
     case 1:
       activeIndex1.value = 0;
+      menuList.length = 0
+      current.value = '';
       if (menuList1.external.length != 0) {
-        menuList = menuList1.external.map(el => {
-          return {
+        menuList1.external.forEach(el => {
+          menuList.push({
             name: el.systemname,
             warn: '低风险',
             type: 'out',
             deviceID: el.id,
             strtype: el.strtype,
-          }
+          })
+
         })
         clearTimeout(timer)
         getClearList()
@@ -155,6 +160,9 @@ function cardClick(ind, item) {
   strType.value = item.strtype
   clearTimeout(timer)
   getClearList()
+  if(props.moduleObj.moduleName=='fire'){
+    current.value=''
+  }
   getMonitor(item.deviceID)
 }
 
@@ -175,7 +183,6 @@ function loadZj() {
 //获取预警详情弹窗左侧数据
 function getSysTypeWarnList(data) {
   sysTypeWarnList({ type: data }).then((res) => {
-    menuList.length = 0;
     if (props.moduleObj.moduleName == 'vent') {
       res.forEach((el) => {
         menuList.push({
@@ -246,15 +253,15 @@ watch(
   () => props.moduleObj,
   (val) => {
     if (val.moduleName == 'fire') {
-      menuList.length=0
-      menuList1.external.length=0
-      menuList1.internal.length=0
+      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
+      menuList.length = 0
       current.value = '';
       titleName.value = '粉尘监测';
       isShowModule.value = false;
@@ -262,14 +269,14 @@ watch(
       getSysTypeWarnList('dust');
 
     } else if (val.moduleName == 'vent') {
-      menuList.length=0
+      menuList.length = 0
       current.value = '';
       titleName.value = '通风监测';
       isShowModule.value = false;
       current.value = 'ventilate';
       getSysTypeWarnList('vent');
     } else if (val.moduleName == 'gas') {
-      menuList.length=0
+      menuList.length = 0
       current.value = '';
       titleName.value = '瓦斯监测';
       isShowModule.value = false;