Browse Source

[Feat 0000] 可配置首页5.0特化版本添加报表/实时数据切换功能

houzekong 1 month ago
parent
commit
9223f17844

+ 13 - 5
src/views/vent/home/configurable/configurable.api.ts

@@ -1,3 +1,4 @@
+import { floor, random } from 'lodash-es';
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
@@ -40,11 +41,15 @@ export const list = (params) => {
       e.chartData = [
         {
           x: '吸风量',
-          y: e.readData.windQuantity1,
+          yRealtime: e.readData.windQuantity1,
+          yMock: floor(parseFloat(e.inletAirVolume_merge) * random(0.98, 1, false), 2),
+          y: e.inletAirVolume_merge,
         },
         {
           x: '供风量',
-          y: e.readData.windQuantity2,
+          yRealtime: e.readData.windQuantity2,
+          yMock: floor(parseFloat(e.ductOutletAirVolume_merge) * random(0.98, 1, false), 2),
+          y: e.ductOutletAirVolume_merge,
         },
       ];
       if (e.readData.Fan2StartStatus === '1') {
@@ -56,10 +61,13 @@ export const list = (params) => {
       }
     });
     res.sys_majorpath.forEach((e) => {
+      const { drag_1, drag_2, drag_3, drag_total } = e.majorpath;
+      const { retM3_merge } = e.readData;
+      const m3_merge = parseInt(retM3_merge.value);
       e.piechart = [
-        { val: e.majorpath.drag_1, label: '进风区' },
-        { val: e.majorpath.drag_2, label: '用风区' },
-        { val: e.majorpath.drag_3, label: '回风区' },
+        { val: drag_1, valMock: floor((drag_1 / drag_total) * m3_merge), label: '进风区' },
+        { val: drag_2, valMock: floor((drag_2 / drag_total) * m3_merge), label: '用风区' },
+        { val: drag_3, valMock: floor((drag_3 / drag_total) * m3_merge), label: '回风区' },
       ];
     });
     res.device_arr = Object.values(res.device);

+ 690 - 165
src/views/vent/home/configurable/configurable.data.ts

