Browse Source

[Revert 0000] 看板判别类型的实现方式修改

This reverts commit 98c1648a77e42ae749f2778f4f9359a3212191bc.
houzekong 9 months ago
parent
commit
f63a13689d
1 changed files with 13 additions and 9 deletions
  1. 13 9
      src/views/vent/home/billboard/index.vue

+ 13 - 9
src/views/vent/home/billboard/index.vue

@@ -37,7 +37,7 @@
   import BaseCard from './components/BaseCard.vue';
   import ArrowButton from './components/ArrowButton.vue';
   import { BillboardType } from './billboard.data';
-  import { useRoute } from 'vue-router';
+  // import { useRoute } from 'vue-router';
   import { getSummary } from './billboard.api';
   import { useSSO } from '/@/hooks/vent/useSSO';
   import DustStatus from './components/DustStatus.vue';
@@ -47,7 +47,11 @@
   import GasStatus from './components/GasStatus.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
-  const route = useRoute();
+  const props = defineProps<{
+    billboardType: string;
+  }>();
+
+  // const route = useRoute();
   const { open } = useSSO();
 
   // 组件Map,不同type使用不用组件
@@ -67,7 +71,7 @@
     FireStatus: '/fire/warn/home',
   };
 
-  const mainTitle = '煤炭集团';
+  const mainTitle = '国家能源神东煤炭集团';
 
   // 看板相关的基础配置
   const billboards = ref<BillboardType[]>([]);
@@ -94,20 +98,20 @@
     currentPage.value = Math.max((currentPage.value + pagecount) % totalPage.value, 1);
   }
 
-  const billboardType = ref('DustStatus');
+  // const billboardType = ref('DustStatus');
   // const showBtn = ref(true);
 
   // 页面跳转
   function openHandler(ip: string) {
     const url = `http://${ip}:8092/login`;
-    open(url, routePathMap[billboardType.value]);
+    open(url, routePathMap[props.billboardType]);
   }
 
   onMounted(() => {
-    if (route.params.type) {
-      billboardType.value = route.params.type as string;
-      // showBtn.value = false;
-    }
+    // if (route.query.type) {
+    //   billboardType.value = route.query.type as string;
+    //   showBtn.value = false;
+    // }
     fetchBillboards();
   });
 </script>