Преглед изворни кода

通风预警监测修改-提交

lxh пре 2 месеци
родитељ
комит
da2a0b940a

+ 12 - 7
src/views/vent/monitorManager/alarmMonitor/warn/fireWarn.vue

@@ -128,7 +128,6 @@ function btnClick(ind) {
   activeIndex.value = ind;
   switch (ind) {
     case 0:
-      
       loading.value = true;
     setTimeout(() => {
    activeIndex1.value = 0;
@@ -178,8 +177,6 @@ function btnClick(ind) {
     }, 1000);
       break;
     case 2:
-      loading.value = true;
-    setTimeout(() => {
       clearTimeout(timer);
       menuList.length = 0;
       activeIndex1.value = 0;
@@ -191,15 +188,15 @@ function btnClick(ind) {
           strtype: '',
         });
       });
-      tableLists.value = menuList1.info[0].list;
       loadZb();
-      loading.value = false;
-    }, 1000);
       break;
   }
 }
 //加载预警指标组件
 function loadZb() {
+  loading.value = true;
+    setTimeout(() => {
+      tableLists.value = menuList1.info[0].list;
   const { sysOrgCode } = useGlobSetting();
   switch (sysOrgCode) {
     case 'sdmtjtbdmk': // 宝德
@@ -210,8 +207,11 @@ function loadZb() {
       return currentLoad.value;
     default:
       currentLoad.value = 'warnFireBrt';
+        loading.value = false;
       return currentLoad.value;
   }
+    }, 1000);
+ 
 }
 //菜单选项切换
 function cardClick(ind, item) {
@@ -227,9 +227,14 @@ function cardClick(ind, item) {
       loading.value = false;
     }, 1000);
   } else {
-    clearTimeout(timer);
+    loading.value = true;
+    setTimeout(() => {
+      clearTimeout(timer);
     activeIndex1.value = ind;
     tableLists.value = menuList1.info[ind].list;
+      loading.value = false;
+    }, 1000);
+   
   }
 }
 //加载组件

+ 71 - 11
src/views/vent/monitorManager/alarmMonitor/warn/ventilateWarn.vue

@@ -18,10 +18,16 @@
           </div>
         </div>
         <div class="card-btn">
-          <div :class="activeIndex1 == ind ? 'btn1' : 'btn'" v-for="(item, ind) in menuList" :key="ind"
-            @click="cardClick(ind, item)">
-            <div class="text">{{ item.name }}</div>
-            <div class="warn">{{ item.warn }}</div>
+          <div style="width:100%;height:100%" v-if="menuList.length">
+            <div :class="activeIndex1 == ind ? 'btn1' : 'btn'" v-for="(item, ind) in menuList" :key="ind"
+              @click="cardClick(ind, item)">
+              <div class="text">{{ item.name }}</div>
+              <div class="warn">{{ item.warn }}</div>
+            </div>
+          </div>
+          <div v-else class="hd-content">
+            <div class="hd-content-text">{{hdData.address}}</div>
+            <div class="hd-content-val">{{hdData.maxLevel}}</div>
           </div>
         </div>
       </div>
@@ -90,6 +96,11 @@ import { ventTunColumns } from '../alarm.data';
 import { realTimeNetCal } from '../alarm.api';
 // import moment from 'moment';
 
+//巷道阻力分析数据
+let hdData=reactive({
+  maxLevel:'',
+  address:'',
+})
 //通风选项激活索引
 let activeIndex = ref(0);
 let monitor = ref(true);
@@ -125,18 +136,19 @@ const echartDataFc1 = reactive<any>({
 let cardListTf = ref<any[]>([]);
 const chartListTf = ref<any[]>([]);
 let showToggle = ref('');
-//内外因火灾、预警指标选项切换
+//通风选项切换
 function btnClick(ind) {
   activeIndex.value = ind;
   switch (ind) {
     case 0:
-    if (timer1) clearTimeout(timer1);
-    activeIndex1.value=0
+      if (timer1) clearTimeout(timer1);
+      activeIndex1.value = 0
       getMenuList()
       break;
     case 1:
       if (timer) clearTimeout(timer);
-      activeIndex1.value=0
+      activeIndex1.value = 0
+      menuList.length = 0
       getRealTimeNetData()
       getMonitor1()
       break;
@@ -358,8 +370,31 @@ async function getWindDeviceList() {
 }
 async function getRealTimeNetData() {
   const res = await realTimeNetCal({ modelID: '8110' });
-  debugger;
   if (res && res['result']) ventTunDataSource.value = res['result']['tuns'];
+  let data=[]
+  ventTunDataSource.value.forEach(el => {
+    if (el['dHTotal'] && el['oldHTotal']) {
+      el['leveld'] = ((el['dHTotal'] - el['oldHTotal']) / el['oldHTotal']) * 100;
+      data.push(el['leveld'])
+    } else {
+      data=[]
+    }
+  })
+  let maxLevel = data.length!=0 ? data.reduce((a, b) => a.leveld > b.leveld ? a : b).leveld : 0;
+  hdData.address= data.length!=0 ? data.reduce((a, b) => a.leveld > b.leveld ? a : b).strName : '';
+  console.log(hdData.maxLevel);
+  if (maxLevel == 0) {
+    hdData.maxLevel='正常';
+  } else if (maxLevel > 0 && maxLevel <= 1) {
+    hdData.maxLevel='低风险';
+  } else if (maxLevel > 1 && maxLevel <= 3) {
+    hdData.maxLevel='一般风险';
+  } else if (maxLevel > 3 && maxLevel <= 5) {
+    hdData.maxLevel='较大风险';
+  } else {
+    hdData.maxLevel='重大风险';
+  }
+ 
 }
 
 onMounted(async () => {
@@ -373,7 +408,7 @@ onUnmounted(() => {
     clearTimeout(timer);
     timer = undefined;
   }
-  if(timer1){
+  if (timer1) {
     clearTimeout(timer1);
     timer1 = undefined;
   }
@@ -464,7 +499,7 @@ onUnmounted(() => {
 
       .card-btn {
         width: 240px;
-        height: 100%;
+        height: calc(100% - 50px);
         overflow-y: auto;
 
         .btn {
@@ -532,6 +567,31 @@ onUnmounted(() => {
             transform: translate(-60%, 0);
           }
         }
+        .hd-content{
+        position:relative;
+          width:100%;
+          height:100px;
+          background:url('@/assets/images/fire/no-choice.png') no-repeat;
+          background-size:100% 100%;
+          .hd-content-text{
+            position:absolute;
+            left:50%;
+            top:26px;
+            transform:translate(-50%,0);
+            font-family: 'douyuFont';
+            font-size:16px;
+            color: var(--vent-table-action-link);
+            
+          }
+          .hd-content-val{
+            position:absolute;
+            left:50%;
+            bottom:12px;
+            transform:translate(-50%,0);
+            font-size:14px;
+            color: var(--vent-font-color);
+          }
+        }
       }
     }