Prechádzať zdrojové kódy

[Feat 0000] 保德可配置首页粉尘模拟对接

houzekong 6 mesiacov pred
rodič
commit
2fe5f2ad81

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

@@ -1777,139 +1777,102 @@ export const testConfigBDDust: Config[] = [
 ];
 
 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: [
         {
           type: 'D',
-          readFrom: 'worksurface',
+          readFrom: 'fireManageInfo',
           items: [
             {
-              label: '${risk}风险',
-              value: '${count}',
+              label: '风险',
+              value: '${dfxNum}',
               color: 'blue',
             },
           ],
@@ -1957,49 +1920,37 @@ export const testConfigBDFire: Config[] = [
       complex_list: [
         {
           type: 'A',
-          readFrom: 'worksurface.contents',
+          readFrom: 'fireManageInfo.sysList',
           items: [
             {
-              title: '${[0].name}',
+              title: '${[0].sysNamme}',
               contents: [
                 {
                   label: '风险监测',
-                  value: '${[0].risk}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '温度最大值',
-                  value: '${[0].tmax}℃',
+                  value: '${[0].warnLevel}',
                   color: 'blue',
                   info: '',
                 },
                 {
-                  label: '气体异常值',
-                  value: '${[0].gaserr}',
+                  label: '最高温度',
+                  value: '${[0].maxVal}',
                   color: 'blue',
                   info: '',
                 },
               ],
             },
             {
-              title: '${[1].name}',
+              title: '${[0].sysNamme}',
               contents: [
                 {
                   label: '风险监测',
-                  value: '${[1].risk}',
-                  color: 'blue',
-                  info: '',
-                },
-                {
-                  label: '温度最大值',
-                  value: '${[1].tmax}℃',
+                  value: '${[0].warnLevel}',
                   color: 'blue',
                   info: '',
                 },
                 {
-                  label: '气体异常值',
-                  value: '${[1].gaserr}',
+                  label: '最高温度',
+                  value: '${[0].maxVal}',
                   color: 'blue',
                   info: '',
                 },
@@ -2023,8 +1974,8 @@ export const testConfigBDFire: Config[] = [
     pageType: '',
     moduleData: {
       header: {
-        show: true,
-        showSelector: true,
+        show: false,
+        showSelector: false,
         showSlot: false,
         selector: {
           value: '${name}',
@@ -2048,37 +1999,37 @@ export const testConfigBDFire: Config[] = [
           items: [
             {
               label: '一氧化碳',
-              value: '${co}',
+              value: '${maxCo}',
               color: 'blue',
             },
             {
               label: '二氧化碳',
-              value: '${co2}',
+              value: '${maxCo2}',
               color: 'blue',
             },
             {
-              label: '温度',
-              value: '${temp}',
+              label: '氧气',
+              value: '${maxO2}',
               color: 'blue',
             },
             {
-              label: '风速',
-              value: '${windspeed}',
+              label: '温度',
+              value: '${maxTemperature}',
               color: 'blue',
             },
             {
-              label: '风量',
-              value: '${m3}',
+              label: '乙烯',
+              value: '${maxC2H4}',
               color: 'blue',
             },
             {
-              label: '馈电器',
-              value: '${kdq}',
+              label: '甲烷',
+              value: '${maxCh4}',
               color: 'blue',
             },
             {
-              label: '瓦斯',
-              value: '${gas}',
+              label: '乙炔',
+              value: '${maxC2h2}',
               color: 'blue',
             },
           ],
@@ -2128,20 +2079,20 @@ export const testConfigBDFire: Config[] = [
       complex_list: [
         {
           type: 'B',
-          readFrom: 'fiber.contents',
+          readFrom: 'btArray',
           items: [
             {
-              title: '${[0].name}',
+              title: 'O₂',
               contents: [
                 {
                   label: '最大浓度',
-                  value: '${[0].max}%',
+                  value: '${[0].val}ppm',
                   color: 'blue',
                   info: '',
                 },
                 {
                   label: '位置',
-                  value: '${[0].pos}',
+                  value: '${[0].strinstallpos}',
                   color: 'blue',
                   info: '',
                 },
@@ -2154,17 +2105,17 @@ export const testConfigBDFire: Config[] = [
               ],
             },
             {
-              title: '${[1].name}',
+              title: 'CO₂',
               contents: [
                 {
                   label: '最大浓度',
-                  value: '${[1].max}%',
+                  value: '${[1].val}ppm',
                   color: 'blue',
                   info: '',
                 },
                 {
                   label: '位置',
-                  value: '${[1].pos}',
+                  value: '${[1].strinstallpos}',
                   color: 'blue',
                   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: '带式输送机防灭火监控系统',
     pageType: '',
     moduleData: {
       header: {
-        show: true,
-        showSelector: true,
+        show: false,
+        showSelector: false,
         showSlot: false,
         selector: {
           value: '${name}',
@@ -2264,24 +2169,24 @@ export const testConfigBDFire: Config[] = [
       list: [
         {
           type: 'F',
-          readFrom: '',
+          readFrom: 'pdArray',
           items: [
             {
               label: '光纤预警',
               info: '最高温度',
-              value: '${max1}℃',
+              value: '${[0].val}℃',
               color: 'blue',
             },
             {
               label: '一氧化碳预警',
               info: '最高浓度',
-              value: '${max2}ppm',
+              value: '${[1].val}ppm',
               color: 'blue',
             },
             {
               label: '烟雾预警',
-              info: '状态',
-              value: '${max3}',
+              info: '最高浓度',
+              value: '${[2].val}ppm',
               color: 'blue',
             },
           ],
@@ -2318,43 +2223,68 @@ export const testConfigBDFire: Config[] = [
         type: 'video',
         link: '',
       },
-      layout: ['chart'],
+      layout: ['list'],
       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: [],
       preset: [],
       mock: BDfireMock,
@@ -2394,19 +2324,19 @@ export const testConfigBDFire: Config[] = [
       table: [
         {
           type: 'C',
-          readFrom: 'safty',
+          readFrom: 'aqjkArray',
           columns: [
             {
               name: '测点位置',
-              prop: 'pos',
+              prop: 'strinstallpos',
             },
             {
               name: '温度',
-              prop: 'temp',
+              prop: 'nowVal',
             },
             {
               name: '预警级别',
-              prop: 'level',
+              prop: 'warnLevel',
             },
             {
               name: '时间',

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

@@ -22,7 +22,9 @@
           <div>区域</div>
         </div>
         <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>
         <div class="tcontent-r">
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDDust } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
   interface EnhancedConfig extends Config {
     visible: boolean;
@@ -123,9 +126,13 @@
     return enhancedConfigs.value.filter((e) => e.visible === false);
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
+  const homedata = ref<any>({});
 
   onMounted(() => {
     // configs.value = testConfigB;
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
     fetchConfigs().then(() => {
       configs.value = testConfigBDDust;
       // configs.value.push(...testConfigBDDust);

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

@@ -22,8 +22,10 @@
           <div>区域</div>
         </div>
         <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 class="tcontent-r">
           <div>火灾</div>
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDFire } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
   interface EnhancedConfig extends Config {
     visible: boolean;
@@ -124,8 +127,13 @@
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
 
+  const homedata = ref<any>({});
+
   onMounted(() => {
     // configs.value = testConfigB;
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
     fetchConfigs().then(() => {
       configs.value = testConfigBDFire;
       // configs.value.push(...testConfigBDFire);

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

@@ -22,7 +22,9 @@
           <div>区域</div>
         </div>
         <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>
         <div class="tcontent-r">
@@ -108,6 +110,7 @@
   import ModuleBD from './components/ModuleBD.vue';
   import { testConfigBDDust } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { getHomeData } from './configurable.api';
 
   interface EnhancedConfig extends Config {
     visible: boolean;
@@ -123,9 +126,13 @@
     return enhancedConfigs.value.filter((e) => e.visible === false);
   });
   const { configs, isOriginal, isCommon, isBD, fetchConfigs } = useInitConfigs();
+  const homedata = ref<any>({});
 
   onMounted(() => {
     // configs.value = testConfigB;
+    getHomeData({}).then((r) => {
+      homedata.value = r;
+    });
     fetchConfigs().then(() => {
       configs.value = testConfigBDDust;
       // configs.value.push(...testConfigBDDust);