Sfoglia il codice sorgente

进尺与瓦斯动态路由参数添加

lxh 5 mesi fa
parent
commit
5192147800
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/views/vent/monitorManager/footageMonitor/index.vue

+ 5 - 1
src/views/vent/monitorManager/footageMonitor/index.vue

@@ -13,10 +13,11 @@ import { onBeforeMount, ref, onMounted, onUnmounted, nextTick, provide } from 'v
 import customHeader from '/@/components/vent/customHeader.vue';
 import ModuleCommon from './components/moduleCommon.vue';
 import { list } from './footage.api'
+import { useRouter } from 'vue-router';
 
 let options = ref<any[]>([])
 let optionValue = ref('')
-
+let router = useRouter(); //路由
 
 async function getSysDataSource() {
   let res = await list({ devicekind: 'footageGas' })
@@ -28,6 +29,7 @@ async function getSysDataSource() {
   }) || []
   if (!optionValue.value) {
     optionValue.value = options.value[0]['value']
+    router.push('/footage/monitor/home?deviceType=default' + '&sysID=' + optionValue.value);
   }
 };
 
@@ -35,9 +37,11 @@ async function getSysDataSource() {
 async function getSelectRow(deviceID) {
   console.log(deviceID, '选项切换')
   optionValue.value = deviceID
+  router.push('/footage/monitor/home?deviceType=default' + '&sysID=' + optionValue.value);
 }
 
 onMounted(async () => {
+
   await getSysDataSource()
 })
 </script>