@@ -2,154 +2,6 @@ import { Config } from '../../deviceManager/configurationTable/types';
 // import { BDdustMock, BDfireMock } from './configurable.data.bd';
 
 export const testConfigVent: Config[] = [
-  // {
-  //   deviceType: 'fanmain',
-  //   moduleName: '主通风机系统',
-  //   pageType: 'vent',
-  //   moduleData: {
-  //     header: {
-  //       show: true,
-  //       readFrom: '',
-  //       selector: {
-  //         show: true,
-  //         value: '${strinstallpos}',
-  //       },
-  //       slot: {
-  //         show: true,
-  //         value: '运行风机:${readData.Fan1StartStatus}',
-  //         trans: {
-  //           '1': '一号',
-  //           '0': '二号',
-  //         },
-  //       },
-  //     },
-  //     background: {
-  //       show: true,
-  //       type: 'video',
-  //       link: '/video/mainFan.mp4',
-  //     },
-  //     layout: {
-  //       direction: 'column',
-  //       items: [
-  //         {
-  //           name: 'board',
-  //           basis: '40%',
-  //         },
-  //       ],
-  //     },
-  //     board: [
-  //       {
-  //         type: 'A',
-  //         readFrom: 'readData',
-  //         layout: 'val-top',
-  //         items: [
-  //           {
-  //             label: '风量(m³/min)',
-  //             value: '${m3}',
-  //           },
-  //           {
-  //             label: '负压(Pa)',
-  //             value: '${Fan1StartStatus}',
-  //             trans: {
-  //               '1': '${Fan1FreqHz}',
-  //               '0': '${Fan1FreqHz}',
-  //             },
-  //           },
-  //           {
-  //             label: '频率(Hz)',
-  //             value: '${DataPa}',
-  //           },
-  //         ],
-  //       },
-  //     ],
-  //     list: [],
-  //     chart: [],
-  //     table: [],
-  //     gallery: [],
-  //     complex_list: [],
-  //     gallery_list: [],
-  //     preset: [],
-  //   },
-  //   showStyle: {
-  //     size: 'width:450px;height:280px;',
-  //     version: '新版',
-  //     position: 'top:60px;left:0;',
-  //   },
-  // },
-  // {
-  //   deviceType: 'fanlocal',
-  //   moduleName: '局部通风机系统',
-  //   pageType: 'vent',
-  //   moduleData: {
-  //     header: {
-  //       show: true,
-  //       readFrom: '',
-  //       selector: {
-  //         show: true,
-  //         value: '${strinstallpos}',
-  //       },
-  //       slot: {
-  //         show: true,
-  //         value: '运行风机:${readData.Fan1StartStatus}',
-  //         trans: {
-  //           '1': '一号',
-  //           '0': '二号',
-  //         },
-  //       },
-  //     },
-  //     background: {
-  //       show: true,
-  //       type: 'video',
-  //       link: '/video/fanLocal.mp4',
-  //     },
-  //     layout: {
-  //       direction: 'column',
-  //       items: [
-  //         {
-  //           name: 'board',
-  //           basis: '40%',
-  //         },
-  //       ],
-  //     },
-  //     board: [
-  //       {
-  //         type: 'A',
-  //         readFrom: 'readData',
-  //         layout: 'val-top',
-  //         items: [
-  //           {
-  //             label: '吸风量(m³/min)',
-  //             value: '${windQuantity1}',
-  //           },
-  //           {
-  //             label: '供风量(m³/min)',
-  //             value: '${windQuantity2}',
-  //           },
-  //           {
-  //             label: '频率(Hz)',
-  //             value: '${Fan1StartStatus}',
-  //             trans: {
-  //               '1': '${Fan1fHz}',
-  //               '0': '${Fan2fHz}',
-  //             },
-  //           },
-  //         ],
-  //       },
-  //     ],
-  //     list: [],
-  //     chart: [],
-  //     table: [],
-  //     gallery: [],
-  //     complex_list: [],
-  //     gallery_list: [],
-  //     preset: [],
-  //   },
-  //   showStyle: {
-  //     size: 'width:450px;height:280px;',
-  //     version: '新版',
-  //     position: 'top:350px;left:0;',
-  //   },
-  // },
   {
     deviceType: 'fanmain',
     moduleName: '主通风机系统',
@@ -192,20 +44,16 @@ export const testConfigVent: Config[] = [
       board: [
         {
           type: 'A',
-          readFrom: 'readData',
+          readFrom: '',
           layout: 'val-top',
           items: [
             {
               label: '风量(m³/min)',
-              value: '${m3}',
+              value: '${flow_merge}',
             },
             {
               label: '负压(Pa)',
-              value: '${Fan1StartStatus}',
-              trans: {
-                '1': '${Fan1FreqHz}',
-                '0': '${Fan1FreqHz}',
-              },
+              value: '${fy_merge}',
             },
           ],
         },
@@ -219,6 +67,8 @@ export const testConfigVent: Config[] = [
       preset: [
         {
           readFrom: '',
+          fan1Prop: ['flow_merge', 'fy_merge'],
+          fan2Prop: ['flow_merge', 'fy_merge'],
         },
       ],
     },
@@ -409,7 +259,7 @@ export const testConfigVent: Config[] = [
           ],
           series: [
             { readFrom: 'sys_wind', xprop: 'strinstallpos', yprop: 'readData.m3', label: '风量' },
-            { readFrom: 'sys_wind', xprop: 'strinstallpos', yprop: 'readData.incipientWindSpeed1', label: '风速' },
+            { readFrom: 'sys_wind', xprop: 'strinstallpos', yprop: 'readData.va', label: '风速' },
           ],
         },
       ],
@@ -458,16 +308,16 @@ export const testConfigVent: Config[] = [
       board: [
         {
           type: 'D',
-          readFrom: 'majorpath',
+          readFrom: 'readData',
           layout: 'label-top',
           items: [
             {
               label: '矿井风量',
-              value: '${m3_total}',
+              value: '${retM3_merge.value}',
             },
             {
               label: '矿井阻力',
-              value: '${drag_total}',
+              value: '${zuli.value}',
             },
             {
               label: '等积孔',
@@ -487,7 +337,7 @@ export const testConfigVent: Config[] = [
           legend: { show: false },
           xAxis: [{ show: false }],
           yAxis: [{ show: false, name: '风量', position: 'left' }],
-          series: [{ readFrom: 'piechart', xprop: 'label', yprop: 'val', label: '-' }],
+          series: [{ readFrom: 'piechart', xprop: 'label', yprop: 'valMock', label: '' }],
         },
       ],
       gallery_list: [],
@@ -542,15 +392,15 @@ export const testConfigVent: Config[] = [
           items: [
             {
               label: '进风',
-              value: '${jin}',
+              value: '${faceIntM3}',
             },
             {
               label: '回风',
-              value: '${hui}',
+              value: '${faceRetM3}',
             },
             {
               label: '需风量',
-              value: '${xufengliang}',
+              value: '${facePlanM3}',
             },
           ],
         },
@@ -567,8 +417,8 @@ export const testConfigVent: Config[] = [
           xAxis: [{ show: true }],
           yAxis: [{ show: true, name: '风量(m³/min)', position: 'left' }],
           series: [
-            { readFrom: 'history', xprop: 'time', yprop: 'jin', label: '进风' },
-            { readFrom: 'history', xprop: 'time', yprop: 'hui', label: '回风' },
+            { readFrom: 'history_report', xprop: 'time', yprop: 'faceIntM3', label: '进风' },
+            { readFrom: 'history_report', xprop: 'time', yprop: 'faceRetM3', label: '回风' },
           ],
         },
       ],
@@ -1566,3 +1416,678 @@ export const testConfigFire: Config[] = [
     },
   },
 ];
+
+export const testConfigVentRealtime: Config[] = [
+  {
+    deviceType: 'fanmain',
+    moduleName: '主通风机系统',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${strinstallpos}',
+        },
+        slot: {
+          show: true,
+          value: '运行风机:${readData.Fan1StartStatus}',
+          trans: {
+            '1': '一号',
+            '0': '二号',
+          },
+        },
+      },
+      background: {
+        show: false,
+        type: 'image',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'board',
+            basis: '33%',
+          },
+          {
+            name: 'qh_curve',
+            basis: '67%',
+          },
+        ],
+      },
+      board: [
+        {
+          type: 'A',
+          readFrom: 'readData',
+          layout: 'val-top',
+          items: [
+            {
+              label: '风量(m³/min)',
+              value: '${Fan1StartStatus}',
+              trans: {
+                '1': '${Fan1_FanFlow}',
+                '0': '${Fan2_FanFlow}',
+              },
+            },
+            {
+              label: '负压(Pa)',
+              value: '${Fan1StartStatus}',
+              trans: {
+                '1': '${Fan1FanPre}',
+                '0': '${Fan2FanPre}',
+              },
+            },
+          ],
+        },
+      ],
+      list: [],
+      chart: [],
+      table: [],
+      gallery: [],
+      complex_list: [],
+      gallery_list: [],
+      preset: [
+        {
+          readFrom: '',
+          fan1Prop: ['readData.Fan1_FanFlow', 'readData.Fan1FanPre'],
+          fan2Prop: ['readData.Fan2_FanFlow', 'readData.Fan2FanPre'],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:60px;left:0;',
+    },
+  },
+  {
+    deviceType: 'fanlocal',
+    moduleName: '局部通风机系统',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${strinstallpos}',
+        },
+        slot: {
+          show: true,
+          value: '运行风机:${readData.Fan1StartStatus}',
+          trans: {
+            '1': '一号',
+            '0': '二号',
+          },
+        },
+      },
+      background: {
+        show: false,
+        type: 'image',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'chart',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      list: [],
+      chart: [
+        {
+          type: 'bar_cylinder',
+          readFrom: '',
+          legend: { show: false },
+          xAxis: [{ show: true }],
+          yAxis: [{ show: true, name: '(m³/min)', position: 'left' }],
+          series: [
+            { readFrom: 'chartData', xprop: 'x', yprop: 'yMock', label: '风量' },
+            // { readFrom: '', xprop: 'x', yprop: 'y2', label: '风量' },
+          ],
+        },
+      ],
+      table: [],
+      gallery: [],
+      complex_list: [],
+      gallery_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:350px;left:0;',
+    },
+  },
+  {
+    deviceType: '',
+    moduleName: '通风设施远程控制',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'image',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'complex_list',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      list: [],
+      chart: [],
+      table: [],
+      gallery: [],
+      complex_list: [
+        {
+          type: 'F',
+          readFrom: 'device_arr',
+          mapFromData: true,
+          items: [
+            {
+              title: '${name}',
+              contents: [
+                {
+                  label: '总数',
+                  value: '${totalcount}',
+                },
+                {
+                  label: '报警',
+                  value: '${count}',
+                  color: 'red',
+                },
+                {
+                  label: '断开',
+                  value: '${netstatus}',
+                },
+              ],
+            },
+          ],
+        },
+      ],
+      gallery_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:640px;left:0;',
+    },
+  },
+  {
+    deviceType: 'sys_wind',
+    moduleName: '风量监测',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'chart',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      list: [],
+      table: [],
+      preset: [],
+      gallery: [],
+      complex_list: [],
+      gallery_list: [],
+      chart: [
+        {
+          type: 'bar',
+          readFrom: '',
+          legend: { show: true },
+          xAxis: [{ show: true }],
+          yAxis: [
+            { show: true, name: '风量(m³/min)', position: 'left' },
+            { show: true, name: '风速(m/s)', position: 'right' },
+          ],
+          series: [
+            { readFrom: 'sys_wind', xprop: 'strinstallpos', yprop: 'readData.m3', label: '风量' },
+            { readFrom: 'sys_wind', xprop: 'strinstallpos', yprop: 'readData.va', label: '风速' },
+          ],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:1000px;height:280px;',
+      version: '新版',
+      position: 'top:640px;left:460px;',
+    },
+  },
+  {
+    deviceType: 'sys_majorpath',
+    moduleName: '关键通风路线',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${devicePos}',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'chart',
+            basis: '60%',
+          },
+          {
+            name: 'board',
+            basis: '40%',
+          },
+        ],
+      },
+      board: [
+        {
+          type: 'D',
+          readFrom: 'majorpath',
+          layout: 'label-top',
+          items: [
+            {
+              label: '矿井风量',
+              value: '${m3_total}',
+            },
+            {
+              label: '矿井阻力',
+              value: '${drag_total}',
+            },
+            {
+              label: '等积孔',
+              value: '6.12',
+            },
+          ],
+        },
+      ],
+      complex_list: [],
+      gallery: [],
+      list: [],
+      table: [],
+      chart: [
+        {
+          type: 'pie',
+          readFrom: '',
+          legend: { show: false },
+          xAxis: [{ show: false }],
+          yAxis: [{ show: false, name: '风量', position: 'left' }],
+          series: [{ readFrom: 'piechart', xprop: 'label', yprop: 'val', label: '-' }],
+        },
+      ],
+      gallery_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:60px;right:0;',
+    },
+  },
+  {
+    deviceType: 'sys_surface_caimei',
+    moduleName: '工作面智能监控',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${devicePos}',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'chart',
+            basis: '65%',
+          },
+          {
+            name: 'board',
+            basis: '35%',
+          },
+        ],
+      },
+      board: [
+        {
+          type: 'B',
+          readFrom: '',
+          layout: 'label-top',
+          items: [
+            {
+              label: '进风',
+              value: '${jin}',
+            },
+            {
+              label: '回风',
+              value: '${hui}',
+            },
+            {
+              label: '需风量',
+              value: '${xufengliang}',
+            },
+          ],
+        },
+      ],
+      list: [],
+      preset: [],
+      table: [],
+      gallery: [],
+      chart: [
+        {
+          type: 'line',
+          readFrom: '',
+          legend: { show: true },
+          xAxis: [{ show: true }],
+          yAxis: [{ show: true, name: '风量(m³/min)', position: 'left' }],
+          series: [
+            { readFrom: 'history', xprop: 'time', yprop: 'jin', label: '进风' },
+            { readFrom: 'history', xprop: 'time', yprop: 'hui', label: '回风' },
+          ],
+        },
+      ],
+      gallery_list: [],
+      complex_list: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:350px;right:0;',
+    },
+  },
+  {
+    deviceType: 'warn',
+    moduleName: '预警监测',
+    pageType: 'vent_realtime',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: true,
+          value: '网络异常:${warn[0].netstatus.val}',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'list',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      list: [
+        {
+          type: 'timeline',
+          readFrom: 'warn[0]',
+          items: [
+            {
+              label: '报警',
+              value: '${alarm.val}',
+              info: '',
+              color: 'blue',
+            },
+            {
+              label: '重大风险预警',
+              value: '${red.val}',
+              info: '',
+              color: 'red',
+            },
+            {
+              label: '较大风险预警',
+              value: '${orange.val}',
+              info: '',
+              color: 'orange',
+            },
+            {
+              label: '一般风险预警',
+              value: '${yellow.val}',
+              info: '',
+              color: 'yellow',
+            },
+            {
+              label: '低风险预警',
+              value: '${blue.val}',
+              info: '',
+              color: 'blue',
+            },
+          ],
+        },
+      ],
+      preset: [],
+      table: [],
+      gallery: [],
+      chart: [],
+      gallery_list: [],
+      complex_list: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: '新版',
+      position: 'top:640px;right:0;',
+    },
+  },
+];
+
+// {
+//   deviceType: 'fanmain',
+//   moduleName: '主通风机系统',
+//   pageType: 'vent',
+//   moduleData: {
+//     header: {
+//       show: true,
+//       readFrom: '',
+//       selector: {
+//         show: true,
+//         value: '${strinstallpos}',
+//       },
+//       slot: {
+//         show: true,
+//         value: '运行风机:${readData.Fan1StartStatus}',
+//         trans: {
+//           '1': '一号',
+//           '0': '二号',
+//         },
+//       },
+//     },
+//     background: {
+//       show: true,
+//       type: 'video',
+//       link: '/video/mainFan.mp4',
+//     },
+//     layout: {
+//       direction: 'column',
+//       items: [
+//         {
+//           name: 'board',
+//           basis: '40%',
+//         },
+//       ],
+//     },
+//     board: [
+//       {
+//         type: 'A',
+//         readFrom: 'readData',
+//         layout: 'val-top',
+//         items: [
+//           {
+//             label: '风量(m³/min)',
+//             value: '${m3}',
+//           },
+//           {
+//             label: '负压(Pa)',
+//             value: '${Fan1StartStatus}',
+//             trans: {
+//               '1': '${Fan1FreqHz}',
+//               '0': '${Fan1FreqHz}',
+//             },
+//           },
+//           {
+//             label: '频率(Hz)',
+//             value: '${DataPa}',
+//           },
+//         ],
+//       },
+//     ],
+//     list: [],
+//     chart: [],
+//     table: [],
+//     gallery: [],
+//     complex_list: [],
+//     gallery_list: [],
+//     preset: [],
+//   },
+//   showStyle: {
+//     size: 'width:450px;height:280px;',
+//     version: '新版',
+//     position: 'top:60px;left:0;',
+//   },
+// },
+// {
+//   deviceType: 'fanlocal',
+//   moduleName: '局部通风机系统',
+//   pageType: 'vent',
+//   moduleData: {
+//     header: {
+//       show: true,
+//       readFrom: '',
+//       selector: {
+//         show: true,
+//         value: '${strinstallpos}',
+//       },
+//       slot: {
+//         show: true,
+//         value: '运行风机:${readData.Fan1StartStatus}',
+//         trans: {
+//           '1': '一号',
+//           '0': '二号',
+//         },
+//       },
+//     },
+//     background: {
+//       show: true,
+//       type: 'video',
+//       link: '/video/fanLocal.mp4',
+//     },
+//     layout: {
+//       direction: 'column',
+//       items: [
+//         {
+//           name: 'board',
+//           basis: '40%',
+//         },
+//       ],
+//     },
+//     board: [
+//       {
+//         type: 'A',
+//         readFrom: 'readData',
+//         layout: 'val-top',
+//         items: [
+//           {
+//             label: '吸风量(m³/min)',
+//             value: '${windQuantity1}',
+//           },
+//           {
+//             label: '供风量(m³/min)',
+//             value: '${windQuantity2}',
+//           },
+//           {
+//             label: '频率(Hz)',
+//             value: '${Fan1StartStatus}',
+//             trans: {
+//               '1': '${Fan1fHz}',
+//               '0': '${Fan2fHz}',
+//             },
+//           },
+//         ],
+//       },
+//     ],
+//     list: [],
+//     chart: [],
+//     table: [],
+//     gallery: [],
+//     complex_list: [],
+//     gallery_list: [],
+//     preset: [],
+//   },
+//   showStyle: {
+//     size: 'width:450px;height:280px;',
+//     version: '新版',
+//     position: 'top:350px;left:0;',
+//   },
+// },

