Browse Source

带式输送机防灭火监测系统修改-提交

lxh 3 months ago
parent
commit
448b1aeff7
2 changed files with 52 additions and 23 deletions
  1. 46 23
      src/views/vent/fire/wokeFace/index.vue
  2. 6 0
      src/views/vent/fire/wokeFace/workeFace.api.ts

+ 46 - 23
src/views/vent/fire/wokeFace/index.vue

@@ -21,12 +21,13 @@
         <!-- 束管 -->
         <div class="composite-top-box" v-if="flagShow == 'sg' || flagShow == 'all'">
           <div class="composite-search">
-              <a-select style="width: 180px" :options="selectListSg" size="small" placeholder="请选择" v-model:value="pointCode"  allowClear @change="changeSg"></a-select>
+            <a-select style="width: 180px" :options="selectListSg" size="small" placeholder="请选择"
+              v-model:value="pointCode" allowClear @change="changeSg"></a-select>
           </div>
           <div class="composite-content">
             <basicCard3 :card3List="card3List" :warningLevel="warningLevel" @toggleChange="toggleChange"></basicCard3>
           </div>
-         
+
         </div>
         <div class="composite-bot-box" v-if="flagShow == 'sg' || flagShow == 'all'">
           <div class="search-area">
@@ -40,8 +41,10 @@
         </div>
         <!-- 通用 -->
         <div :class="flagShow == 'sg' ? 'bot-box1' : 'bot-box'">
-          <div class="bot-box-card" v-for="(item, index) in botCardList" :key="index">
-            <basicSensor :sensorTitle="item.title" :sensorList="item.sensorList" :headList="headList" />
+          <div v-for="(item, index) in botCardList" :key="index">
+            <div class="bot-box-card" v-if="item.sensorList.length!=0">
+              <basicSensor :sensorTitle="item.title" :sensorList="item.sensorList" :headList="headList" />
+            </div>
           </div>
         </div>
       </div>
@@ -61,7 +64,7 @@ import basicWorkBtn from '../../common/basicWorkBtn.vue';
 import basicEchartLine from '../../common/basicEchartLine.vue';
 import basicSensor from '../../common/basicSensor.vue';
 import basicTree from '../../common/basicTree.vue'
-import { getFireAreaInfo, getInfosByAreaCode, getGxcwHistoryDataByPointCode, getYwRealData, getHyRealData, getPlzzRealData, getSgjcPointInfo, getSgjcRealDataByPointCode, getSgjcHistoryData } from './workeFace.api'
+import { getFireAreaInfo, getInfosByAreaCode, getGxcwHistoryDataByPointCode, getYwRealData, getHyRealData, getPlzzRealData, getSgjcPointInfo, getSgjcRealDataByPointCode, getSgjcHistoryData, getCoByAreaCode } from './workeFace.api'
 import dayjs, { Dayjs } from 'dayjs';
 import basicCard3 from '../../common/basicCard3.vue';
 
@@ -72,8 +75,8 @@ let gxSelect = ref('')
 let pointCode = ref('')
 let gasType = ref('')
 let card3List = reactive<any[]>([])
