传参给实时地图

This commit is contained in:
yyy 2025-02-28 11:29:46 +08:00
parent 30ce5ae75b
commit a3630f3c5a
2 changed files with 9 additions and 11 deletions

View File

@ -2306,8 +2306,6 @@ onBeforeRouteLeave((to, from) => {
router.replace({ router.replace({
name: 'MapPageRealTimeMap', name: 'MapPageRealTimeMap',
query: { query: {
floor: imgBgObj.floor,
area: imgBgObj.area,
mapId: imgBgObj.positionMapId mapId: imgBgObj.positionMapId
} }
}) })

View File

@ -168,18 +168,18 @@ const editMap = () => {
// //
const mapInfo = ref({ const mapInfo = ref({
mapId: '', mapId: ''
floor: '',
area: ''
}) })
onMounted(() => { const { query } = useRoute() //
if (route.query.mapId) { onMounted(async () => {
mapInfo.value.mapId = route.query.mapId if (query.mapId) {
mapInfo.value.floor = route.query.floor let res = await MapApi.getPositionMap(query.mapId)
mapInfo.value.area = route.query.area mapInfo.value = res
indexPageRef.value.getMapData(mapInfo.value)
} else {
getList()
} }
getList()
}) })
</script> </script>