ソースを参照

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

lxh 6 ヶ月 前
コミット
f1f8f6348d

+ 1 - 1
src/layouts/default/layout.data.ts

@@ -1,5 +1,5 @@
 export const noHeadeLink = ['/micro-vent-3dModal/dashboard/analysis', '/model3D/home', '/fileManager/cad-viewer'];
 export const noHeadeLink = ['/micro-vent-3dModal/dashboard/analysis', '/model3D/home', '/fileManager/cad-viewer'];
-export const noSiderLink = ['/fileManager/cad-viewer'];
+export const noSiderLink = ['/fileManager/cad-viewer', '/micro-vent-3dModal/dashboard/bd/fire', '/micro-vent-3dModal/dashboard/bd/dust'];
 export const noContentLink = ['/micro-vent-3dModal/modelchannel/model3D/home'];
 export const noContentLink = ['/micro-vent-3dModal/modelchannel/model3D/home'];
 export const ThemeModel = {
 export const ThemeModel = {
   theme5_5: {
   theme5_5: {

+ 34 - 2
src/views/vent/home/clique/components/icon-light.vue

@@ -12,12 +12,20 @@
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-  import { ref, defineEmits, inject } from 'vue';
+  import { ref, defineEmits, inject, watch, nextTick } from 'vue';
   import { getAssetURL } from '/@/utils/ui';
   import { getAssetURL } from '/@/utils/ui';
 
 
   const emit = defineEmits(['showDetail']);
   const emit = defineEmits(['showDetail']);
   const globalConfig = inject('globalConfig');
   const globalConfig = inject('globalConfig');
-
+  let props = defineProps({
+    warningList: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+  });
+  // const iconWarningList = ref([]);
   const warningLevel1 = getAssetURL('company/home/point1.png'); // 低风险
   const warningLevel1 = getAssetURL('company/home/point1.png'); // 低风险
   const warningLevel2 = getAssetURL('company/home/point2.png'); // 中风险
   const warningLevel2 = getAssetURL('company/home/point2.png'); // 中风险
   const warningLevel3 = getAssetURL('company/home/point3.png'); // 高风险
   const warningLevel3 = getAssetURL('company/home/point3.png'); // 高风险
@@ -156,6 +164,30 @@
   function openModal(code, label, leftV, topV) {
   function openModal(code, label, leftV, topV) {
     emit('showDetail', code, label, leftV, topV);
     emit('showDetail', code, label, leftV, topV);
   }
   }
+  watch(
+    () => props.warningList,
+    (newVal: any, oldVal: any) => {
+      let newPointList;
+      if (newVal && oldVal && newVal.length == oldVal.length) {
+        for (let i = 0; i < newVal.length; i++) {
+          if (newVal[i].isWarning !== oldVal[i].isWarning) {
+            if (!newPointList) newPointList = [...pointList.value];
+            const index = (newPointList as []).findIndex((item) => item['code'] === newVal[i]['orgcode']);
+            newPointList[index]['imgSrc'] = newVal[i].isWarning ? warningLevel4 : warningLevel1;
+          }
+        }
+      } else {
+        newPointList = [...pointList.value];
+        for (let i = 0; i < newVal.length; i++) {
+          const index = (newPointList as []).findIndex((item) => item['code'] === newVal[i]['orgcode']);
+          newPointList[index]['imgSrc'] = newVal[i].isWarning ? warningLevel4 : warningLevel1;
+        }
+      }
+      if (newPointList) {
+        pointList.value = newPointList;
+      }
+    }
+  );
 </script>
 </script>
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>

+ 12 - 2
src/views/vent/home/clique/index.vue

@@ -19,7 +19,7 @@
           <!-- 地图底图 -->
           <!-- 地图底图 -->
           <div class="center-bg">
           <div class="center-bg">
             <div class="bg-map">
             <div class="bg-map">
-              <iconLight @show-detail="showDetail" />
+              <iconLight @show-detail="showDetail" :warningList="warningList" />
             </div>
             </div>
           </div>
           </div>
           <!-- 榆家梁矿 -->
           <!-- 榆家梁矿 -->
@@ -83,7 +83,7 @@
   //文件共享中心数据
   //文件共享中心数据
   let shareData = reactive<any[]>([]);
   let shareData = reactive<any[]>([]);
 
 
-  // let isWarnign = ref(false)
+  let warningList = ref([]);
 
 
   //通风巷道长度统计数据
   //通风巷道长度统计数据
   let roadData = reactive({
   let roadData = reactive({
@@ -119,6 +119,7 @@
       roadData.data.length = 0;
       roadData.data.length = 0;
       roadData.data1.length = 0;
       roadData.data1.length = 0;
       airKjStatus.length = 0;
       airKjStatus.length = 0;
+      const warningListTemp: { orgcode: string; isWarning: boolean }[] = [];
       res.forEach((el) => {
       res.forEach((el) => {
         airKjStatus.push({
         airKjStatus.push({
           deviceName: el.sys_data.deviceName,
           deviceName: el.sys_data.deviceName,
@@ -126,9 +127,18 @@
           xf: el.sys_data.xufengliang,
           xf: el.sys_data.xufengliang,
           hf: el.sys_data.zonghuifeng,
           hf: el.sys_data.zonghuifeng,
         });
         });
+
+        //临时添加,前端判断,后期后端加上预警再处理
+        if (el.sys_data.zongjinfeng < el.sys_data.xufengliang) {
+          warningListTemp.push({ orgcode: el.orgcode, isWarning: true });
+        } else {
+          warningListTemp.push({ orgcode: el.orgcode, isWarning: false });
+        }
+
         roadData.data.push(el.sys_data.totallength);
         roadData.data.push(el.sys_data.totallength);
         roadData.data1.push(el.sys_data.deviceName);
         roadData.data1.push(el.sys_data.deviceName);
       });
       });
+      warningList.value = warningListTemp;
       compositeData.value = res.reduce((arr, e) => {
       compositeData.value = res.reduce((arr, e) => {
         return [...arr, ...e.majorpath_data];
         return [...arr, ...e.majorpath_data];
       }, []);
       }, []);

+ 11 - 3
src/views/vent/home/configurable/components/ModuleBD.vue

@@ -46,7 +46,7 @@
 
 
 <script setup lang="ts">
 <script setup lang="ts">
   import Content from './content.vue';
   import Content from './content.vue';
-  import { defineProps, defineEmits, computed, onMounted } from 'vue';
+  import { defineProps, defineEmits, computed, onMounted, onUnmounted } from 'vue';
   import { ModuleData, ShowStyle } from '../../../deviceManager/configurationTable/types';
   import { ModuleData, ShowStyle } from '../../../deviceManager/configurationTable/types';
   import { useInitDevices } from '../hooks/useInit';
   import { useInitDevices } from '../hooks/useInit';
 
 
@@ -61,13 +61,14 @@
 
 
   const { header } = props.moduleData;
   const { header } = props.moduleData;
 
 
-  const { selectedDeviceID, selectedDevice, options, fetchDevices } = useInitDevices(props.deviceType, props.moduleData);
+  const { selectedDeviceID, selectedDevice, options, fetchDevicesBD } = useInitDevices(props.deviceType, props.moduleData);
 
 
   const style = computed(() => {
   const style = computed(() => {
     const size = props.showStyle.size;
     const size = props.showStyle.size;
     const position = props.showStyle.position;
     const position = props.showStyle.position;
     return size + position;
     return size + position;
   });
   });
+  let interval: any = null;
 
 
   // 根据配置里的定位判断应该使用哪个module组件
   // 根据配置里的定位判断应该使用哪个module组件
   const daneClass = computed(() => {
   const daneClass = computed(() => {
@@ -97,7 +98,14 @@
   }
   }
 
 
   onMounted(() => {
   onMounted(() => {
-    fetchDevices();
+    fetchDevicesBD({ init: true });
+    interval = setInterval(() => {
+      fetchDevicesBD();
+    }, 600000);
+  });
+
+  onUnmounted(() => {
+    clearInterval(interval);
   });
   });
 </script>
 </script>
 
 

+ 10 - 2
src/views/vent/home/configurable/components/header.vue

@@ -37,7 +37,7 @@
   </div>
   </div>
 </template>
 </template>
 <script lang="ts" setup>
 <script lang="ts" setup>
-  import { onMounted, ref } from 'vue';
+  import { onMounted, onUnmounted, ref } from 'vue';
   import { Config } from '../../../deviceManager/configurationTable/types';
   import { Config } from '../../../deviceManager/configurationTable/types';
   import { useInitDevices } from '../hooks/useInit';
   import { useInitDevices } from '../hooks/useInit';
   import { MenuItem } from 'ant-design-vue';
   import { MenuItem } from 'ant-design-vue';
@@ -55,6 +55,7 @@
     props.deviceType,
     props.deviceType,
     props.moduleData
     props.moduleData
   );
   );
+  let interval: any = null;
 
 
   function selectHandler({ key }) {
   function selectHandler({ key }) {
     selectedDeviceID.value = key;
     selectedDeviceID.value = key;
@@ -62,7 +63,14 @@
   }
   }
 
 
   onMounted(() => {
   onMounted(() => {
-    fetchDevices();
+    fetchDevices({ init: true });
+    interval = setInterval(() => {
+      fetchDevices();
+    }, 600000);
+  });
+
+  onUnmounted(() => {
+    clearInterval(interval);
   });
   });
 </script>
 </script>
 <style scoped>
 <style scoped>

+ 173 - 243
src/views/vent/home/configurable/configurable.data.ts

@@ -1777,139 +1777,102 @@ export const testConfigBDDust: Config[] = [
 ];
 ];
 
 
 const BDfireMock = {
 const BDfireMock = {
-  // 工作面风险监测
-  worksurface: {
-    risk: '低',
-    count: 3,
-    contents: [
+  allMineWarn: '低风险', //全矿井风险级别
+  fireManageInfo: {
+    //工作面风险监测
+    totalNum: '5', //工作面总数
+    dfxNum: '5', //工作面低风险数
+    ybNum: '5', //工作面一般风险数
+    jdNum: '5', //工作面较大风险数
+    zdNum: '5', //工作面重大风险
+    sysList: [
       {
       {
-        risk: '低',
-        name: '81202综放工作面',
-        tmax: '30',
-        gaserr: '0',
-        riskarea: '散热带、氧化带',
+        sysNamme: '工作面名称1', //工作面名称
+        warnLevel: '低风险', //预警级别
+        maxVal: '1.88', //最高温度
       },
       },
       {
       {
-        risk: '低',
-        name: '81205主运掘进面',
-        tmax: '30',
-        gaserr: '0',
-        riskarea: '全部',
+        sysNamme: '工作面名称2', //工作面名称
+        warnLevel: '低风险', //预警级别
+        maxVal: '1.88', //最高温度
       },
       },
     ],
     ],
   },
   },
-  // 采空区
-  ckq: [
+  obfObj: {
+    //密闭采空区监测系统
+    maxC2H4: '', //乙烯最高值
+    maxDp: '', //压差最大值
+    maxTemperature: '', //温度最大值
+    maxCo: '', //一氧化碳最大值
+    maxCo2: '', //二氧化碳最大值
+    maxCh4: '', //甲烷最大值
+    maxC2h2: '', //乙炔最大值
+    maxO2: '', //氧气最大值
+  },
+  btArray: [
+    //工作面束管监测
     {
     {
-      name: '全部',
-      co2: '30',
-      co: '100',
-      temp: '90',
-      gas: '200',
-      windspeed: '1',
-      m3: '20',
-      // 馈电器
-      kdq: '8',
-      deviceID: '1',
+      name: 'CO', //数据名称(前端自己处理化学方程式的标识符)
+      val: '0.2', //最大值
+      strinstallpos: '位置1', //安装位置
+      time: '2024-09-12 15:33:50',
+    },
+    {
+      name: 'CO2', //数据名称(前端自己处理化学方程式的标识符)
+      val: '0.3', //最大值
+      strinstallpos: '位置1', //安装位置
+      time: '2024-09-12 15:33:50',
     },
     },
   ],
   ],
-  // 束管监测 | 光纤监测
-  fiber: {
-    contents: [
-      {
-        name: 'O₂',
-        max: '20',
-        pos: '81202综采工作面隅角',
-        time: '2024-08-13 12:00:00',
-      },
-      {
-        name: 'CH₄',
-        max: '20',
-        pos: '81202综采工作面隅角',
-        time: '2024-08-13 12:00:00',
-      },
-      {
-        name: 'CO',
-        max: '20',
-        pos: '81202综采工作面隅角',
-        time: '2024-08-13 12:00:00',
-      },
-      {
-        name: 'CO₂',
-        max: '20',
-        pos: '81202综采工作面隅角',
-        time: '2024-08-13 12:00:00',
-      },
-    ],
-  },
-  // 带式传输机
-  csj: [
+  pdArray: [
+    //带式输送机防灭火监控系统
+    {
+      name: '光纤预警', //设备名称
+      type: '最高温度', //参数类型
+      val: '35.2', //参数值
+    },
+    {
+      name: '一氧化碳预警',
+      type: '最高浓度',
+      val: '2.3',
+    },
     {
     {
-      name: '全部',
-      max1: '35',
-      max2: '24',
-      max3: '无烟',
-      deviceID: '1',
+      name: '烟雾预警',
+      type: '最高浓度',
+      val: '2.4',
     },
     },
   ],
   ],
-  // 防灭火
-  fmh: {
-    history: [
-      {
-        top: '40',
-        bot: '20',
-      },
-      {
-        top: '30',
-        bot: '20',
-      },
-      {
-        top: '40',
-        bot: '30',
-      },
-      {
-        top: '50',
-        bot: '20',
-      },
-      {
-        top: '20',
-        bot: '20',
-      },
-      {
-        top: '30',
-        bot: '30',
-      },
-      {
-        top: '50',
-        bot: '10',
-      },
-    ],
-  },
-  // 安全监控
-  safty: [
+  dsArray: [
+    //变电硐室防灭火监控系统
     {
     {
-      pos: '81202综采',
-      temp: '20',
-      level: '低',
-      time: '2024-09-06 00:00:00',
+      name: '光纤预警', //设备名称
+      type: '最高温度', //参数类型
+      val: '35.2', //参数值
     },
     },
     {
     {
-      pos: '81202综采',
-      temp: '20',
-      level: '低',
-      time: '2024-09-06 00:00:00',
+      name: '一氧化碳预警',
+      type: '最高浓度',
+      val: '2.3',
     },
     },
     {
     {
-      pos: '81202综采',
-      temp: '20',
-      level: '低',
-      time: '2024-09-06 00:00:00',
+      name: '烟雾预警',
+      type: '最高浓度',
+      val: '2.4',
     },
     },
+  ],
+  aqjkArray: [
+    //安全监控系统
     {
     {
-      pos: '81202综采',
-      temp: '20',
-      level: '低',
-      time: '2024-09-06 00:00:00',
+      strinstallpos: '位置1', //安装位置
+      nowVal: '25.0', //温度
+      warnLevel: '低风险', //预警级别
+      time: '2024-09-12 15:33:50', //时间
+    },
+    {
+      strinstallpos: '位置2', //安装位置
+      nowVal: '25.0', //温度
+      warnLevel: '低风险', //预警级别
+      time: '2024-09-12 15:33:50', //时间
     },
     },
   ],
   ],
 };
 };
@@ -1941,11 +1904,11 @@ export const testConfigBDFire: Config[] = [
       gallery: [
       gallery: [
         {
         {
           type: 'D',
           type: 'D',
-          readFrom: 'worksurface',
+          readFrom: 'fireManageInfo',
           items: [
           items: [
             {
             {
-              label: '${risk}风险',
-              value: '${count}',
+              label: '风险',
+              value: '${dfxNum}',
               color: 'blue',
               color: 'blue',
             },
             },
           ],
           ],
@@ -1957,49 +1920,37 @@ export const testConfigBDFire: Config[] = [
       complex_list: [
       complex_list: [
         {
         {
           type: 'A',
           type: 'A',
-          readFrom: 'worksurface.contents',
+          readFrom: 'fireManageInfo.sysList',
           items: [
           items: [
             {
             {
-              title: '${[0].name}',
+              title: '${[0].sysNamme}',
               contents: [
               contents: [
                 {
                 {
                   label: '风险监测',
                   label: '风险监测',
-                  value: '${[0].risk}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '温度最大值',
-                  value: '${[0].tmax}℃',
+                  value: '${[0].warnLevel}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
                 {
                 {
-                  label: '气体异常值',
-                  value: '${[0].gaserr}',
+                  label: '最高温度',
+                  value: '${[0].maxVal}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
               ],
               ],
             },
             },
             {
             {
-              title: '${[1].name}',
+              title: '${[0].sysNamme}',
               contents: [
               contents: [
                 {
                 {
                   label: '风险监测',
                   label: '风险监测',
-                  value: '${[1].risk}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '温度最大值',
-                  value: '${[1].tmax}℃',
+                  value: '${[0].warnLevel}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
                 {
                 {
-                  label: '气体异常值',
-                  value: '${[1].gaserr}',
+                  label: '最高温度',
+                  value: '${[0].maxVal}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
@@ -2023,8 +1974,8 @@ export const testConfigBDFire: Config[] = [
     pageType: '',
     pageType: '',
     moduleData: {
     moduleData: {
       header: {
       header: {
-        show: true,
-        showSelector: true,
+        show: false,
+        showSelector: false,
         showSlot: false,
         showSlot: false,
         selector: {
         selector: {
           value: '${name}',
           value: '${name}',
@@ -2048,37 +1999,37 @@ export const testConfigBDFire: Config[] = [
           items: [
           items: [
             {
             {
               label: '一氧化碳',
               label: '一氧化碳',
-              value: '${co}',
+              value: '${maxCo}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
               label: '二氧化碳',
               label: '二氧化碳',
-              value: '${co2}',
+              value: '${maxCo2}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
-              label: '温度',
-              value: '${temp}',
+              label: '氧气',
+              value: '${maxO2}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
-              label: '风速',
-              value: '${windspeed}',
+              label: '温度',
+              value: '${maxTemperature}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
-              label: '风量',
-              value: '${m3}',
+              label: '乙烯',
+              value: '${maxC2H4}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
-              label: '馈电器',
-              value: '${kdq}',
+              label: '甲烷',
+              value: '${maxCh4}',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
-              label: '瓦斯',
-              value: '${gas}',
+              label: '乙炔',
+              value: '${maxC2h2}',
               color: 'blue',
               color: 'blue',
             },
             },
           ],
           ],
@@ -2128,20 +2079,20 @@ export const testConfigBDFire: Config[] = [
       complex_list: [
       complex_list: [
         {
         {
           type: 'B',
           type: 'B',
-          readFrom: 'fiber.contents',
+          readFrom: 'btArray',
           items: [
           items: [
             {
             {
-              title: '${[0].name}',
+              title: 'O₂',
               contents: [
               contents: [
                 {
                 {
                   label: '最大浓度',
                   label: '最大浓度',
-                  value: '${[0].max}%',
+                  value: '${[0].val}ppm',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
                 {
                 {
                   label: '位置',
                   label: '位置',
-                  value: '${[0].pos}',
+                  value: '${[0].strinstallpos}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
@@ -2154,17 +2105,17 @@ export const testConfigBDFire: Config[] = [
               ],
               ],
             },
             },
             {
             {
-              title: '${[1].name}',
+              title: 'CO₂',
               contents: [
               contents: [
                 {
                 {
                   label: '最大浓度',
                   label: '最大浓度',
-                  value: '${[1].max}%',
+                  value: '${[1].val}ppm',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
                 {
                 {
                   label: '位置',
                   label: '位置',
-                  value: '${[1].pos}',
+                  value: '${[1].strinstallpos}',
                   color: 'blue',
                   color: 'blue',
                   info: '',
                   info: '',
                 },
                 },
@@ -2176,52 +2127,6 @@ export const testConfigBDFire: Config[] = [
                 },
                 },
               ],
               ],
             },
             },
-            {
-              title: '${[2].name}',
-              contents: [
-                {
-                  label: '最大浓度',
-                  value: '${[2].max}%',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '位置',
-                  value: '${[2].pos}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '时间',
-                  value: '${[2].time}',
-                  color: 'blue',
-                  info: '',
-                },
-              ],
-            },
-            {
-              title: '${[3].name}',
-              contents: [
-                {
-                  label: '最大浓度',
-                  value: '${[3].max}%',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '位置',
-                  value: '${[3].pos}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '时间',
-                  value: '${[3].time}',
-                  color: 'blue',
-                  info: '',
-                },
-              ],
-            },
           ],
           ],
         },
         },
       ],
       ],
@@ -2235,13 +2140,13 @@ export const testConfigBDFire: Config[] = [
     },
     },
   },
   },
   {
   {
-    deviceType: 'csj',
+    deviceType: '',
     moduleName: '带式输送机防灭火监控系统',
     moduleName: '带式输送机防灭火监控系统',
     pageType: '',
     pageType: '',
     moduleData: {
     moduleData: {
       header: {
       header: {
-        show: true,
-        showSelector: true,
+        show: false,
+        showSelector: false,
         showSlot: false,
         showSlot: false,
         selector: {
         selector: {
           value: '${name}',
           value: '${name}',
@@ -2264,24 +2169,24 @@ export const testConfigBDFire: Config[] = [
       list: [
       list: [
         {
         {
           type: 'F',
           type: 'F',
-          readFrom: '',
+          readFrom: 'pdArray',
           items: [
           items: [
             {
             {
               label: '光纤预警',
               label: '光纤预警',
               info: '最高温度',
               info: '最高温度',
-              value: '${max1}℃',
+              value: '${[0].val}℃',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
               label: '一氧化碳预警',
               label: '一氧化碳预警',
               info: '最高浓度',
               info: '最高浓度',
-              value: '${max2}ppm',
+              value: '${[1].val}ppm',
               color: 'blue',
               color: 'blue',
             },
             },
             {
             {
               label: '烟雾预警',
               label: '烟雾预警',
-              info: '状态',
-              value: '${max3}',
+              info: '最高浓度',
+              value: '${[2].val}ppm',
               color: 'blue',
               color: 'blue',
             },
             },
           ],
           ],
@@ -2318,43 +2223,68 @@ export const testConfigBDFire: Config[] = [
         type: 'video',
         type: 'video',
         link: '',
         link: '',
       },
       },
-      layout: ['chart'],
+      layout: ['list'],
       board: [],
       board: [],
-      chart: [
+      // chart: [
+      //   {
+      //     type: 'line_bar',
+      //     readFrom: 'dsArray',
+      //     xAxis: [
+      //       {
+      //         label: 'null',
+      //       },
+      //     ],
+      //     yAxis: [
+      //       {
+      //         label: 'A',
+      //         align: 'left',
+      //       },
+      //       {
+      //         label: 'A',
+      //         align: 'left',
+      //       },
+      //     ],
+      //     series: [
+      //       {
+      //         label: 'A',
+      //         prop: 'top',
+      //       },
+      //       {
+      //         label: 'B',
+      //         prop: 'bot',
+      //       },
+      //     ],
+      //   },
+      // ],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      list: [
         {
         {
-          type: 'line_bar',
-          readFrom: 'fmh.history',
-          xAxis: [
-            {
-              label: 'null',
-            },
-          ],
-          yAxis: [
-            {
-              label: 'A',
-              align: 'left',
-            },
+          type: 'F',
+          readFrom: 'pdArray',
+          items: [
             {
             {
-              label: 'A',
-              align: 'left',
+              label: '光纤预警',
+              info: '最高温度',
+              value: '${[0].val}℃',
+              color: 'blue',
             },
             },
-          ],
-          series: [
             {
             {
-              label: 'A',
-              prop: 'top',
+              label: '一氧化碳预警',
+              info: '最高浓度',
+              value: '${[1].val}ppm',
+              color: 'blue',
             },
             },
             {
             {
-              label: 'B',
-              prop: 'bot',
+              label: '烟雾预警',
+              info: '最高浓度',
+              value: '${[2].val}ppm',
+              color: 'blue',
             },
             },
           ],
           ],
         },
         },
       ],
       ],
-      gallery: [],
-      gallery_list: [],
-      table: [],
-      list: [],
       complex_list: [],
       complex_list: [],
       preset: [],
       preset: [],
       mock: BDfireMock,
       mock: BDfireMock,
@@ -2394,19 +2324,19 @@ export const testConfigBDFire: Config[] = [
       table: [
       table: [
         {
         {
           type: 'C',
           type: 'C',
-          readFrom: 'safty',
+          readFrom: 'aqjkArray',
           columns: [
           columns: [
             {
             {
               name: '测点位置',
               name: '测点位置',
-              prop: 'pos',
+              prop: 'strinstallpos',
             },
             },
             {
             {
               name: '温度',
               name: '温度',
-              prop: 'temp',
+              prop: 'nowVal',
             },
             },
             {
             {
               name: '预警级别',
               name: '预警级别',
-              prop: 'level',
+              prop: 'warnLevel',
             },
             },
             {
             {
               name: '时间',
               name: '时间',

+ 16 - 9
src/views/vent/home/configurable/dustBD.vue

@@ -22,7 +22,9 @@
           <div>区域</div>
           <div>区域</div>
         </div>
         </div>
         <div class="tcontent-c">
         <div class="tcontent-c">
-          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">低风险</div>
+          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
+            {{ homedata.allMineWarn }}
+          </div>
           <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
           <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
         </div>
         </div>
         <div class="tcontent-r">
         <div class="tcontent-r">
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDDust } from './configurable.data';
   import { testConfigBDDust } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
 
   interface EnhancedConfig extends Config {
   interface EnhancedConfig extends Config {
     visible: boolean;
     visible: boolean;
@@ -123,18 +126,22 @@
     return enhancedConfigs.value.filter((e) => e.visible === false);
     return enhancedConfigs.value.filter((e) => e.visible === false);
   });
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
+  const homedata = ref<any>({});
 
 
   onMounted(() => {
   onMounted(() => {
     // configs.value = testConfigB;
     // configs.value = testConfigB;
-    fetchConfigs().then(() => {
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
+    fetchConfigs('BD_dust').then(() => {
       configs.value = testConfigBDDust;
       configs.value = testConfigBDDust;
-      // configs.value.push(...testConfigBDDust);
-      enhancedConfigs.value = configs.value.map((c) => {
-        return {
-          visible: true,
-          ...c,
-        };
-      });
+      // // configs.value.push(...testConfigBDDust);
+      // enhancedConfigs.value = configs.value.map((c) => {
+      //   return {
+      //     visible: true,
+      //     ...c,
+      //   };
+      // });
     });
     });
   });
   });
 
 

+ 17 - 10
src/views/vent/home/configurable/fireBD.vue

@@ -22,8 +22,10 @@
           <div>区域</div>
           <div>区域</div>
         </div>
         </div>
         <div class="tcontent-c">
         <div class="tcontent-c">
-          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">低风险</div>
-          <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div>
+          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
+            {{ homedata.allMineWarn }}
+          </div>
+          <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
         </div>
         </div>
         <div class="tcontent-r">
         <div class="tcontent-r">
           <div>火灾</div>
           <div>火灾</div>
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDFire } from './configurable.data';
   import { testConfigBDFire } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
 
   interface EnhancedConfig extends Config {
   interface EnhancedConfig extends Config {
     visible: boolean;
     visible: boolean;
@@ -124,17 +127,21 @@
   });
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
 
 
+  const homedata = ref<any>({});
+
   onMounted(() => {
   onMounted(() => {
     // configs.value = testConfigB;
     // configs.value = testConfigB;
-    fetchConfigs().then(() => {
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
+    fetchConfigs('BD_fire').then(() => {
       configs.value = testConfigBDFire;
       configs.value = testConfigBDFire;
-      // configs.value.push(...testConfigBDFire);
-      enhancedConfigs.value = configs.value.map((c) => {
-        return {
-          visible: true,
-          ...c,
-        };
-      });
+      // enhancedConfigs.value = configs.value.map((c) => {
+      //   return {
+      //     visible: true,
+      //     ...c,
+      //   };
+      // });
     });
     });
   });
   });
 
 

+ 40 - 2
src/views/vent/home/configurable/hooks/useInit.ts

@@ -80,7 +80,7 @@ export function useInitDevices(devicekind: string, config: Config['moduleData'])
   });
   });
 
 
   // 获取设备数据,赋值并以选项格式返回给 Header 消费
   // 获取设备数据,赋值并以选项格式返回给 Header 消费
-  function fetchDevices() {
+  function fetchDevices({ init = false } = {}) {
     const { value } = header.selector;
     const { value } = header.selector;
     const promise = mock ? Promise.resolve(mock) : getHomeData({});
     const promise = mock ? Promise.resolve(mock) : getHomeData({});
     return promise.then((result) => {
     return promise.then((result) => {
@@ -99,7 +99,44 @@ export function useInitDevices(devicekind: string, config: Config['moduleData'])
             value: e.id,
             value: e.id,
           };
           };
         });
         });
-        selectedDeviceID.value = options.value[0]?.value;
+        if (init) {
+          selectedDeviceID.value = options.value[0]?.value;
+        }
+      } else {
+        // 没有的话按默认的,将返回结果直接作为一整个设备信息供模块使用
+        const record = {
+          ...result,
+          id: '00000000',
+        };
+        devices.value = [record];
+        selectedDeviceID.value = record.id;
+      }
+    });
+  }
+
+  // 保德专用-获取设备数据,赋值并以选项格式返回给 Header 消费
+  function fetchDevicesBD({ init = false } = {}) {
+    const { value } = header.selector;
+    const promise = mock ? Promise.resolve(mock) : getHomeData({});
+    return promise.then((result) => {
+      if (header.show && header.showSelector && result[devicekind]) {
+        // 如果配置里指明需要 header,检验后初始化设备信息
+        const records: Record<string, any>[] = result[devicekind];
+        devices.value = records.map((e, i) => {
+          return {
+            id: i,
+            ...e,
+          };
+        });
+        options.value = devices.value.map((e) => {
+          return {
+            label: getFormattedText(e, value),
+            value: e.id,
+          };
+        });
+        if (init) {
+          selectedDeviceID.value = options.value[0]?.value;
+        }
       } else {
       } else {
         // 没有的话按默认的,将返回结果直接作为一整个设备信息供模块使用
         // 没有的话按默认的,将返回结果直接作为一整个设备信息供模块使用
         const record = {
         const record = {
@@ -114,6 +151,7 @@ export function useInitDevices(devicekind: string, config: Config['moduleData'])
 
 
   return {
   return {
     fetchDevices,
     fetchDevices,
+    fetchDevicesBD,
     selectedDevice,
     selectedDevice,
     selectedDeviceID,
     selectedDeviceID,
     selectedDeviceSlot,
     selectedDeviceSlot,

+ 8 - 1
src/views/vent/home/configurable/index.vue

@@ -22,7 +22,9 @@
           <div>区域</div>
           <div>区域</div>
         </div>
         </div>
         <div class="tcontent-c">
         <div class="tcontent-c">
-          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">低风险</div>
+          <div style="margin-bottom: 15px; color: #009bff; font-size: 24px; font-weight: bolder; letter-spacing: 10px">
+            {{ homedata.allMineWarn }}
+          </div>
           <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
           <!-- <div style="color: #fff; font-size: 12px">自燃倾向性等级 : 容易自燃</div> -->
         </div>
         </div>
         <div class="tcontent-r">
         <div class="tcontent-r">
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDDust } from './configurable.data';
   import { testConfigBDDust } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
 
   interface EnhancedConfig extends Config {
   interface EnhancedConfig extends Config {
     visible: boolean;
     visible: boolean;
@@ -123,9 +126,13 @@
     return enhancedConfigs.value.filter((e) => e.visible === false);
     return enhancedConfigs.value.filter((e) => e.visible === false);
   });
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
+  const homedata = ref<any>({});
 
 
   onMounted(() => {
   onMounted(() => {
     // configs.value = testConfigB;
     // configs.value = testConfigB;
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
     fetchConfigs().then(() => {
     fetchConfigs().then(() => {
       configs.value = testConfigBDDust;
       configs.value = testConfigBDDust;
       // configs.value.push(...testConfigBDDust);
       // configs.value.push(...testConfigBDDust);