Browse Source

[Feat 0000] 均压可配置模块开发

houzekong 1 week ago
parent
commit
23bb7e2f51

+ 118 - 49
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHome2.vue

@@ -19,6 +19,7 @@
   import { list } from '../balancePress.api';
   import ModuleCommon from '../../../home/configurable/components/ModuleCommon.vue';
   import { useInitConfigs } from '../../../home/configurable/hooks/useInit';
+  import { useGlobSetting } from '/@/hooks/setting';
   // import { Config } from '../../../deviceManager/configurationTable/types';
 
   const props = defineProps({
@@ -28,6 +29,8 @@
     },
   });
 
+  const { sysOrgCode } = useGlobSetting();
+
   const loading = ref(false);
 
   // 监测数据
@@ -58,17 +61,52 @@
 
   async function getDataSource(systemID) {
     const res = await list({ devicetype: 'sys', systemID });
-    const result = Array.from(res.msgTxt).reduce((obj: any, e: any) => {
-      obj[e.type] = e;
-      return obj;
-    }, {});
+
+    const result = Array.from(res.msgTxt).reduce(
+      (obj: any, e: any) => {
+        obj[e.type] = e;
+
+        // if (true) {
+        if (sysOrgCode === 'sdmtjtswmk') {
+          if (e.type.startsWith('fanlocal')) {
+            obj.fanlocal.datalist.push(...e.datalist);
+          }
+          if (e.type.startsWith('safetymonitor')) {
+            e.datalist.forEach((ele) => {
+              if (ele.strinstallpos.includes('风门')) {
+                obj.gate.datalist.push(ele);
+              } else if (ele.strinstallpos.includes('风窗')) {
+                obj.window.datalist.push(ele);
+              } else if (ele.strinstallpos.includes('工作面')) {
+                obj.work_surface.datalist.push(ele);
+              } else {
+                obj.others.datalist.push(ele);
+              }
+            });
+          }
+        }
+
+        return obj;
+      },
+      {
+        /** 用于归类fanlocal */
+        fanlocal: { datalist: [] },
+        /** 用于归类gate */
+        gate: { datalist: [] },
+        /** 用于归类window */
+        window: { datalist: [] },
+        /** 用于归类work_surface */
+        work_surface: { datalist: [] },
+        others: { datalist: [] },
+      }
+    );
 
     return result;
   }
 
   // const configs = ref<Config[]>([
   //   {
-  //     deviceType: 'fanlocal_steml_zj',
+  //     deviceType: 'fanlocal',
   //     moduleName: '局部风机',
   //     pageType: 'balancePressHome',
   //     moduleData: {
@@ -77,19 +115,15 @@
   //         readFrom: 'datalist',
   //         selector: {
   //           show: true,
-  //           value: '${deviceId}',
+  //           value: '${deviceID}',
   //           trans: {
-  //             11111002: '主机',
-  //             11111001: '备机',
+  //             '1910221332833665026': '主机',
+  //             '1910221283626090497': '备机',
   //           },
   //         },
   //         slot: {
-  //           show: true,
-  //           value: '${readData.Fan1StartStatus}',
-  //           trans: {
-  //             '1': '电机1',
-  //             '0': '电机2',
-  //           },
+  //           show: false,
+  //           value: '',
   //         },
   //       },
   //       background: {
@@ -101,7 +135,7 @@
   //         direction: 'column',
   //         items: [
   //           {
-  //             name: 'list',
+  //             name: 'tabs',
   //             basis: '100%',
   //           },
   //         ],
@@ -110,24 +144,52 @@
   //       chart: [],
   //       table: [],
   //       gallery: [],
-  //       list: [
+  //       list: [],
+  //       tabs: [
   //         {
   //           type: 'K',
   //           readFrom: '',
+  //           mapFromData: false,
   //           items: [
   //             {
-  //               label: '工作面温度',
-  //               value: '${readData.Fan1StartStatus}',
-  //               trans: {
-  //                 '1': '${readData.windSpeed1}',
-  //                 '0': '${readData.windSpeed2}',
-  //               },
-  //               color: 'blue',
+  //               title: '电机1',
+  //               contents: [
+  //                 {
+  //                   label: '输出功率',
+  //                   value: '${readData.Fan1StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //                 {
+  //                   label: '输出电压',
+  //                   value: '${readData.Fan1StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //               ],
   //             },
   //             {
-  //               label: '测试字段',
-  //               value: '--',
-  //               color: 'blue',
+  //               title: '电机2',
+  //               contents: [
+  //                 {
+  //                   label: '输出功率',
+  //                   value: '${readData.Fan2StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //                 {
+  //                   label: '输出电压',
+  //                   value: '${readData.Fan2StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //                 {
+  //                   label: '输出电压',
+  //                   value: '${readData.Fan2StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //                 {
+  //                   label: '输出电压',
+  //                   value: '${readData.Fan2StartStatus}',
+  //                   color: 'blue',
+  //                 },
+  //               ],
   //             },
   //           ],
   //         },
