Browse Source

预警管控-通风监测预警修改更新

lxh 2 months ago
parent
commit
47425ffe42

+ 23 - 13
src/views/vent/monitorManager/alarmMonitor/index.vue

@@ -4,9 +4,9 @@
     <div class="lr left-box">
       <ventBox1>
         <template #title>
-          <div class="icon-toggle" @click="handlerToggle">
-            <img v-if="showToggle" src="@/assets/images/vent/monitor-toggle.png" alt="">
-            <img v-else src="@/assets/images/vent/report-toggle.png" alt="">
+          <div v-if="showToggle=='all'"  class="icon-toggle" @click="handlerToggle">
+            <img v-if="monitor" src="@/assets/images/vent/monitor-toggle.png" alt="">
+            <img v-else  src="@/assets/images/vent/report-toggle.png" alt="">
           </div>
           <div class="monitor-title" @click="showModal('vent')">通风监测预警</div>
         </template>
@@ -388,7 +388,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, onUnmounted, reactive } from 'vue';
+import { ref, onMounted, onUnmounted, reactive,computed } from 'vue';
 import { useRouter } from 'vue-router';
 import { rainBg } from '/@/utils/ui.js';
 import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
@@ -402,7 +402,7 @@ import BarSingle from '../../../../components/chart/BarSingle.vue';
 import warnGradeEchart from './common/warnGradeEchart.vue';
 import warnGradeInfo from './common/warnGradeInfo.vue';
 
-let showToggle=ref(true)
+let monitor=ref(true)
 let toggleData=reactive({})
 let router = useRouter();
 let warnLevels = ref('');
@@ -442,16 +442,16 @@ let gasData = {
   sums: 0,
   sums1: 0,
 };
-
 let fireMonitor1 = reactive<any[]>([]);
 let visibleGrade = ref(false); //控制风险等级弹窗显示与隐藏
 let titleGrade = ref(''); //风险等级弹窗标题
