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

粉尘监测及火灾指标跳转问题修改-提交

lxh пре 8 месеци
родитељ
комит
633e39eca5

+ 15 - 16
src/views/vent/monitorManager/alarmMonitor/common/warnFire-bd.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="warnTargetFire-brt">
         <div class="top-area">
-            <a-table :columns="columns" :data-source="tableData" bordered :pagination="false" :scroll="{ y: 376 }">
+            <a-table :columns="columns" :data-source="tableData" bordered :pagination="false" :scroll="{ y: 250 }">
                 <template #bodyCell="{ column, text }">
                     <template v-if="column.dataIndex === 'name'">
                         <a href="javascript:;">{{ text }}</a>
@@ -15,12 +15,9 @@
         </div>
     </div>
 </template>
-
 <script setup lang="ts">
-
 import { ref, reactive,watch } from 'vue'
 import warnZb from './warnZb.vue'
-
 let props=defineProps({
     tableList:{
         type:Array,
@@ -29,11 +26,12 @@ let props=defineProps({
         }
     }
 })
+
 let widthV = ref('80%')
 let heightV = ref('80%')
 let coordDw = ref<any[]>([50, 94])
 let widthCanvas = ref(1240)
-let heightCanvas = ref(267)
+let heightCanvas = ref(364)
 let tableData = ref<any[]>([])
 
 let columns = reactive([
@@ -49,35 +47,36 @@ let columns = reactive([
     },
     {
         title: '预警等级',
-        dataIndex: 'yjdj',
+        dataIndex: 'level',
         align: 'center',
     },
     {
         title: '煤自燃阶段',
-        dataIndex: 'zrjd',
+        dataIndex: 'alarmName',
         align: 'center',
     },
     {
         title: '指标气体',
         align: 'center',
-        dataIndex: 'zbqt',
+        dataIndex: 'alarmInfo',
     },
     {
         title: '指标气体浓度范围',
         align: 'center',
-        dataIndex: 'ndfw',
+        dataIndex: 'alarmdes',
     },
     {
         title: '温度',
         align: 'center',
-        dataIndex: 'wd',
+        dataIndex: 'temperature',
     },
 ])
 
-watch(()=>props.tableList,(newV)=>{
-    console.log('111')
-    tableData.value=newV
-},{immediate:true, deep:true})
+watch(()=>props.tableList,(newV,oldV)=>{
+    if(newV.length!=0){
+        tableData.value=newV
+    }
+},{immediate:true,deep:true})
 
 </script>
 
@@ -92,14 +91,14 @@ watch(()=>props.tableList,(newV)=>{
     box-sizing: border-box;
 
     .top-area {
-        height: 55%;
+        height: 40%;
         margin-bottom: 15px;
         background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
         background-size: 100% 100%;
     }
 
     .bot-area {
-        height: calc(45% - 15px);
+        height: calc(60% - 15px);
         background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
         background-size: 100% 100%;
 

+ 4 - 4
src/views/vent/monitorManager/alarmMonitor/common/warnFire-brt.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="warnTargetFire-brt">
         <div class="top-area">
-            <a-table :columns="columns" :data-source="tableData" bordered :pagination="false" :scroll="{ y: 376 }">
+            <a-table :columns="columns" :data-source="tableData" bordered :pagination="false" :scroll="{ y: 250 }">
                 <template #bodyCell="{ column, text }">
                     <template v-if="column.dataIndex === 'name'">
                         <a href="javascript:;">{{ text }}</a>
@@ -31,7 +31,7 @@ let widthV = ref('80%')
 let heightV = ref('80%')
 let coordDw = ref<any[]>([50, 94])
 let widthCanvas = ref(1240)
-let heightCanvas = ref(267)
+let heightCanvas = ref(364)
 let tableData = ref<any[]>([])
 
 let columns = reactive([
@@ -91,14 +91,14 @@ watch(()=>props.tableList,(newV,oldV)=>{
     box-sizing: border-box;
 
     .top-area {
-        height: 55%;
+        height: 40%;
         margin-bottom: 15px;
         background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
         background-size: 100% 100%;
     }
 
     .bot-area {
-        height: calc(45% - 15px);
+        height: calc(60% - 15px);
         background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
         background-size: 100% 100%;
 

+ 1 - 1
src/views/vent/monitorManager/alarmMonitor/common/warnZb.vue

@@ -89,7 +89,7 @@ function getCanvas() {
   let ctx = canvas.getContext('2d');
   let x = 0;
   let step = props.widthCanvas < 600 ? 0.02 : 0.05; // 设置每次递增的长度
-  let y = props.widthCanvas < 600 ? 280 : 230; // 初始y坐标
+  let y = props.widthCanvas < 600 ? 280 : 325; // 初始y坐标
   // 设置线条样式
   ctx.strokeStyle = '#3df6ff'; // 红色线条
   ctx.lineWidth = 2; // 线宽为2

+ 61 - 63
src/views/vent/monitorManager/alarmMonitor/warn/dustWarn.vue

@@ -93,7 +93,7 @@ let echartDataFc = reactive({
         data: [],
     },
     aveValue: {
-        lengedData: '最新值(mg/m³)',
+        lengedData: '预警值(mg/m³)',
         data: [],
     },
     xData: [],
@@ -109,8 +109,8 @@ let gridV = reactive({
 })
 let cardListTf = reactive<any[]>([])
 let router = useRouter()
-let echartDatas = ref<any[]>([])
-let echartDat = reactive<any[]>([])
+let echartNow = ref<any[]>([])
+let echartYc = reactive<any[]>([])
 
 // https获取监测数据
 let timer: null | NodeJS.Timeout = null;
@@ -153,30 +153,29 @@ function topAreaClick(index) {
     echartDataFc.minData.data.length = 0;
     echartDataFc.aveValue.data.length = 0;
     echartDataFc.xData.length = 0;
-    echartDat.length = 0
-
-    echartDatas.value = JSON.parse(choiceData[index].readData.expectInfo)['list']
-    echartDat.push({ id: '1', time: JSON.parse(choiceData[index].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[index].readData.expectInfo)['aveVal'] })
-    echartDat.push({ id: '2', time: JSON.parse(choiceData[index].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[index].readData.expectInfo)['nowVal'] })
-    let unique = uniqueObjects(echartDat, 'time');
-    let setData = [...echartDatas.value, ...unique].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
-    console.log(setData,'setData----------')
-    setData.forEach((m, n) => {
-        echartDataFc.xData.push(m.time);
-        if (unique.filter(t => t.time == m.time).length != 0 && m.id == '1') {
-            echartDataFc.maxData.data.push(0);
-            echartDataFc.minData.data.push(m.value);
-            echartDataFc.aveValue.data.push(0);
-        } else if (unique.filter(t => t.time == m.time).length != 0 && m.id == '2') {
-            echartDataFc.maxData.data.push(0);
-            echartDataFc.minData.data.push(0);
-            echartDataFc.aveValue.data.push(m.value);
-        } else {
-            echartDataFc.maxData.data.push(m.value);
-            echartDataFc.minData.data.push(0);
-            echartDataFc.aveValue.data.push(0);
+    echartYc.length = 0
+
+    echartNow.value = JSON.parse(choiceData[index].readData.expectInfo)['list']
+    echartNow.value.push({ time: JSON.parse(choiceData[index].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[index].readData.expectInfo)['nowVal'] })
+    echartYc.push({ id: '1', time: JSON.parse(choiceData[index].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[index].readData.expectInfo)['aveVal'] })
+    let unique1 = uniqueObjects(echartYc, 'time');
+    let unique = uniqueObjects(echartNow.value, 'time');
+
+    let setData = [...unique, ...unique1].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+    setData.forEach(el => {
+        if (el.value && el.value != '0') {
+            if (el.id == '1') {
+                echartDataFc.maxData.data.push(0);
+                echartDataFc.minData.data.push(el.value);
+                echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+            } else {
+                echartDataFc.maxData.data.push(el.value);
+                echartDataFc.minData.data.push(0);
+                echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+            }
         }
     })
+
     // choiceData[index].history.forEach((el) => {
     //     echartDataFc.maxData.data.push(el.dustval);
     //     echartDataFc.xData.push(el.time);
@@ -227,25 +226,24 @@ function getSysWarnList(id, type) {
             choiceData = res.dust;
 
             if (choiceData[activeIndex.value]) {
-                echartDatas.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
-                echartDat.push({ id: '1', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
-                echartDat.push({ id: '2', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'] })
-                let unique = uniqueObjects(echartDat, 'time');
-                let setData = [...echartDatas.value, ...unique].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
-                setData.forEach((m, n) => {
-                    echartDataFc.xData.push(m.time);
-                    if (unique.filter(t => t.time == m.time).length != 0 && m.id == '1') {
-                        echartDataFc.maxData.data.push(0);
-                        echartDataFc.minData.data.push(m.value);
-                        echartDataFc.aveValue.data.push(0);
-                    } else if (unique.filter(t => t.time == m.time).length != 0 && m.id == '2') {
-                        echartDataFc.maxData.data.push(0);
-                        echartDataFc.minData.data.push(0);
-                        echartDataFc.aveValue.data.push(m.value);
-                    } else {
-                        echartDataFc.maxData.data.push(m.value);
-                        echartDataFc.minData.data.push(0);
-                        echartDataFc.aveValue.data.push(0);
+                echartNow.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
+                echartNow.value.push({ time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'] })
+                echartYc.push({ id: '1', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
+                let unique1 = uniqueObjects(echartYc, 'time');
+                let unique = uniqueObjects(echartNow.value, 'time');
+
+                let setData = [...unique, ...unique1].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+                setData.forEach(el => {
+                    if (el.value && el.value != '0') {
+                        if (el.id == '1') {
+                            echartDataFc.maxData.data.push(0);
+                            echartDataFc.minData.data.push(el.value);
+                            echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+                        } else {
+                            echartDataFc.maxData.data.push(el.value);
+                            echartDataFc.minData.data.push(0);
+                            echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+                        }
                     }
                 })
                 // choiceData[activeIndex.value].history.forEach((el) => {
@@ -258,25 +256,25 @@ function getSysWarnList(id, type) {
                 maxY.value = formatRoundNum(max1 * 1.5);
             } else {
                 activeIndex.value = 0;
-                echartDatas.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
-                echartDat.push({ id: '1', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
-                echartDat.push({ id: '2', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'] })
-                let unique = uniqueObjects(echartDat, 'time');
-                let setData = [...echartDatas.value, ...unique].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
-                setData.forEach((m, n) => {
-                    echartDataFc.xData.push(m.time);
-                    if (unique.filter(t => t.time == m.time).length != 0 && m.id == '1') {
-                        echartDataFc.maxData.data.push(0);
-                        echartDataFc.minData.data.push(m.value);
-                        echartDataFc.aveValue.data.push(0);
-                    } else if (unique.filter(t => t.time == m.time).length != 0 && m.id == '2') {
-                        echartDataFc.maxData.data.push(0);
-                        echartDataFc.minData.data.push(0);
-                        echartDataFc.aveValue.data.push(m.value);
-                    } else {
-                        echartDataFc.maxData.data.push(m.value);
-                        echartDataFc.minData.data.push(0);
-                        echartDataFc.aveValue.data.push(0);
+                echartNow.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
+                echartNow.value.push({ time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'] })
+                echartYc.push({ id: '1', time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
+                let unique1 = uniqueObjects(echartYc, 'time');
+                let unique = uniqueObjects(echartNow.value, 'time');
+
+                let setData = [...unique, ...unique1].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+                setData.forEach(el => {
+                    if (el.value && el.value != '0') {
+                        if (el.id == '1') {
+                            echartDataFc.maxData.data.push(0);
+                            echartDataFc.minData.data.push(el.value);
+                            echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+
+                        } else {
+                            echartDataFc.maxData.data.push(el.value);
+                            echartDataFc.minData.data.push(0);
+                            echartDataFc.aveValue.data.push(JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] ? JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['fmin'] : 0);
+                        }
                     }
                 })
 

+ 2 - 0
src/views/vent/monitorManager/alarmMonitor/warn/fireWarn.vue

@@ -220,6 +220,8 @@ function cardClick(ind, item) {
         currentLoad.value = '';
         getMonitor(item.deviceID, true);
     } else {
+        // clearTimeout(timer);
+        // activeIndex1.value = ind;
         tableLists.value = menuList1.info[ind].list
     }
 

+ 26 - 32
src/views/vent/monitorManager/deviceMonitor/components/device/modal/dust.modal.vue

@@ -120,8 +120,8 @@ export default defineComponent({
     const posList = ref<any[]>([]);
     const dustMonitor = shallowRef({});
     const dustSwitch = ref(false);
-    const echartDat = reactive<any[]>([])
-    const echartDatas = ref<any[]>([])
+    const echartYc = reactive<any[]>([])
+    const echartNow = ref<any[]>([])
 
     const echatsOption = {
       grid: {
@@ -147,7 +147,7 @@ export default defineComponent({
         color: '#FDB146',
         sort: 1,
         xRotate: 0,
-        dataIndex: 'dustval',
+        dataIndex: 'nowVal',
       },
       {
         legend: '预测值',
@@ -159,10 +159,10 @@ export default defineComponent({
         color: '#EE6666',
         sort: 1,
         xRotate: 0,
-        dataIndex: 'ratio',
+        dataIndex: 'ycVal',
       },
       {
-        legend: '最新值',
+        legend: '预警值',
         seriesName: '(mg/m³)',
         ymax: 5,
         yname: 'mg/m³',
@@ -171,7 +171,7 @@ export default defineComponent({
         color: '#9BCB75',
         sort: 1,
         xRotate: 0,
-        dataIndex: 'totalDust',
+        dataIndex: 'warnVal',
       },
     ];
 
@@ -279,34 +279,28 @@ export default defineComponent({
           // if(list.length > 0) posList.value = list
           // posList.value = item['history'];
 
-          echartDatas.value = JSON.parse(item.readData.expectInfo)['list']
-
-          echartDat.push({ id: '1', time: JSON.parse(item.readData.expectInfo)['aveTime'], value: JSON.parse(item.readData.expectInfo)['aveVal'] })
-          echartDat.push({ id: '2', time: JSON.parse(item.readData.expectInfo)['nowTime'], value: JSON.parse(item.readData.expectInfo)['nowVal'] })
-
-          let unique = uniqueObjects(echartDat, 'time');
-          let setData = [...echartDatas.value, ...unique].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
-          
-          setData.forEach((m, n) => {
-            if (unique.filter(t => t.time == m.time).length != 0 && m.id == '1') {
-              m.ratio = m.value
-              m.totalDust = ''
-              m.dustval = ''
-            } else if (unique.filter(t => t.time == m.time).length != 0 && m.id == '2') {
-              m.ratio = ''
-              m.totalDust = m.value
-              m.dustval = ''
-            } else {
-              m.ratio = ''
-              m.totalDust = ''
-              m.dustval = m.value
-            }
+          echartNow.value = JSON.parse(item.readData.expectInfo)['list']
+          echartNow.value.push({time:JSON.parse(item.readData.expectInfo)['nowTime'],value:JSON.parse(item.readData.expectInfo)['nowVal']})
+
+          echartYc.push({ id: '1', time: JSON.parse(item.readData.expectInfo)['aveTime'], value: JSON.parse(item.readData.expectInfo)['aveVal'] })
+          let unique1 = uniqueObjects(echartYc, 'time');
+          let unique=uniqueObjects( echartNow.value, 'time');
+    
+          let setData = [ ...unique,...unique1].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+          setData.forEach(el=>{
+           if(el.value && el.value!='0'){
+           if(el.id=='1'){
+            el.nowVal=''
+            el.ycVal=el.value
+            el.warnVal=JSON.parse(item.readData.expectInfo)['fmin'] ? JSON.parse(item.readData.expectInfo)['fmin'] : ''
+           }else {
+            el.nowVal=el.value
+            el.ycVal=''
+            el.warnVal=JSON.parse(item.readData.expectInfo)['fmin'] ? JSON.parse(item.readData.expectInfo)['fmin'] : ''
+           }
+           }
           })
           posList.value = setData
-
-
-          console.log(setData, '111111111111111============')
-
           dustMonitor.value = item.readData;
         }
       });