Browse Source

[Feat 0000] 为演示修改首页配置及模拟数据

houzekong 9 months ago
parent
commit
b5b69a9740

+ 609 - 0
src/views/vent/home/configurable/configurable.data.ts

@@ -1,3 +1,5 @@
+import { Config } from '../../deviceManager/configurationTable/types';
+
 export const posMonitorData = {
   msgType: null,
   deviceID: '1657545388451663008',
@@ -322,3 +324,610 @@ export const posMonitorData = {
   isRun: '-2',
   co2val: '0.24',
 };
+
+export const testConfigA: Config[] = [
+  {
+    deviceType: 'fanlocal',
+    moduleName: 'fanlocal-左上',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: true,
+        showSelector: true,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: true,
+        type: 'video',
+        link: '/src/assets/vedio/fanLocal.mp4',
+      },
+      layout: ['board'],
+      board: [
+        {
+          label: '风速1',
+          type: 'A',
+          layout: 'val-top',
+          prop: 'readData.windSpeed1',
+        },
+        {
+          label: '风速2',
+          type: 'B',
+          layout: 'label-top',
+          prop: 'readData.windSpeed2',
+        },
+      ],
+      list: [],
+      chart: [],
+      table: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:60px;left:0;',
+    },
+  },
+  {
+    deviceType: 'sys_majorpath',
+    moduleName: 'sys_majorpath-左中',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: true,
+        showSelector: true,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['chart'],
+      board: [],
+      list: [],
+      chart: [
+        {
+          type: 'line_area',
+          readFrom: 'majorpath.paths',
+          xAxis: [{ prop: 'name' }],
+          yAxis: [
+            { label: 'Drag', align: 'left' },
+            { label: 'M3', align: 'right' },
+          ],
+          series: [
+            { label: 'Drag', prop: 'drag' },
+            { label: 'M3', prop: 'm3' },
+            // { label: '回2', prop: 'hui2' },
+          ],
+        },
+      ],
+      table: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:350px;left:0;',
+    },
+  },
+  {
+    deviceType: 'warn',
+    moduleName: 'fire_warn-左下预设类',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: false,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'netstatus.val',
+          formatter: '网络异常:${} 台',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['fire_warn'],
+      // layout: ['list'],
+      board: [],
+      chart: [],
+      table: [],
+      list: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:640px;left:0;',
+    },
+  },
+  {
+    deviceType: 'midinfo',
+    moduleName: 'midinfo-中间',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: false,
+        showSlot: false,
+        selector: {
+          icon: 'SwapOutlined',
+          prop: 'strinstallpos',
+        },
+        slot: {
+          icon: 'SwapOutlined',
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['chart'],
+      board: [],
+      list: [],
+      table: [],
+      chart: [
+        {
+          type: 'bar',
+          readFrom: 'sysdata.history',
+          xAxis: [{ prop: 'time' }],
+          yAxis: [
+            { label: '回1', align: 'left' },
+            // { label: '回2', align: 'right' },
+          ],
+          series: [
+            { label: '回1', prop: 'hui1' },
+            // { label: '回2', prop: 'hui2' },
+          ],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:1000px;height:280px;',
+      version: 'enhanced',
+      position: 'top:640px;left:460px;',
+    },
+  },
+  {
+    deviceType: 'sys_wind',
+    moduleName: 'blast_delta-右上预设类',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: true,
+        showSlot: false,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['blast_delta'],
+      board: [],
+      list: [],
+      table: [],
+      chart: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:60px;right:0;',
+    },
+  },
+  {
+    deviceType: 'sys_majorpath',
+    moduleName: 'unknown-右中',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: true,
+        showSlot: true,
+        selector: {
+          prop: 'devicePos',
+        },
+        slot: {
+          prop: 'devicePos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['table'],
+      board: [],
+      list: [],
+      table: [
+        {
+          readFrom: 'history',
+          columns: [
+            {
+              prop: 'index',
+              label: '编号',
+            },
+            {
+              prop: 'time',
+              label: '报警时间',
+            },
+            {
+              prop: 'warn',
+              label: '报警内容',
+            },
+          ],
+        },
+      ],
+      chart: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:350px;right:0;',
+    },
+  },
+  {
+    deviceType: 'sys_majorpath',
+    moduleName: 'fire_control-右下预设类',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: true,
+        showSlot: true,
+        selector: {
+          prop: 'devicePos',
+        },
+        slot: {
+          prop: 'devicePos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['fire_control'],
+      board: [],
+      list: [],
+      table: [],
+      chart: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:640px;right:0;',
+    },
+  },
+];
+
+export const testConfigB: Config[] = [
+  {
+    deviceType: 'warn',
+    moduleName: 'warn-左上',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: false,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'netstatus.val',
+          formatter: '网络异常:${} 台',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['list'],
+      board: [],
+      chart: [],
+      table: [],
+      list: [
+        {
+          label: '正常',
+          prop: 'blue.val',
+          color: 'blue',
+          type: 'timeline',
+        },
+        {
+          label: '告警',
+          prop: 'orange.val',
+          color: 'orange',
+          type: 'timeline',
+        },
+        {
+          label: '报警',
+          prop: 'yellow.val',
+          color: 'yellow',
+          type: 'timeline',
+        },
+        {
+          label: '危险',
+          prop: 'red.val',
+          color: 'red',
+          type: 'timeline',
+        },
+        {
+          label: '错误',
+          prop: 'alarm.val',
+          color: 'green',
+          type: 'timeline',
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:60px;left:0;',
+    },
+  },
+  {
+    deviceType: 'sys_wind',
+    moduleName: 'sys_wind-左中',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: true,
+        showSlot: false,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['board', 'chart', 'table'],
+      board: [
+        {
+          label: 'F1',
+          type: 'C',
+          layout: 'val-top',
+          prop: 'f1Val',
+        },
+        {
+          label: 'F2',
+          type: 'C',
+          layout: 'val-top',
+          prop: 'f2Val',
+        },
+      ],
+      list: [],
+      table: [
+        {
+          readFrom: 'history',
+          columns: [
+            {
+              prop: 'index',
+              label: '编号',
+            },
+            {
+              prop: 'time',
+              label: '自定义字段A',
+            },
+            {
+              prop: 'warn',
+              label: '自定义字段B',
+            },
+          ],
+        },
+      ],
+      chart: [
+        {
+          type: 'pie',
+          readFrom: 'readData',
+          xAxis: [{ prop: 'stationname' }],
+          yAxis: [
+            { label: '风量1', align: 'left' },
+            // { label: '回2', align: 'right' },
+          ],
+          series: [
+            { label: '风量1', prop: 'va' },
+            { label: '风量2', prop: 'va2' },
+            // { label: '回2', prop: 'hui2' },
+          ],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:450px;height:570px;',
+      version: 'enhanced',
+      position: 'top:350px;left:0;',
+    },
+  },
+  {
+    deviceType: 'midinfo',
+    moduleName: 'midinfo-中间',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: false,
+        showSlot: false,
+        selector: {
+          icon: 'SwapOutlined',
+          prop: 'strinstallpos',
+        },
+        slot: {
+          icon: 'SwapOutlined',
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['chart'],
+      board: [],
+      list: [],
+      table: [],
+      chart: [
+        {
+          type: 'bar',
+          readFrom: 'sysdata.history',
+          xAxis: [{ prop: 'time' }],
+          yAxis: [
+            { label: '回1', align: 'left' },
+            // { label: '回2', align: 'right' },
+          ],
+          series: [
+            { label: '回1', prop: 'hui1' },
+            // { label: '回2', prop: 'hui2' },
+          ],
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:1000px;height:280px;',
+      version: 'enhanced',
+      position: 'top:640px;left:460px;',
+    },
+  },
+  {
+    deviceType: 'sys_majorpath',
+    moduleName: 'sys_majorpath-右上',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: true,
+        showSelector: true,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'strinstallpos',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['chart'],
+      board: [],
+      list: [],
+      chart: [
+        {
+          type: 'line',
+          readFrom: 'majorpath.paths',
+          xAxis: [{ prop: 'name' }],
+          yAxis: [
+            { label: 'Drag', align: 'left' },
+            { label: 'M3', align: 'right' },
+          ],
+          series: [
+            { label: 'Drag', prop: 'drag' },
+            { label: 'M3', prop: 'm3' },
+            // { label: '回2', prop: 'hui2' },
+          ],
+        },
+      ],
+      table: [],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:60px;right:0;',
+    },
+  },
+  {
+    deviceType: 'warn',
+    moduleName: 'warn-右中',
+    pageType: '',
+    moduleData: {
+      header: {
+        show: false,
+        showSelector: false,
+        showSlot: true,
+        selector: {
+          prop: 'strinstallpos',
+        },
+        slot: {
+          prop: 'netstatus.val',
+          formatter: '网络异常:${} 台',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: ['list'],
+      board: [],
+      chart: [],
+      table: [],
+      list: [
+        {
+          label: '正常',
+          prop: 'blue.val',
+          color: 'blue',
+          type: 'B',
+        },
+        {
+          label: '告警',
+          prop: 'orange.val',
+          color: 'orange',
+          type: 'B',
+        },
+        {
+          label: '报警',
+          prop: 'yellow.val',
+          color: 'yellow',
+          type: 'B',
+        },
+        {
+          label: '危险',
+          prop: 'red.val',
+          color: 'red',
+          type: 'B',
+        },
+        {
+          label: '错误',
+          prop: 'alarm.val',
+          color: 'green',
+          type: 'B',
+        },
+      ],
+    },
+    showStyle: {
+      size: 'width:450px;height:280px;',
+      version: 'enhanced',
+      position: 'top:350px;right:0;',
+    },
+  },
+];

+ 6 - 356
src/views/vent/home/configurable/index.vue

@@ -50,369 +50,19 @@
   import ModuleEnhanced from './components/ModuleEnhanced.vue';
   import ModuleOriginal from './components/ModuleOriginal.vue';
   import Content from './components/content.vue';
+  import { testConfigA, testConfigB } from './configurable.data';
   // import mapComponent from './components/3Dmap/index.vue';
 
   const mainTitle = ref('智能通风管控系统');
 
   // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
 
-  const configs = ref<Config[]>([
-    {
-      deviceType: 'fanlocal',
-      moduleName: '测试局扇',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: true,
-          showSelector: true,
-          showSlot: true,
-          selector: {
-            prop: 'strinstallpos',
-          },
-          slot: {
-            prop: 'strinstallpos',
-          },
-        },
-        background: {
-          show: true,
-          type: 'video',
-          link: '/src/assets/vedio/fanLocal.mp4',
-        },
-        layout: ['board'],
-        board: [
-          {
-            label: '风速1',
-            type: 'A',
-            layout: 'val-top',
-            prop: 'readData.windSpeed1',
-          },
-          {
-            label: '风速2',
-            type: 'B',
-            layout: 'label-top',
-            prop: 'readData.windSpeed2',
-          },
-        ],
-        list: [],
-        chart: [],
-        table: [],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:60px;left:0;',
-      },
-    },
-    {
-      deviceType: 'sys_majorpath',
-      moduleName: '测试折线图',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: true,
-          showSelector: true,
-          showSlot: true,
-          selector: {
-            prop: 'strinstallpos',
-          },
-          slot: {
-            prop: 'strinstallpos',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['chart'],
-        board: [],
-        list: [],
-        chart: [
-          {
-            type: 'line_area',
-            readFrom: 'majorpath.paths',
-            xAxis: [{ prop: 'name' }],
-            yAxis: [
-              { label: 'Drag', align: 'left' },
-              { label: 'M3', align: 'right' },
-            ],
-            series: [
-              { label: 'Drag', prop: 'drag' },
-              { label: 'M3', prop: 'm3' },
-              // { label: '回2', prop: 'hui2' },
-            ],
-          },
-        ],
-        table: [],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:350px;left:0;',
-      },
-    },
-    {
-      deviceType: 'warn',
-      moduleName: '测试报警',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: false,
-          showSelector: false,
-          showSlot: true,
-          selector: {
-            prop: 'strinstallpos',
-          },
-          slot: {
-            prop: 'netstatus.val',
-            formatter: '网络异常:${} 台',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['fire_warn'],
-        // layout: ['list'],
-        board: [],
-        chart: [],
-        table: [],
-        list: [
-          {
-            label: '正常',
-            prop: 'blue.val',
-            color: 'blue',
-            type: 'B',
-          },
-          {
-            label: '告警',
-            prop: 'orange.val',
-            color: 'orange',
-            type: 'B',
-          },
-          {
-            label: '报警',
-            prop: 'yellow.val',
-            color: 'yellow',
-            type: 'B',
-          },
-          {
-            label: '危险',
-            prop: 'red.val',
-            color: 'red',
-            type: 'B',
-          },
-          {
-            label: '错误',
-            prop: 'alarm.val',
-            color: 'green',
-            type: 'B',
-          },
-        ],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:640px;left:0;',
-      },
-    },
-    {
-      deviceType: 'midinfo',
-      moduleName: '测试中间模块',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: false,
-          showSelector: false,
-          showSlot: false,
-          selector: {
-            icon: 'SwapOutlined',
-            prop: 'strinstallpos',
-          },
-          slot: {
-            icon: 'SwapOutlined',
-            prop: 'strinstallpos',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['chart'],
-        board: [],
-        list: [],
-        table: [],
-        chart: [
-          {
-            type: 'bar',
-            readFrom: 'sysdata.history',
-            xAxis: [{ prop: 'time' }],
-            yAxis: [
-              { label: '回1', align: 'left' },
-              // { label: '回2', align: 'right' },
-            ],
-            series: [
-              { label: '回1', prop: 'hui1' },
-              // { label: '回2', prop: 'hui2' },
-            ],
-          },
-        ],
-      },
-      showStyle: {
-        size: 'width:1000px;height:280px;',
-        version: 'enhanced',
-        position: 'top:640px;left:460px;',
-      },
-    },
-    {
-      deviceType: 'sys_wind',
-      moduleName: '测试测风装置',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: false,
-          showSelector: true,
-          showSlot: false,
-          selector: {
-            prop: 'strinstallpos',
-          },
-          slot: {
-            prop: 'strinstallpos',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['blast_delta'],
-        board: [
-          {
-            label: '风量',
-            type: 'C',
-            layout: 'val-top',
-            prop: 'f1Val',
-          },
-          {
-            label: '风速',
-            type: 'C',
-            layout: 'val-top',
-            prop: 'f2Val',
-          },
-        ],
-        list: [],
-        table: [],
-        chart: [
-          {
-            type: 'pie',
-            readFrom: 'readData',
-            xAxis: [{ prop: 'stationname' }],
-            yAxis: [
-              { label: '风量1', align: 'left' },
-              // { label: '回2', align: 'right' },
-            ],
-            series: [
-              { label: '风量1', prop: 'va' },
-              { label: '风量2', prop: 'va2' },
-              // { label: '回2', prop: 'hui2' },
-            ],
-          },
-        ],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:60px;right:0;',
-      },
-    },
-    {
-      deviceType: 'sys_majorpath',
-      moduleName: '测试关键路线',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: false,
-          showSelector: true,
-          showSlot: true,
-          selector: {
-            prop: 'devicePos',
-          },
-          slot: {
-            prop: 'devicePos',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['table'],
-        board: [],
-        list: [],
-        table: [
-          {
-            readFrom: 'history',
-            columns: [
-              {
-                prop: 'index',
-                label: '编号',
-              },
-              {
-                prop: 'time',
-                label: '报警时间',
-              },
-              {
-                prop: 'warn',
-                label: '报警内容',
-              },
-            ],
-          },
-        ],
-        chart: [],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:350px;right:0;',
-      },
-    },
-    {
-      deviceType: 'sys_majorpath',
-      moduleName: '测试关键路线',
-      pageType: '',
-      moduleData: {
-        header: {
-          show: false,
-          showSelector: true,
-          showSlot: true,
-          selector: {
-            prop: 'devicePos',
-          },
-          slot: {
-            prop: 'devicePos',
-          },
-        },
-        background: {
-          show: false,
-          type: 'video',
-          link: '',
-        },
-        layout: ['fire_control'],
-        board: [],
-        list: [],
-        table: [],
-        chart: [],
-      },
-      showStyle: {
-        size: 'width:450px;height:280px;',
-        version: 'enhanced',
-        position: 'top:640px;right:0;',
-      },
-    },
-  ]);
+  // const configs = ref<Config[]>(testConfigB);
+  const configs = ref<Config[]>(testConfigA);
+
   const isOriginal = true;
+  // const isOriginal = false;
+
   const visible = ref(true);
   // const { configs, isOriginal, fetchConfigs } = useInitConfigs();