+let showToggle=ref('')
 
 //点击切换实时\报表数据
 let handlerToggle=()=>{
-  showToggle.value=!showToggle.value
-  windData.jf = showToggle.value ? toggleData.ventInfo.zongjinfeng : toggleData.ventInfo.totalIntM3;
-  windData.hf = showToggle.value ? toggleData.ventInfo.zonghuifeng : toggleData.ventInfo.totalRetM3;
+  monitor.value=!monitor.value
+  windData.jf = monitor.value ? toggleData.ventInfo.zongjinfeng : toggleData.ventInfo.totalIntM3;
+  windData.hf = monitor.value ? toggleData.ventInfo.zonghuifeng : toggleData.ventInfo.totalRetM3;
 }
 //风险等级点击
 let warnGradeClick = () => {
@@ -504,8 +504,16 @@ async function getList() {
   toggleData=Object.assign({},res)
   windData.levels =  res.info.sysInfo.ventS.levels;
   windData.levels['blue'] = warnNumMap.get('vent');
-  windData.jf = showToggle.value ? res.ventInfo.zongjinfeng : res.ventInfo.totalIntM3;
-  windData.hf = showToggle.value ? res.ventInfo.zonghuifeng : res.ventInfo.totalRetM3;
+  if(showToggle.value=='monitor'){
+    windData.jf =  res.ventInfo.zongjinfeng
+    windData.hf =res.ventInfo.zonghuifeng
+  }else if(showToggle.value=='report'){
+    windData.jf =  res.ventInfo.totalIntM3;
+    windData.hf = res.ventInfo.totalRetM3;
+  }else {
+    windData.jf = monitor.value ? res.ventInfo.zongjinfeng : res.ventInfo.totalIntM3;
+    windData.hf = monitor.value ? res.ventInfo.zonghuifeng : res.ventInfo.totalRetM3;
+  }
   windData.xf = res.ventInfo.xufengliang;
   dustData.levels = res.info.sysInfo.dustS.levels;
   dustData.levels['blue'] = warnNumMap.get('dust');
@@ -589,8 +597,10 @@ function getLevelNum() {
 }
 
 onMounted(async () => {
-  let { sysOrgCode } = useGlobSetting();
+  const { sysOrgCode, sysDataType } = useGlobSetting();
   warnLevels.value = sysOrgCode;
+  showToggle.value=sysDataType
+  console.log(showToggle,'showToggle------')
   await getLevelNum();
   await getMonitor(true);
   rainBg('rain', 'animation-box');
@@ -1835,7 +1845,7 @@ onUnmounted(() => {
   }
   .icon-toggle{
     position: absolute;
-    left: 10px;
+    left: 18px;
     top: 6px;
     img{
       width: 24px;

+ 45 - 16
src/views/vent/monitorManager/alarmMonitor/warn/ventilateWarn.vue

@@ -1,9 +1,9 @@
 <template>
   <customHeader :options="options" @change="getSelectRow" :optionValue="optionValue"> 通风监测预警 </customHeader>
   <div class="ventilateWarn">
-    <div class="icon-toggle" @click="handlerToggle">
-            <img v-if="showToggle" src="@/assets/images/vent/monitor-toggle.png" alt=""></img>
-            <img v-else src="@/assets/images/vent/report-toggle.png" alt=""></img>
+          <div v-if="showToggle=='all'"  class="icon-toggle" @click="handlerToggle">
+            <img v-if="monitor" src="@/assets/images/vent/monitor-toggle.png" alt="">
+            <img v-else  src="@/assets/images/vent/report-toggle.png" alt="">
           </div>
     <div class="ventilate-top">
       <a-button
@@ -69,18 +69,19 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, reactive, onMounted, onUnmounted } from 'vue';
+  import { ref, reactive, onMounted, onUnmounted,computed } from 'vue';
   import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
+  import { usePermission } from '/@/hooks/web/usePermission';
+  import { useGlobSetting } from '/@/hooks/setting';
   import { useRouter } from 'vue-router';
   import { sysTypeWarnList, sysWarn, getDevice } from '../common.api';
   import { ventilateTopList } from '../common.data';
   import CustomHeader from '/@/components/vent/customHeader.vue';
   import echartLine from '../common/echartLine.vue';
-  import { usePermission } from '/@/hooks/web/usePermission';
   import MeasurePoint from '../common/measurePoint.vue';
   // import moment from 'moment';
 
-  let showToggle=ref(true)
+  let monitor=ref(true)
   let toggleData=reactive<any>({})
   const { hasPermission } = usePermission();
   const { options, optionValue, getSelectRow, getSysDataSource } = useSystemSelect('sys_surface_caimei'); // 参数为场景类型(设备类型管理中可以查询到)
@@ -109,13 +110,13 @@
   });
   let cardListTf = ref<any[]>([]);
   const chartListTf = ref<any[]>([]);
-
+   let showToggle=ref('')
   //点击切换实时\报表数据
   let handlerToggle=()=>{
-    showToggle.value=!showToggle.value
-    ventilateTopList[0].value =showToggle.value ? toggleData.jin : toggleData.faceIntM3;
-    ventilateTopList[1].value = showToggle.value ? toggleData.hui : toggleData.faceRetM3 ;
-    if(showToggle.value && toggleData.history.length != 0){
+    monitor.value=!monitor.value
+    ventilateTopList[0].value =monitor.value ? toggleData.jin : toggleData.faceIntM3;
+    ventilateTopList[1].value = monitor.value ? toggleData.hui : toggleData.faceRetM3 ;
+    if(monitor.value && toggleData.history.length != 0){
           toggleData.history.forEach((v) => {
             echartDataFc1.maxData.data.push(parseFloat(v.jin));
             echartDataFc1.minData.data.push(parseFloat(v.hui));
@@ -185,12 +186,38 @@
       echartDataFc1.xData.length = 0;
       if (JSON.stringify(res) != '{}') {
         toggleData=Object.assign({},res)
-        ventilateTopList[0].value =showToggle.value ? res.jin : res.faceIntM3;
-        ventilateTopList[1].value = showToggle.value ? res.hui : res.faceRetM3 ;
         ventilateTopList[2].value = res.xufengliang || '--';
         ventilateTopList[3].text = res.warnFlag ? res.warnDes : '正常';
-
-        if(showToggle.value && res.history.length != 0){
+        if(showToggle.value=='monitor'){
+          ventilateTopList[0].value =res.jin
+          ventilateTopList[1].value =res.hui
+          if(res.history.length != 0){
+          res.history.forEach((v) => {
+            echartDataFc1.maxData.data.push(parseFloat(v.jin));
+            echartDataFc1.minData.data.push(parseFloat(v.hui));
+            if (ventilateTopList[2].value && ventilateTopList[2].value != '--') {
+              echartDataFc1.aveValue.data.push(ventilateTopList[2].value);
+            } else {
+              echartDataFc1.aveValue.data.push(0);
+            }
+            echartDataFc1.xData.push(v.time);
+          });
+        }
+        }else if(showToggle.value=='report'){
+          ventilateTopList[0].value =res.faceIntM3;
+          ventilateTopList[1].value =res.faceRetM3 ;
+          if(res.history_report.length != 0){
+            res.history_report.forEach((v) => {
+            echartDataFc1.maxData.data.push(parseFloat(v.faceIntM3));
+            echartDataFc1.minData.data.push(parseFloat(v.faceRetM3));
+            echartDataFc1.aveValue.data.push(0);
+            echartDataFc1.xData.push(v.time);
+          });
+          }
+        }else {
+          ventilateTopList[0].value =monitor.value ? res.jin : res.faceIntM3;
+          ventilateTopList[1].value = monitor.value ? res.hui : res.faceRetM3 ;
+          if(monitor.value && res.history.length != 0){
           res.history.forEach((v) => {
             echartDataFc1.maxData.data.push(parseFloat(v.jin));
             echartDataFc1.minData.data.push(parseFloat(v.hui));
@@ -209,7 +236,7 @@
             echartDataFc1.xData.push(v.time);
           });
         }
-      
+        }
 
         let max1 = echartDataFc1.maxData.data.reduce((acr, cur) => {
           return acr > cur ? acr : cur;
@@ -281,6 +308,8 @@
     }
   }
   onMounted(() => {
+    const { sysOrgCode, sysDataType } = useGlobSetting();
+  showToggle.value=sysDataType
     getMenuList();
   });
   onUnmounted(() => {