-  let dateFormat = ref('YYYY-MM-DD');
-  let TimeRange = ref<[Dayjs, Dayjs]>([dayjs(dayjs(new Date().getTime()).format('YYYY-MM-DD'), dateFormat.value), dayjs(dayjs(new Date().getTime()+ 24 * 60 * 60 * 1000).format('YYYY-MM-DD'), dateFormat.value)])
+let dateFormat = ref('YYYY-MM-DD');
+let TimeRange = ref<[Dayjs, Dayjs]>([dayjs(dayjs(new Date().getTime()).format('YYYY-MM-DD'), dateFormat.value), dayjs(dayjs(new Date().getTime() + 24 * 60 * 60 * 1000).format('YYYY-MM-DD'), dateFormat.value)])
 let cardContentList = reactive([
   { id: 0, imgSrc: getAssetURL('workPlaceWarn/temp.png'), label: '最高温度(℃)', val: '' },
   { id: 1, imgSrc: getAssetURL('workPlaceWarn/jd-zdwd.png'), label: '最低温度(℃)', val: '' },
@@ -97,19 +100,22 @@ let botCardList = reactive([
     title: '火焰传感器', sensorList: []
   },
   {
+    title: '一氧化碳传感器', sensorList: []
+  },
+  {
     title: '自动喷淋灭火装置', sensorList: []
   },
 ]);
 let headList = reactive([
   { id: 0, title: '名称' },
-  { id: 1, title: '状态' },
+  { id: 1, title: '' },
   { id: 3, title: '时间' },
 ]);
 
 //数据随便写的,不符合实际情况,因为懒得改
 const treeData = reactive<any[]>([])
 
-let selectListSg=reactive<any[]>([])
+let selectListSg = reactive<any[]>([])
 
 let gridV = reactive({
   top: '15%',
@@ -139,7 +145,7 @@ let markLine1 = reactive({ //最大值和最小值
   },
   ]
 })
-let markLine2=reactive({})
+let markLine2 = reactive({})
 
 let echartData = reactive({
   xData: [],
@@ -198,6 +204,8 @@ async function getFireAreaInfos() {
     getYwRealDataList()
     //获取火焰传感器监测数据
     getHyRealDataList()
+    //获取一氧化碳传感器监测数据
+    getCoByAreaCodeList()
     //获取自动喷淋灭火装置数据
     getPlzzRealDataList()
     if (treeData[0]['gxcwCnt'] > 0 && treeData[0]['sgjcCnt'] > 0) {
@@ -227,11 +235,13 @@ function selectChange(treeNode) {
   cardContentList[0]['val'] = parseFloat(data.infoTypeTwo.maxTemperature).toFixed(2)
   cardContentList[1]['val'] = parseFloat(data.infoTypeTwo.minTemperature).toFixed(2)
   cardContentList[2]['val'] = parseFloat(data.infoTypeTwo.aveTemperature).toFixed(2)
-  cardContentList[3]['val'] =parseFloat( data.infoTypeTwo.returnAirCornerCO).toFixed(2)
+  cardContentList[3]['val'] = parseFloat(data.infoTypeTwo.returnAirCornerCO).toFixed(2)
   //获取烟雾传感器数据
   getYwRealDataList()
   //获取火焰传感器监测数据
   getHyRealDataList()
+  //获取一氧化碳传感器监测数据
+  getCoByAreaCodeList()
   //获取自动喷淋灭火装置数据
   getPlzzRealDataList()
   let gxcwCnt = treeData.filter((g) => g.name == treeNode.node.dataRef.title)[0]['gxcwCnt']
@@ -262,7 +272,7 @@ async function getInfosByAreaCodeList() {
     res.forEach(el => {
       workBtnList.push({
         // label: el.pointName,
-        label:el.pointPosition,
+        label: el.pointPosition,
         value: el.pointCode,
       })
     })
@@ -321,31 +331,44 @@ async function getHyRealDataList() {
   }
 }
 
+//获取一氧化碳传感器监测数据
+async function getCoByAreaCodeList() {
+  let res = await getCoByAreaCode({ areaCode: areaCode.value })
+  if (res.length != 0) {
+    botCardList[2].sensorList.length = 0
+    res.forEach(el => {
+      let dw = el.unit != 'null' && el.unit != null ? `(${el.unit})` : ''
+      el.detectValue = el.sensorType == 'M0104' ? '0ppm' : el.sensorType == 'K0007' ? el.detectValue == '0' ? '无烟雾' : el.detectValue == '1' ? '有烟雾' : '-' : '-'
+      botCardList[2].sensorList.push({ name: el.nodePlacement, status: el.detectValue + dw, times: el.dateTime })
+    })
+  }
+}
+
 //获取喷淋设备监测数据
 async function getPlzzRealDataList() {
   let res = await getPlzzRealData({ areaCode: areaCode.value })
   if (res.length != 0) {
-    botCardList[2].sensorList.length = 0
+    botCardList[3].sensorList.length = 0
     res.forEach(el => {
       el.isOpen = el.isOpen == '0' ? '正常' : '异常'
-      botCardList[2].sensorList.push({ name: el.pointName, status: el.isOpen, times: el.time })
+      botCardList[3].sensorList.push({ name: el.pointName, status: el.isOpen, times: el.time })
     })
 
   }
 
 }
 //束管选项切换
-function changeSg(val){
-  pointCode.value =val
+function changeSg(val) {
+  pointCode.value = val
   getSgjcRealDataByPointCodeList()
 }
 //获取束管测点编号列表
 async function getSgjcPointInfoList() {
   let res = await getSgjcPointInfo({ areaCode: areaCode.value })
   if (res.length != 0) {
-    selectListSg.length=0
-    res.forEach(el=>{
-      selectListSg.push({label:el.pointName,value:el.pointCode})
+    selectListSg.length = 0
+    res.forEach(el => {
+      selectListSg.push({ label: el.pointName, value: el.pointCode })
     })
     pointCode.value = pointCode.value ? pointCode.value : res[0]['pointCode']
     //获取束管测点实时数据  
@@ -375,8 +398,8 @@ async function getSgjcRealDataByPointCodeList() {
 
 //获取束管曲线数据
 async function getSgjcHistoryDataList() {
-  let startTime=`${dayjs(TimeRange.value[0]).format('YYYY-MM-DD')} 00:00:00`
-  let endTime=`${dayjs(TimeRange.value[1]).format('YYYY-MM-DD')} 00:00:00`
+  let startTime = `${dayjs(TimeRange.value[0]).format('YYYY-MM-DD')} 00:00:00`
+  let endTime = `${dayjs(TimeRange.value[1]).format('YYYY-MM-DD')} 00:00:00`
   let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: startTime, endTime: endTime })
   echartData.xData.length = 0
   echartData.yData.length = 0
@@ -470,7 +493,7 @@ onMounted(() => {
       height: 275px;
       margin-bottom: 15px;
 
-      .composite-search{
+      .composite-search {
         display: flex;
         box-sizing: border-box;
         align-items: center;
@@ -479,7 +502,7 @@ onMounted(() => {
         padding: 0 15px;
       }
 
-      .composite-content{
+      .composite-content {
         height: calc(100% - 40px);
       }
     }

+ 6 - 0
src/views/vent/fire/wokeFace/workeFace.api.ts

@@ -10,6 +10,7 @@ enum Api {
   getSgjcPointInfo = '/fire/fireDisasterApi/getSgjcPointInfo',
   getSgjcRealDataByPointCode = '/fire/fireDisasterApi/getSgjcRealDataByPointCode',
   getSgjcHistoryData = '/fire/fireDisasterApi/getSgjcHistoryData',
+  getCoByAreaCode='/fire/fireDisasterApi/getCoByAreaCode'
 }
 /**
  * 菜单树接口
@@ -41,6 +42,11 @@ export const getYwRealData = (params) => defHttp.get({ url: Api.getYwRealData, p
  * @param params
  */
 export const getHyRealData = (params) => defHttp.get({ url: Api.getHyRealData, params });
+/**
+ * 获取一氧化碳传感器数据
+ * @param params
+ */
+export const getCoByAreaCode = (params) => defHttp.get({ url: Api.getCoByAreaCode, params });
 
 /**
  * 获取自动喷淋灭火装置数据