@@ -137,7 +199,7 @@
   //       to: '',
   //     },
   //     showStyle: {
-  //       size: 'width:470px;height:230px;',
+  //       size: 'width:470px;height:260px;',
   //       version: '原版',
   //       position: 'top:20px;left:0;',
   //     },
@@ -176,19 +238,21 @@
   //       complex_list: [
   //         {
   //           type: 'G',
-  //           readFrom: 'gate_qd.datalist',
+  //           readFrom: 'gate.datalist',
   //           mapFromData: true,
   //           items: [
   //             {
-  //               title: '${deviceId}',
+  //               title: '${deviceID}',
   //               trans: {
-  //                 1364413501780168700: '这是1364413501780168700的翻译文本',
-  //                 1364413472814305300: '1364413472814305300的新翻译文本',
+  //                 '1915631893453004802': '22107胶运顺槽入口自动风门2',
+  //                 '1915631893478170626': '22107胶运顺槽入口自动风门1',
+  //                 '1915631897043329025': '22107辅回撤通道自动风门1',
+  //                 '1915631895088783362': '22107辅回撤通道自动风门2',
   //               },
   //               contents: [
   //                 {
-  //                   label: '风量',
-  //                   value: '${readData.m3}',
+  //                   label: '状态',
+  //                   value: '${readData.V}',
   //                   color: 'blue',
   //                 },
   //               ],
@@ -205,14 +269,14 @@
   //       to: '',
   //     },
   //     showStyle: {
-  //       size: 'width:470px;height:230px;',
+  //       size: 'width:470px;height:320px;',
   //       version: '原版',
-  //       position: 'top:260px;left:0;',
+  //       position: 'top:290px;left:0;',
   //     },
   //   },
   //   {
   //     deviceType: '',
-  //     moduleName: '掘进工作面',
+  //     moduleName: '综采工作面推进度',
   //     pageType: 'balancePressHome',
   //     moduleData: {
   //       header: {
@@ -251,8 +315,13 @@
   //           readFrom: '',
   //           items: [
   //             {
-  //               label: '待定',
-  //               value: '--',
+  //               label: '进度',
+  //               value: '50%',
+  //               color: 'blue',
+  //             },
+  //             {
+  //               label: '埋深',
+  //               value: '2000km',
   //               color: 'blue',
   //             },
   //           ],
@@ -263,9 +332,9 @@
   //       to: '',
   //     },
   //     showStyle: {
-  //       size: 'width:470px;height:230px;',
+  //       size: 'width:470px;height:130px;',
   //       version: '原版',
-  //       position: 'top:500px;left:0;',
+  //       position: 'top:620px;left:0;',
   //     },
   //   },
   //   {
@@ -302,15 +371,15 @@
   //       complex_list: [
   //         {
   //           type: 'G',
-  //           readFrom: 'windrect_ds_two.datalist',
+  //           readFrom: 'avgpressure_lowoxygen_normal.datalist',
   //           mapFromData: true,
   //           items: [
   //             {
-  //               title: '${strinstallpos}(假设两头对射为重点)',
+  //               title: '${strinstallpos}',
   //               contents: [
   //                 {
-  //                   label: '风量',
-  //                   value: '${readData.m3}',
+  //                   label: '网络状态',
+  //                   value: '${readData.netStatus_str}',
   //                   color: 'blue',
   //                 },
   //               ],
@@ -366,15 +435,15 @@
   //       complex_list: [
   //         {
   //           type: 'G',
-  //           readFrom: 'windrect_ds_four.datalist',
+  //           readFrom: 'others.datalist',
   //           mapFromData: true,
   //           items: [
   //             {
-  //               title: '${strinstallpos}(假设四头对射为辅助)',
+  //               title: '${strinstallpos}',
   //               contents: [
   //                 {
-  //                   label: '风量',
-  //                   value: '${readData.m3}',
+  //                   label: '网络状态',
+  //                   value: '${readData.netStatus_str}',
   //                   color: 'blue',
   //                 },
   //               ],
@@ -452,7 +521,7 @@
   //       to: '',
   //     },
   //     showStyle: {
-  //       size: 'width:470px;height:230px;',
+  //       size: 'width:470px;height:250px;',
   //       version: '原版',
   //       position: 'top:500px;right:0;',
   //     },

+ 1 - 1
src/views/vent/monitorManager/balancePressMonitor/index3.vue

@@ -6,7 +6,7 @@
     :optionValue="optionValue"
     >均压与低氧管控</customHeader
   >
-  <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
+  <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; z-index: 0">
     <a-spin :spinning="loading" />
     <div id="balancePress3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
     <!-- <div id="damper3DCSS" v-show="!loading" style="width: 100%; height: 100%; top:0; left: 0; position: absolute; overflow: hidden;">