|
|
@@ -13,11 +13,12 @@ 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';
|
|
|
+import { useRouter,useRoute } from 'vue-router';
|
|
|
|
|
|
let options = ref<any[]>([])
|
|
|
let optionValue = ref('')
|
|
|
let router = useRouter(); //路由
|
|
|
+const currentRoute = useRoute();
|
|
|
|
|
|
async function getSysDataSource() {
|
|
|
let res = await list({ devicekind: 'footageGas' })
|
|
|
@@ -29,7 +30,7 @@ async function getSysDataSource() {
|
|
|
}) || []
|
|
|
if (!optionValue.value) {
|
|
|
optionValue.value = options.value[0]['value']
|
|
|
- router.push('/footage/monitor/home?deviceType=default' + '&sysID=' + optionValue.value);
|
|
|
+ router.push(`${currentRoute.path}?deviceType=default&sysID=${ optionValue.value}`);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -37,7 +38,7 @@ async function getSysDataSource() {
|
|
|
async function getSelectRow(deviceID) {
|
|
|
console.log(deviceID, '选项切换')
|
|
|
optionValue.value = deviceID
|
|
|
- router.push('/footage/monitor/home?deviceType=default' + '&sysID=' + optionValue.value);
|
|
|
+ router.push(`${currentRoute.path}?deviceType=default&sysID=${ optionValue.value}`);
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|