Browse Source

[Feat 0000] 保德首页的配置由本地配置更改为远程配置

houzekong 4 months ago
parent
commit
e3badf5680

+ 28 - 45
src/views/vent/home/configurable/configurable.data.wz.ts

@@ -838,12 +838,12 @@ export const testConfigWZFire: Config[] = [
           readFrom: 'arrayCount',
           items: [
             {
-              label: '光纤预警',
+              label: '最高温度',
               value: '${[0].val}℃',
             },
             {
               label: '一氧化碳预警',
-              value: '${[1].val}ppm',
+              value: '',
             },
             {
               label: '烟雾预警',
@@ -936,22 +936,22 @@ export const testConfigWZFire: Config[] = [
       // mock: WZfireMock,
     },
     showStyle: {
-      size: 'width:1000px;height:280px;',
+      size: 'width:1000px;height:300px;',
       version: '保德',
-      position: 'top:640px;left:460px',
+      position: 'top:620px;left:460px',
     },
   },
   {
-    deviceType: 'obfObj.arrayDev',
-    moduleName: '密闭采空区监测区域',
+    deviceType: '',
+    moduleName: '传感器监测',
     pageType: '',
     moduleData: {
       header: {
-        show: true,
-        showSelector: true,
+        show: false,
+        showSelector: false,
         showSlot: false,
         selector: {
-          value: '${strinstallpos}',
+          value: '',
         },
         slot: {
           value: '',
@@ -966,52 +966,35 @@ export const testConfigWZFire: Config[] = [
         direction: 'row',
         basis: ['100%'],
       },
-      layout: ['board'],
-      board: [
+      layout: ['table'],
+      board: [],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      table: [
         {
-          type: 'G',
-          layout: 'label-top',
-          readFrom: '',
-          items: [
-            {
-              label: '一氧化碳',
-              value: '${coVal}',
-            },
-            {
-              label: '二氧化碳',
-              value: '${co2Val}',
-            },
-            {
-              label: '氧气',
-              value: '${o2Val}',
-            },
-            {
-              label: '温度',
-              value: '${tempVal}',
-            },
-            {
-              label: '乙烯',
-              value: '${c2h4Val}',
-            },
+          type: 'C',
+          readFrom: 'sensorArray',
+          columns: [
             {
-              label: '甲烷',
-              value: '${ch4Val}',
+              name: '测点位置',
+              prop: 'strinstallpos',
             },
             {
-              label: '乙炔',
-              value: '${c2h2Val}',
+              name: '值',
+              prop: 'value',
             },
             {
-              label: '压差',
-              value: '${dpVal}',
+              name: '类型',
+              prop: 'strname',
             },
+            // {
+            //   name: '时间',
+            //   prop: 'time',
+            // },
           ],
         },
       ],
-      chart: [],
-      gallery: [],
-      gallery_list: [],
-      table: [],
       list: [],
       complex_list: [],
       preset: [],

+ 11 - 13
src/views/vent/home/configurable/dustBD.vue

@@ -62,34 +62,32 @@
   import { onMounted, ref } from 'vue';
   // import { CaretDownOutlined } from '@ant-design/icons-vue';
   // import MonitorCenter from './components/MonitorCenter.vue';
-  // import { useInitConfigs } from './hooks/useInit';
+  import { useInitConfigs } from './hooks/useInit';
   import ModuleBD from './components/ModuleBD.vue';
-  import { testConfigBDDust } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import { getBDDustData } from './configurable.api';
-  import { getToken } from '/@/utils/auth';
+  // import { getToken } from '/@/utils/auth';
 
-  const iframeUrl = ref(
-    `${location.protocol}//${location.hostname}:8091/dashboard/analysis?type=empty&deviceType=empty&showid=1&token=${getToken()}`
-  );
-  const loading = ref(true);
+  // const iframeUrl = ref(
+  //   `${location.protocol}//${location.hostname}:8091/dashboard/analysis?type=empty&deviceType=empty&showid=1&token=${getToken()}`
+  // );
+  // const loading = ref(true);
   const mainTitle = ref('保德煤矿粉尘灾害预警系统');
   const pageType = 'BD_dust';
 
   // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
 
-  const configs = ref(testConfigBDDust);
-  // const { configs, fetchConfigs } = useInitConfigs();
+  const { configs, fetchConfigs } = useInitConfigs();
   const homedata = ref<any>({});
-  function hideLoading() {
-    loading.value = false;
-  }
+  // function hideLoading() {
+  //   loading.value = false;
+  // }
   onMounted(() => {
     // configs.value = testConfigB;
     getBDDustData({}).then((r) => {
       homedata.value = r;
     });
-    // fetchConfigs(pageType);
+    fetchConfigs(pageType);
   });
 
   // function redirectTo(url) {

+ 20 - 20
src/views/vent/home/configurable/fireBD.vue

@@ -70,45 +70,45 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { onMounted, ref } from 'vue';
+  import { computed, onMounted, ref } from 'vue';
   // import { CaretDownOutlined } from '@ant-design/icons-vue';
   // import MonitorCenter from './components/MonitorCenter.vue';
-  // import { useInitConfigs } from './hooks/useInit';
+  import { useInitConfigs } from './hooks/useInit';
   import ModuleBD from './components/ModuleBD.vue';
   import ModuleBDDual from './components/ModuleBDDual.vue';
-  import { testConfigBDFire } from './configurable.data';
+  // import { testConfigBDFire } from './configurable.data';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
   import { getBDFireData } from './configurable.api';
-  import { getToken } from '/@/utils/auth';
+  // import { getToken } from '/@/utils/auth';
 
   // import FramePage from '/@/views/sys/iframe/index.vue';
-  const frameRef = ref();
+  // const frameRef = ref();
   const mainTitle = ref('保德煤矿火灾预警系统');
   const pageType = 'BD_fire';
-  const loading = ref(true);
+  // const loading = ref(true);
 
   // const url = ref('http://localhost:8088/');
   // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
 
-  const configs = ref(
-    testConfigBDFire.filter(({ moduleName }) => {
-      return moduleName !== '工作面光纤监测' && moduleName !== '工作面束管监测';
+  const configs = computed(() =>
+    cfgs.value.filter((_, index) => {
+      return index !== 4 && index !== 3;
     })
   );
-  const configA = ref<any>(
-    testConfigBDFire.find(({ moduleName }) => {
-      return moduleName === '工作面束管监测';
+  const configA = computed<any>(() =>
+    cfgs.value.find((_, index) => {
+      return index === 3;
     })
   );
-  const configB = ref<any>(
-    testConfigBDFire.find(({ moduleName }) => {
-      return moduleName === '工作面光纤监测';
+  const configB = computed<any>(() =>
+    cfgs.value.find((_, index) => {
+      return index === 4;
     })
   );
-  // const { configs, fetchConfigs } = useInitConfigs();
-  function hideLoading() {
-    loading.value = false;
-  }
+  const { configs: cfgs, fetchConfigs } = useInitConfigs();
+  // function hideLoading() {
+  //   loading.value = false;
+  // }
   const homedata = ref<any>({});
 
   onMounted(() => {
@@ -117,7 +117,7 @@
     getBDFireData({}).then((r) => {
       homedata.value = r;
     });
-    // fetchConfigs(pageType);
+    fetchConfigs(pageType);
   });
 
   function redirectTo(url) {