+ 22 - 4
src/views/vent/home/configurable/vent_v5.vue

@@ -61,11 +61,17 @@
     </template>
     <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
       <VentModal />
+      <img
+        :src="isDataRealTime ? '/@/assets/images/company/monitor-realtime.png' : '/@/assets/images/company/monitor-doc.png'"
+        alt="切换数据模式"
+        class="w-34px h-34px pos-absolute right-5px bottom-5px z-5"
+        @click="switchDataMode"
+      />
     </div>
   </div>
 </template>
 <script lang="ts" setup>
-  import { onMounted, onUnmounted } from 'vue';
+  import { onMounted, onUnmounted, ref } from 'vue';
   // import { CaretDownOutlined } from '@ant-design/icons-vue';
   // import MonitorCenter from './components/MonitorCenter.vue';
   import { useInitConfigs, useInitPage } from './hooks/useInit';
@@ -76,16 +82,28 @@
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import { list } from './configurable.api';
   import { useRoute } from 'vue-router';
-  // import { testConfigVent } from './configurable.data';
+  // import { testConfigVent, testConfigVentRealtime } from './configurable.data';
 
   const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
   const { mainTitle, enhancedConfigs, hiddenList, data, updateData, updateEnhancedConfigs } = useInitPage('智能通风管控系统');
   const route = useRoute();
+  const isDataRealTime = ref(false);
   let interval: number | undefined;
 
+  function switchDataMode() {
+    isDataRealTime.value = !isDataRealTime.value;
+
+    fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
+      // configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
+      updateEnhancedConfigs(configs.value);
+
+      list({}).then(updateData);
+    });
+  }
+
   onMounted(() => {
-    fetchConfigs('vent').then(() => {
-      // configs.value = testConfigVent;
+    fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
+      // configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
       updateEnhancedConfigs(configs.value);
 
       list({}).then(updateData);