Browse Source

[Mod 0000] 公司端看板火灾看板对接及修改

houzekong 9 months ago
parent
commit
0d6c3141a3

+ 239 - 37
src/views/vent/home/billboard/billboard.data.ts

@@ -1,6 +1,150 @@
 import leftImg from '/@/assets/images/files/homes/file.svg';
 import rightImg from '/@/assets/images/files/homes/sp.svg';
 
+// export interface TITLE_CONFIG {
+//   text: string;
+//   prop: string;
+//   translation?: Record<string | number, string>;
+//   default: string;
+// }
+// export interface HEADER_CONFIG {
+//   label: string;
+//   prop: string;
+//   translation?: Record<string | number, string>;
+//   default: string;
+// }
+// export interface TABLE_CONFIG {
+//   columns: { label: string; prop: string; _t?: boolean }[];
+//   collapses: { label: string; prop: string; _t?: boolean }[];
+//   translation?: Record<string | number, string>;
+//   default: string;
+// }
+// export interface CONTENT_CONFIG {
+//   src: string;
+//   text: string;
+//   prop: string;
+// }
+// export interface TREE_CONFIG {
+//   translation?: Record<string | number, string>;
+//   default: string;
+//   prefix: string;
+//   prop: string;
+//   suffix: string;
+//   children: {
+//     prefix: string;
+//     prop: string;
+//     suffix: string;
+//   }[];
+// }
+
+// /** 看板的总配置 */
+// export const BILLBOARD_CONFIG = {
+//   DustStatus: {
+//     title: {
+//       text: '',
+//       prop: '',
+//       translation: {},
+//     },
+//     table: {
+//       columns: [{ label: '', prop: '' }],
+//       collapses: [{ label: '', prop: '' }],
+//       translation: {},
+//     },
+//   },
+//   FileOverview: {
+//     content: [
+//       { src: leftImg, text: '文档总数', prop: 'totalNum' },
+//       { src: rightImg, text: '待审批数', prop: 'approvalNum' },
+//     ],
+//   },
+//   FireStatus: {
+//     title: {
+//       text: '',
+//       prop: '',
+//       translation: {},
+//     },
+//     list: [
+//       {
+//         icon: '',
+//         label: '',
+//         prop: '',
+//         type: '',
+//         translation: {},
+//         collapses: [{ label: '', prop: '' }],
+//       },
+//     ],
+//   },
+//   GasStatus: {
+//     header: [
+//       {
+//         label: '',
+//         prop: '',
+//         translation: {},
+//       },
+//     ],
+//     table: {
+//       columns: [],
+//       collapses: [],
+//       translation: {},
+//     },
+//   },
+//   Summary: {
+//     header: [
+//       {
+//         label: '',
+//         prop: '',
+//         translation: {},
+//       },
+//     ],
+//     table: {
+//       columns: [],
+//       translation: {},
+//     },
+//   },
+//   VentilationStatus: {
+//     header: [
+//       {
+//         label: '',
+//         prop: '',
+//         filte: '',
+//         translation: {},
+//       },
+//     ],
+//     tree: {
+//       prefix: '',
+//       prop: 'strname',
+//       suffix: '',
+//       children: [
+//         {
+//           prefix: '名称:',
+//           prop: 'strinstallpos',
+//           suffix: '',
+//         },
+//         {
+//           prefix: '1号风机风量:',
+//           prop: 'Fan1m3',
+//           suffix: '(m³/min)',
+//         },
+//         {
+//           prefix: '2号风机风量:',
+//           prop: 'Fan2m3',
+//           suffix: '(m³/min)',
+//         },
+//         {
+//           prefix: '频率:',
+//           prop: 'FanFreqHz',
+//           suffix: 'Hz',
+//         },
+//         {
+//           prefix: '三区阻力分布:',
+//           prop: 'sqzlfb',
+//           suffix: '',
+//         },
+//       ],
+//     },
+//   },
+// };
+
 // 基础的表格列配置,针对普通设备
 export const GAS_STATUS_COLUMN = [
   {
@@ -58,80 +202,99 @@ export const DUST_COLLAPSES = [
 ];
 
 // 火灾状态监测相关的内容配置项
-export const FIRE_STATUS_IGNORE_TRANSLATION_KEYS = ['tempMax'];
 export const FIRE_STATUS_LIST = [
   {
     icon: 'warning-optical-fiber',
     label: '光纤测温系统报警',
-    prop: 'fiberInfo',
+    prop: 'fiberInfo.warnLevel',
     collapses: [
       {
         name: '最大值位置',
-        prop: 'maxValueInstallPos',
+        prop: 'fiberInfo.maxValueInstallPos',
       },
       {
         name: '最大值(℃)',
-        prop: 'maxValue',
+        prop: 'fiberInfo.maxValue',
       },
     ],
   },
   {
     icon: 'warning-tubes',
     label: '束管监测系统报警',
-    prop: 'bundletubeInfo',
+    prop: 'bundletubeInfo.warnLevel',
     collapses: [
       {
         name: '最大值位置',
-        prop: 'maxValueInstallPos',
+        prop: 'bundletubeInfo.maxValueInstallPos',
+      },
+      {
+        name: '一氧化碳最大值(ppm)',
+        prop: 'bundletubeInfo.coval',
       },
       {
-        name: 'CO最大值(ppm)',
-        prop: 'maxValue',
+        name: 'CH2最大值(ppm)',
+        prop: 'bundletubeInfo.ch2val',
+      },
+      {
+        name: '氧气最大值(ppm)',
+        prop: 'bundletubeInfo.o2val',
+      },
+      {
+        name: 'CH最大值(ppm)',
+        prop: 'bundletubeInfo.chval',
+      },
+      {
+        name: '瓦斯最大值(%)',
+        prop: 'bundletubeInfo.gasval',
+      },
+      {
+        name: '二氧化碳最大值(ppm)',
+        prop: 'bundletubeInfo.co2val',
       },
     ],
   },
   {
     icon: 'warning-smoke-2',
     label: '烟雾传感器报警',
-    prop: 'smokeSensorInfo',
+    prop: 'smokeSensorInfo.warnLevel',
     collapses: [
       {
         name: '最大值位置',
-        prop: 'maxValueInstallPos',
+        prop: 'smokeSensorInfo.maxValueInstallPos',
       },
       {
         name: '最大值(%)',
-        prop: 'maxValue',
+        prop: 'smokeSensorInfo.maxValue',
       },
     ],
   },
   {
     icon: 'warning-CO-2',
     label: 'CO传感器报警',
-    prop: 'coSensorInfo',
+    prop: 'coSensorInfo.warnLevel',
     collapses: [
       {
         name: '最大值位置',
-        prop: 'maxValueInstallPos',
+        prop: 'coSensorInfo.maxValueInstallPos',
       },
       {
         name: '最大值(ppm)',
-        prop: 'maxValue',
+        prop: 'coSensorInfo.maxValue',
       },
     ],
   },
   {
     icon: 'warning-temp',
     label: '温度传感器报警',
-    prop: 'tempSensorInfo',
+    prop: 'tempSensorInfo.warnLevel',
     collapses: [
       {
         name: '最大值位置',
-        prop: 'maxValueInstallPos',
+        prop: 'tempSensorInfo.maxValueInstallPos',
       },
       {
         name: '最大值(℃)',
-        prop: 'maxValue',
+        prop: 'tempSensorInfo.maxValue',
       },
     ],
   },
@@ -259,13 +422,52 @@ export const DEFAULT_TEST_DATA = {
     approvalNum: 0, // 待审批文档
   },
   fireInfo: {
-    tempMax: 0, // 矿井温度传感器最高温度
-    fireWarnLevel: 0, // 矿井火灾风险等级
-    coSensorInfo: 0, // 矿井CO传感器报警等级
-    bundletubeInfo: 0, // 矿井束管监测报警等级
-    smokeSensorInfo: 0, // 矿井烟雾传感器报警等级
-    fiberInfo: 0, // 矿井光纤测温系统报警等级
-    tempSensorInfo: 0, // 矿井温度传感器报警等级
+    tempMax: 29,
+    fireWarnLevel: 1001,
+    bundletubeInfo: {
+      typeName: '束管',
+      maxValueInstallPos: '31310采空区50m',
+      tempMax: 0,
+      coval: '2.0',
+      ch2val: '0.0',
+      deviceType: 'bundletube_auto',
+      warnLevel: 1001,
+      maxValue: 2,
+      o2val: '10.31',
+      totalNum: 12,
+      chval: '0.0',
+      gasval: '0.0',
+      time: '2024-05-31 16:34:04',
+      isRun: '-2',
+      co2val: '7.42',
+    },
+    smokeSensorInfo: {
+      deviceType: 'modelsensor_smoke',
+      tempMax: 0,
+      warnLevel: 0,
+      totalNum: 30,
+      maxValue: 0,
+      typeName: '烟雾传感器',
+      maxValueInstallPos: '12煤井底停车场',
+    },
+    fiberInfo: {
+      deviceType: 'fiber_normal',
+      tempMax: 0,
+      warnLevel: 0,
+      totalNum: 4,
+      maxValue: 25,
+      typeName: '光纤测温',
+      maxValueInstallPos: '31煤中央变电所电缆沟-通道一',
+    },
+    tempSensorInfo: {
+      deviceType: 'modelsensor_temperature',
+      tempMax: 29,
+      warnLevel: 0,
+      totalNum: 51,
+      maxValue: 29,
+      typeName: '温度传感器',
+      maxValueInstallPos: '主通风机房配电室',
+    },
   },
   gasInfo: {
     gasWarnLevel: 0, // 瓦斯风险等级
@@ -299,24 +501,24 @@ export const DEFAULT_TEST_DATA = {
         ventS: {
           maxLevel: 0,
           netstatus: 0,
-          code: 'ventS',
-          levelstatus: '低风险',
-          maxLevel_str: '正常',
-          name: '通风',
+          code: '/',
+          levelstatus: '/',
+          maxLevel_str: '/',
+          name: '/',
           count: 0,
-          status: '正常',
-          maxLevel_status: '低风险',
+          status: '/',
+          maxLevel_status: '/',
         },
         fireS: {
           maxLevel: 0,
-          code: 'fireS',
-          maxLevel_str: '正常',
+          code: '/',
+          maxLevel_str: '/',
           count: 0,
-          netstatus: 1,
-          levelstatus: '低风险',
-          name: '防灭火',
-          status: '正常',
-          maxLevel_status: '低风险',
+          netstatus: 0,
+          levelstatus: '/',
+          name: '/',
+          status: '/',
+          maxLevel_status: '/',
         },
         synthesizeS: {
           maxLevel: 0,

+ 4 - 2
src/views/vent/home/billboard/components/CollapseTable.vue

@@ -4,7 +4,7 @@
       <div class="table__content_label">
         <div class="label-t" v-for="(item, index) in columns" :key="`svvhbcth-${index}`" :style="{ flexBasis }">{{ item.name }}</div>
       </div>
-      <Collapse ghost class="table__content_list" :style="{ height: contentHeight }">
+      <Collapse v-model:activeKey="avtiveCollapse" ghost class="table__content_list" :style="{ height: contentHeight }">
         <CollapsePanel v-for="(item, index) in data" :key="`svvhbct-${index}`" class="table__content_list_row" :showArrow="showArrow">
           <template #header>
             <div v-for="(t, i) in columns" :key="`svvhbctr-${i}`" :style="{ flexBasis }">
@@ -22,7 +22,7 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { computed, defineProps } from 'vue';
+  import { computed, defineProps, ref } from 'vue';
   import _ from 'lodash-es';
   import { Collapse, CollapsePanel } from 'ant-design-vue';
 
@@ -46,6 +46,8 @@
     }
   );
 
+  const avtiveCollapse = ref('svvhbct-0');
+
   const flexBasis = computed(() => {
     return Math.fround(100 / props.columns.length) + '%';
   });

+ 9 - 6
src/views/vent/home/billboard/components/FireStatus.vue

@@ -8,7 +8,7 @@
           <ListItem :key="item.icon" :icon="item.icon" :label="item.label" :value="get(listData, item.prop)" :type="i % 2 ? 'green' : 'blue'" />
         </template>
         <template #default>
-          <p v-for="(t, ix) in item.collapses" :key="`svvhbcfcp-${i}${ix}`" class="fire_list_collapse"> {{ t.name }}:{{ get(item, t.prop) }} </p>
+          <p v-for="(t, ix) in item.collapses" :key="`svvhbcfcp-${i}${ix}`" class="fire_list_collapse"> {{ t.name }}:{{ get(listData, t.prop) }} </p>
         </template>
       </CollapsePanel>
     </Collapse>
@@ -21,7 +21,7 @@
   import { ref, shallowRef, onMounted } from 'vue';
   import CommonTitle from './CommonTitle.vue';
   import ListItem from './ListItem.vue';
-  import { BillboardType, DEFAULT_TEST_DATA, FIRE_STATUS_LIST, FIRE_STATUS_IGNORE_TRANSLATION_KEYS } from '../billboard.data';
+  import { BillboardType, DEFAULT_TEST_DATA, FIRE_STATUS_LIST } from '../billboard.data';
 
   const props = withDefaults(
     defineProps<{
@@ -58,11 +58,14 @@
       1001: '网络断开',
     };
     risk.value = riskTrans[get(info, 'fireWarnLevel', 0)];
-    _.forEach(info, (val, key) => {
-      if (FIRE_STATUS_IGNORE_TRANSLATION_KEYS.includes(key)) return;
-      info[key] = warnTrans[val];
+    const value = {};
+    FIRE_STATUS_LIST.forEach((cfg) => {
+      value[cfg.prop] = get(info, cfg.prop);
+      cfg.collapses.forEach((el) => {
+        value[el.prop] = get(info, el.prop);
+      });
     });
-    listData.value = info;
+    listData.value = value;
   }
 
   onMounted(() => {

+ 1 - 1
src/views/vent/home/billboard/index.vue

@@ -120,7 +120,7 @@
     VentilationStatus: '/micro-vent-3dModal/dashboard/analysis',
     GasStatus: '/gas/warn/home',
     FireStatus: '/fire/warn/home',
-    Summary: undefined,
+    Summary: '/monitorChannel/monitor-alarm-home',
   };
   // 页面跳转
   function openHandler(ip: string) {