ソースを参照

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

hongrunxia 9 ヶ月 前
コミット
13a50e9719

+ 74 - 15
src/views/vent/home/billboard/billboard.data.ts

@@ -147,23 +147,21 @@ export const GAS_STATUS_HEADER_CONFIG = [
 ];
 
 // 综合监测相关的内容配置项
-export const SUMMARY_HEADER_CONFIG = [
-  {
-    label: '风险分析',
-    prop: 'level',
-    type: 'to-bottom-right',
-  },
-];
+export const SUMMARY_HEADER_CONFIG = {
+  label: '风险分析',
+  prop: 'synthesizeS.levelstatus',
+  type: 'to-bottom-right',
+};
 
 // 综合监测表格列配置
 export const SUMMARY_COLUMN = [
   {
     name: '监测类别',
-    prop: 'typeName',
+    prop: 'label',
   },
   {
     name: '风险等级',
-    prop: 'warnLevelStr',
+    prop: 'value',
   },
 ];
 
@@ -221,12 +219,73 @@ export const DEFAULT_TEST_DATA = {
     zongjinfeng: '/', //总进风
   },
   sys_warndata: {
-    levels: 0,
-    fire: '0',
-    sb: '0',
-    ws: '0',
-    fc: '0',
-    tf: '0',
+    info: {
+      sysInfo: {
+        ventS: {
+          maxLevel: 0,
+          netstatus: 0,
+          code: 'ventS',
+          levelstatus: '低风险',
+          maxLevel_str: '正常',
+          name: '通风',
+          count: 0,
+          status: '正常',
+          maxLevel_status: '低风险',
+        },
+        fireS: {
+          maxLevel: 0,
+          code: 'fireS',
+          maxLevel_str: '正常',
+          count: 0,
+          netstatus: 1,
+          levelstatus: '低风险',
+          name: '防灭火',
+          status: '正常',
+          maxLevel_status: '低风险',
+        },
+        synthesizeS: {
+          maxLevel: 0,
+          netstatus: 1,
+          code: 'synthesizeS',
+          levelstatus: '低风险',
+          maxLevel_str: '正常',
+          name: '综合',
+          count: 0,
+          status: '正常',
+          maxLevel_status: '低风险',
+        },
+        dustS: {
+          maxLevel: 0,
+          netstatus: 0,
+          code: 'dustS',
+          levelstatus: '低风险',
+          maxLevel_str: '正常',
+          name: '防尘',
+          count: 0,
+          status: '正常',
+          maxLevel_status: '低风险',
+        },
+        gasS: {
+          maxLevel: 0,
+          netstatus: 0,
+          code: 'gasS',
+          levelstatus: '低风险',
+          maxLevel_str: '正常',
+          devices: [],
+          name: '瓦斯',
+          count: 0,
+          status: '正常',
+          maxLevel_status: '低风险',
+        },
+        deviceWarnInfo: {
+          maxLevel: 101,
+          levelstatus: '低风险',
+          maxLevel_str: '低风险预警',
+          status: '异常',
+          devMaxlevel_status: '低风险预警',
+        },
+      },
+    },
   },
   orgname: '/',
   orgcode: '/',

+ 46 - 20
src/views/vent/home/billboard/components/Summary.vue

@@ -1,17 +1,18 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <Row justify="space-around">
-    <Col v-for="(item, i) in SUMMARY_HEADER_CONFIG" :key="`svvhbcgs${i}`" :span="10">
-      <LargeBoard :label="item.label" :value="headerData[item.prop]" :type="item.type" />
-    </Col>
+    <!-- <Col> -->
+    <LargeBoard :label="SUMMARY_HEADER_CONFIG.label" :value="headerData" :type="SUMMARY_HEADER_CONFIG.type" />
+    <!-- </Col> -->
   </Row>
   <CommonTable class="mt-10px" :columns="SUMMARY_COLUMN" :data="tableData" />
 </template>
 <script lang="ts" setup>
-  import { Row, Col } from 'ant-design-vue';
+  import _ from 'lodash-es';
+  import { Row } from 'ant-design-vue';
   import { SUMMARY_HEADER_CONFIG, SUMMARY_COLUMN, DEFAULT_TEST_DATA, BillboardType } from '../billboard.data';
   import LargeBoard from './LargeBoard.vue';
-  import { watch, shallowRef } from 'vue';
+  import { watch, shallowRef, ref } from 'vue';
   import CommonTable from './CommonTable.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
@@ -24,11 +25,13 @@
     }
   );
 
