Browse Source

预警管控提交新版本

lxh 1 year ago
parent
commit
843673de11

+ 12 - 12
src/views/vent/monitorManager/alarmMonitor/fire.data.ts

@@ -86,17 +86,17 @@ export const contentList = [
         id: '0-0',
         title: 'O2',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
       {
         id: '0-1',
         title: 'C2H4',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
     ],
   },
@@ -107,17 +107,17 @@ export const contentList = [
         id: '1-0',
         title: 'CO',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
       {
         id: '1-1',
         title: 'CH4',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
     ],
   },
@@ -128,17 +128,17 @@ export const contentList = [
         id: '2-0',
         title: 'CO2',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
       {
         id: '2-1',
         title: 'C2H2',
         label: '浓度 : ',
-        value: 0,
+        value: '--',
         label1: '时间 : ',
-        time: '',
+        time: '--',
       },
     ],
   },

+ 11 - 11
src/views/vent/monitorManager/alarmMonitor/fire/closeWall.vue

@@ -207,19 +207,19 @@ watch(() => props.listData, (val) => {
     console.log(val, 'val---')
     if (JSON.stringify(val) != '{}') {
         if (val.bundletube.length != 0) {
-            topContent.temperature = val.temperature[0] ? val.temperature[0].readData.temperature : 0
-            topContent.position = val.bundletube[0].strinstallpos
-            topContent.time = val.bundletube[0].readTime
+            topContent.temperature = val.temperature[0] ? val.temperature[0].readData.temperature : '--'
+            topContent.position = val.bundletube[0].strinstallpos || '--'
+            topContent.time = val.bundletube[0].readTime || '--'
             topContent.warn = val.bundletube[0].warnLevel == 0 ? '正常' : val.bundletube[0].warnLevel == 101 ? '较低风险' : val.bundletube[0].warnLevel == 102 ? '低风险' : val.bundletube[0].warnLevel == 103 ? '中风险' : val.bundletube[0].warnLevel == 104 ? '高风险' : val.bundletube[0].warnLevel == 201 ? '报警' : '正常'  
-            mbList[0].nd = val.bundletube[0].readData.o2val
-            mbList[1].nd = val.bundletube[0].readData.coval
-            mbList[2].nd = val.bundletube[0].readData.co2val
-            mbList[3].nd = val.bundletube[0].readData.chval
-            mbList[4].nd = val.bundletube[0].readData.ch2val
-            mbList[5].nd = val.bundletube[0].readData.gasval
+            mbList[0].nd = val.bundletube[0].readData.o2val || '--'
+            mbList[1].nd = val.bundletube[0].readData.coval || '--'
+            mbList[2].nd = val.bundletube[0].readData.co2val || '--'
+            mbList[3].nd = val.bundletube[0].readData.chval || '--'
+            mbList[4].nd = val.bundletube[0].readData.ch2val || '--'
+            mbList[5].nd = val.bundletube[0].readData.gasval || '--'
             mbList.forEach(el => {
-                el.time1 = val.bundletube[0].readTime.substring(0,val.bundletube[0].readTime.lastIndexOf(':'))
-                el.address = val.bundletube[0].strinstallpos
+                el.time1 =val.bundletube[0] ? val.bundletube[0].readTime.substring(0,val.bundletube[0].readTime.lastIndexOf(':')) : '--'
+                el.address = val.bundletube[0] ? val.bundletube[0].strinstallpos : '--'
             })
 
             echartDataSg1.xData.length = 0

+ 44 - 4
src/views/vent/monitorManager/alarmMonitor/fire/common/echartLine.vue

@@ -41,21 +41,61 @@
           right: '2%',
             containLabel: true,
         },
-        tooltip: {
-          trigger: 'axis',
+        // tooltip: {
+        //   trigger: 'axis',
          
-        },
+        // },
+        tooltip: {
+            trigger: 'item',
+            backgroundColor: 'rgba(0, 0, 0, .6)',
+            textStyle: {
+              color: '#fff',
+              fontSize: 12,
+            },
+          },
         xAxis: [
           {
             type: 'category',
             boundaryGap: false,
             axisLabel: {
-              formatter: '{value}',
+              // formatter: '{value}',
               fontSize: 14,
               margin: 20,
               textStyle: {
                 color: '#b3b8cc',
               },
+              formatter: function (params) {
+                            let newParamsName = ref('')  // 最终拼接成的字符串
+                            let paramsNameNumber = ref(params.length) // 实际标签的个数
+                            let provideNumber = ref(10)  // 每行能显示的字的个数
+                            let rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value) // 换行的话,需要显示几行,向上取整
+                            /**
+                             * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
+                             */
+                            // 条件等同于rowNumber>1
+                            if (paramsNameNumber.value > provideNumber.value) {
+                                /** 循环每一行,p表示行 */
+                                for (var p = 0; p < rowNumber; p++) {
+                                    var tempStr = '' // 表示每一次截取的字符串
+                                    var start = p * provideNumber.value // 开始截取的位置
+                                    var end = start + provideNumber.value // 结束截取的位置
+                                    // 此处特殊处理最后一行的索引值
+                                    if (p == rowNumber - 1) {
+                                        // 最后一次不换行
+                                        tempStr = params.substring(start, paramsNameNumber.value)
+                                    } else {
+                                        // 每一次拼接字符串并换行
+                                        tempStr = params.substring(start, end) + '\n'
+                                    }
+                                    newParamsName.value += tempStr // 最终拼成的字符串
+                                }
+                            } else {
+                                // 将旧标签的值赋给新标签
+                                newParamsName.value = params
+                            }
+                            //将最终的字符串返回
+                            return newParamsName.value
+                        }
             },
             axisLine: {
               lineStyle: {

+ 13 - 9
src/views/vent/monitorManager/alarmMonitor/fire/common/echartLine1.vue

@@ -6,7 +6,7 @@
   
 <script lang="ts" setup>
 import * as echarts from 'echarts'
-import {  ref, nextTick, reactive, watch,defineProps } from 'vue';
+import { ref, nextTick, reactive, watch, defineProps } from 'vue';
 let props = defineProps({
     echartDataSg: {
         type: Object,
@@ -15,11 +15,11 @@ let props = defineProps({
 
 //获取dom元素节点
 let line = ref<any>()
-let echartDataSgs=reactive({})
+let echartDataSgs = reactive({})
 watch(() => props.echartDataSg, (data) => {
-    echartDataSgs = Object.assign({},data)
+    echartDataSgs = Object.assign({}, data)
     getOption()
-}, { immediate: true,deep:true })
+}, { immediate: true, deep: true })
 
 
 
@@ -36,7 +36,11 @@ function getOption() {
             },
             tooltip: {
                 trigger: 'axis',
-
+                backgroundColor: 'rgba(0, 0, 0, .6)',
+                textStyle: {
+                    color: '#fff',
+                    fontSize: 12,
+                },
             },
             xAxis: [
                 {
@@ -51,10 +55,10 @@ function getOption() {
                         },
                         // interval: 0,
                         formatter: function (params) {
-                            let  newParamsName = ref('')  // 最终拼接成的字符串
-                            let paramsNameNumber =ref(params.length ) // 实际标签的个数
-                            let  provideNumber =ref(10)  // 每行能显示的字的个数
-                            let  rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value) // 换行的话,需要显示几行,向上取整
+                            let newParamsName = ref('')  // 最终拼接成的字符串
+                            let paramsNameNumber = ref(params.length) // 实际标签的个数
+                            let provideNumber = ref(10)  // 每行能显示的字的个数
+                            let rowNumber = Math.ceil(paramsNameNumber.value / provideNumber.value) // 换行的话,需要显示几行,向上取整
                             /**
                              * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
                              */

+ 5 - 5
src/views/vent/monitorManager/alarmMonitor/fire/common/echartLine2.vue

@@ -6,7 +6,7 @@
   
 <script lang="ts" setup>
 import * as echarts from 'echarts'
-import {  ref,  nextTick,reactive,  watch, defineProps } from 'vue';
+import { ref, nextTick, reactive, watch, defineProps } from 'vue';
 
 let props = defineProps({
     echartDataWd: {
@@ -16,12 +16,12 @@ let props = defineProps({
 
 //获取dom元素节点
 let work = ref<any>()
-let echartDataWds=reactive({})
+let echartDataWds = reactive({})
 
 watch(() => props.echartDataWd, (data) => {
-    echartDataWds=Object.assign({},data)
+    echartDataWds = Object.assign({}, data)
     getOption()
-}, { immediate: true ,deep:true})
+}, { immediate: true, deep: true })
 
 function getOption() {
     nextTick(() => {
@@ -147,7 +147,7 @@ function getOption() {
             ],
             series: [
                 {
-                    name:echartDataWds.maxData ? echartDataWds.maxData.lengedData : '',
+                    name: echartDataWds.maxData ? echartDataWds.maxData.lengedData : '',
                     type: 'line',
                     smooth: true,
                     yAxisIndex: 0,

+ 13 - 13
src/views/vent/monitorManager/alarmMonitor/fire/dustPage.vue

@@ -39,7 +39,7 @@ let props = defineProps({
     listData: Object,
 });
 
-let maxY = ref(5)
+let maxY = ref(3)
 //顶部区域数据
 let topAreaList = reactive<any[]>([])
 
@@ -97,10 +97,10 @@ watch(() => props.listData, (val) => {
             topAreaList.push({
                 title: el.strinstallpos,
                 content: [
-                    { ids: 0, label: '温度(°C)', value: el.readData.temperature || '/', },
-                    { ids: 1, label: '粉尘浓度(%)', value: el.readData.dustval || '/', },
-                    { ids: 2, label: '喷雾水压', value: el.readData.waterPressure || '/', },
-                    { ids: 3, label: '喷雾状态', value: el.readData.atomizingState || '/', },
+                    { ids: 0, label: '温度(°C)', value: el.readData.temperature || '--', },
+                    { ids: 1, label: '粉尘浓度(%)', value: el.readData.dustval || '--', },
+                    { ids: 2, label: '喷雾水压', value: el.readData.waterPressure || '--', },
+                    { ids: 3, label: '喷雾状态', value: el.readData.atomizingState || '--', },
                 ],
             },)
         })
@@ -112,10 +112,10 @@ watch(() => props.listData, (val) => {
         echartDataFc.xData.length = 0
         if (choiceData[activeIndex.value]) {
             centerAreaListB.push(
-                { content: choiceData[activeIndex.value].readData.dustval || '/' },
-                { content: choiceData[activeIndex.value].readData.totalDust || '/' },
-                { content: choiceData[activeIndex.value].readData.breathWeighted || '/'},
-                { content: choiceData[activeIndex.value].readData.atomizingState || '/' },
+                { content: choiceData[activeIndex.value].readData.dustval || '--' },
+                { content: choiceData[activeIndex.value].readData.totalDust || '--' },
+                { content: choiceData[activeIndex.value].readData.breathWeighted || '--'},
+                { content: choiceData[activeIndex.value].readData.atomizingState || '--' },
             )
 
             choiceData[activeIndex.value].history.forEach(el => {
@@ -129,10 +129,10 @@ watch(() => props.listData, (val) => {
         } else {
             activeIndex.value = 0
             centerAreaListB.push(
-                { content: choiceData[activeIndex.value].readData.dustval || '/' },
-                { content: choiceData[activeIndex.value].readData.totalDust || '/' },
-                { content: choiceData[activeIndex.value].readData.breathWeighted || '/' },
-                { content: choiceData[activeIndex.value].readData.atomizingState || '/' },
+                { content: choiceData[activeIndex.value].readData.dustval || '--' },
+                { content: choiceData[activeIndex.value].readData.totalDust || '--' },
+                { content: choiceData[activeIndex.value].readData.breathWeighted || '--' },
+                { content: choiceData[activeIndex.value].readData.atomizingState || '--' },
             )
             choiceData[activeIndex.value].history.forEach(el => {
                 echartDataFc.maxData.data.push(el.dustval)

+ 5 - 5
src/views/vent/monitorManager/alarmMonitor/fire/gasPage.vue

@@ -74,7 +74,7 @@ watch(() => props.listData, (val) => {
 
         val.common.pump.forEach(v => {
             topAreaListWs.push({
-                label: v.strinstallpos,
+                label: v.strinstallpos || '--',
                 list: [
                     { name: '抽采泵流量', val: v.readData.FlowSensor_InputFlux || 0 },
                     { name: '报警状态', val: v.warnLevel || 0 },
@@ -86,11 +86,11 @@ watch(() => props.listData, (val) => {
 
             cardListWs.push({
                 label: '甲烷',
-                value: el.readData.gasC,
+                value: el.readData.gasC || '--',
                 listR: [
-                    { id: 0, label: '测点类型', value: el.typeName },
-                    { id: 1, label: '测点位置', value: el.strinstallpos },
-                    { id: 2, label: '数据时间', value: el.readTime },
+                    { id: 0, label: '测点类型', value: el.typeName || '--' },
+                    { id: 1, label: '测点位置', value: el.strinstallpos || '--' },
+                    { id: 2, label: '数据时间', value: el.readTime || '--' },
                     { id: 3, label: '测点状态', value: el.warnFlag },
                 ]
             })

+ 14 - 14
src/views/vent/monitorManager/alarmMonitor/fire/ventilate.vue

@@ -89,9 +89,9 @@ watch(
               {
                 ids: 1,
                 label: '报警等级',
-                value: el.datalist[0].warnLevel,
+                value: el.datalist[0].warnLevel || 0,
               },
-              { ids: 2, label: '报警描述', value: el.datalist[0].warnDes },
+              { ids: 2, label: '报警描述', value: el.datalist[0].warnDes || '--' },
             ],
           });
         });
@@ -103,7 +103,7 @@ watch(
             {
               ids: 1,
               label: '报警等级',
-              value: val.common.warnLevel,
+              value: val.common.warnLevel || '正常',
             },
             { ids: 2, label: '报警描述', value: '--' },
           ],
@@ -111,9 +111,9 @@ watch(
 
       }
 
-      centerAreaListB1[0].content = val.common.jin || '/';
-      centerAreaListB1[1].content = val.common.hui || '/';
-      centerAreaListB1[2].content = val.common.xufengliang || '/';
+      centerAreaListB1[0].content = val.common.jin || '--';
+      centerAreaListB1[1].content = val.common.hui || '--';
+      centerAreaListB1[2].content = val.common.xufengliang || '--';
 
       val.common.history.forEach((v) => {
         echartDataFc1.maxData.data.push(parseFloat(v.jin));
@@ -175,7 +175,7 @@ watch(
 
           .item-label {
             position: absolute;
-            left: 52px;
+            left: 54px;
             top: 50%;
             transform: translate(0, -44%);
             font-size: 12px;
@@ -183,7 +183,7 @@ watch(
 
           .item-value {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -193,7 +193,7 @@ watch(
 
           .item-value1 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -203,7 +203,7 @@ watch(
 
           .item-value2 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -213,7 +213,7 @@ watch(
 
           .item-value3 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -223,7 +223,7 @@ watch(
 
           .item-value4 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -233,7 +233,7 @@ watch(
 
           .item-value5 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;
@@ -243,7 +243,7 @@ watch(
 
           .item-value6 {
             position: absolute;
-            right: 52px;
+            right: 54px;
             top: 50%;
             transform: translate(0, -32%);
             font-size: 12px;