-  const headerData = shallowRef({});
-  const tableData = shallowRef<BillboardType['gasInfo']['gasTypeList']>([]);
+  const headerData = ref('/');
+  const tableData = shallowRef<any[]>([]);
 
   function fetchData() {
-    const info = props.data.gasInfo || DEFAULT_TEST_DATA.gasInfo;
+    const info = props.data.sys_warndata;
+    if (!info) return;
+    const sysInfo = info.info.sysInfo;
     const trans = {
       0: '低风险',
       101: '低风险',
@@ -36,18 +39,31 @@
       103: '较大风险',
       104: '重大风险',
       201: '报警',
-      1001: '网络断开',
     };
-    headerData.value = {
-      gasWarnLevel: trans[info.gasWarnLevel],
-      gasJudgeLevel: '低风险',
-    };
-    tableData.value = info.gasTypeList.map((e) => {
-      return {
-        ...e,
-        warnLevelStr: trans[e.warnLevel],
-      };
-    });
+    headerData.value = _.get(sysInfo, SUMMARY_HEADER_CONFIG.prop, '/');
+    // 配合 SUMMARY_COLUMN 生成数据
+    tableData.value = [
+      {
+        label: '火灾监测',
+        value: _.get(trans, _.get(sysInfo, ['fireS', 'maxLevel'], 0)),
+      },
+      {
+        label: '设备监测',
+        value: _.get(trans, _.get(sysInfo, ['deviceWarnInfo', 'maxLevel'], 0)),
+      },
+      {
+        label: '瓦斯监测',
+        value: _.get(trans, _.get(sysInfo, ['gasS', 'maxLevel'], 0)),
+      },
+      {
+        label: '粉尘监测',
+        value: _.get(trans, _.get(sysInfo, ['dustS', 'maxLevel'], 0)),
+      },
+      {
+        label: '通风监测',
+        value: _.get(trans, _.get(sysInfo, ['ventS', 'maxLevel'], 0)),
+      },
+    ];
   }
 
   watch(
@@ -58,4 +74,14 @@
     { immediate: true }
   );
 </script>
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+  .value104 {
+    color: #ff0000;
+  }
+  .value103 {
+    color: #ff8800;
+  }
+  .value102 {
+    color: #ffff00;
+  }
+</style>

+ 1 - 1
src/views/vent/home/billboard/components/VentilationStatus.vue

@@ -71,7 +71,7 @@
   // 过滤不合法的值,小于5000的视为传感器出错
   function filterBadValue(val: number | string) {
     const valid = parseInt(val) > 5000;
-    return valid ? val : '/';
+    return valid ? val.toString() : '/';
   }
 
   watch(

+ 6 - 6
src/views/vent/home/clique/components/risk-warn.vue

@@ -3,7 +3,7 @@
     <div class="risk-title">{{ riskTitle }}</div>
     <div class="risk-select">
       <a-select style="width: 388px" v-model:value="selectVal" allowClear class="code-mode-select" @change="changeSelect">
-        <a-select-option v-for="item in selectList" :value="item.value">{{ item.label }} </a-select-option>
+        <a-select-option v-for="item in selectList" :key="item.value" :value="item.value">{{ item.label }} </a-select-option>
       </a-select>
     </div>
     <div class="risk-content">
@@ -57,7 +57,7 @@
               </div>
               <div class="item-monitor-box">
                 <span class="title">火灾监测</span>
-                <span class="value" :class="`value${centerData.tf}`">{{ parseLevel(centerData.fire) }}</span>
+                <span class="value" :class="`value${centerData.fire}`">{{ parseLevel(centerData.fire) }}</span>
               </div>
             </div>
             <div class="item item2">
@@ -66,7 +66,7 @@
               </div>
               <div class="item-monitor-box">
                 <span class="title">设备监测</span>
-                <span class="value" :class="`value${centerData.tf}`">{{ parseLevel(centerData.sb) }}</span>
+                <span class="value" :class="`value${centerData.sb}`">{{ parseLevel(centerData.sb) }}</span>
               </div>
             </div>
             <div class="item item3">
@@ -75,7 +75,7 @@
               </div>
               <div class="item-monitor-box">
                 <span class="title">瓦斯监测</span>
-                <span class="value" :class="`value${centerData.tf}`">{{ parseLevel(centerData.ws) }}</span>
+                <span class="value" :class="`value${centerData.ws}`">{{ parseLevel(centerData.ws) }}</span>
                 <!-- <div class="">
                                     <span class="title">矿井瓦斯鉴定等级监测</span>
                                     <span class="value">低瓦斯</span>
@@ -88,7 +88,7 @@
               </div>
               <div class="item-monitor-box">
                 <span class="title">粉尘监测</span>
-                <span class="value" :class="`value${centerData.tf}`">{{ parseLevel(centerData.fc) }}</span>
+                <span class="value" :class="`value${centerData.fc}`">{{ parseLevel(centerData.fc) }}</span>
               </div>
             </div>
             <div class="item item5">
@@ -181,7 +181,7 @@
     }
   );
 
-  function parseLevel(lv: string) {
+  function parseLevel(lv: string | number) {
     const l = parseInt(lv);
     switch (l) {
       case 0:

+ 0 - 1
src/views/vent/monitorManager/deviceMonitor/index.vue

@@ -72,7 +72,6 @@
       actions.setGlobalState({ pageObj: { pageType: 'home' } });
     }
     actions.onGlobalStateChange((newState) => {
-      debugger;
       for (const key in newState) {
         if (key === 'pageObj') {
           const pageObj = newState[key];