This commit is contained in:
duanliang
2025-04-17 20:18:38 +08:00
parent d7eeea3efe
commit 09dcabadda
23 changed files with 1302 additions and 269 deletions

View File

@@ -180,7 +180,7 @@
// 点击导航
const handleNav = (item) => {
// console.log(item.path,'测试一下 ')
console.log(item,router.currentRoute.value.path,'测试一下 ')
if (isSkip.value) {
router.push(item.path)
} else {
@@ -219,8 +219,10 @@
let res = await getSpotListApi()
spotList.value = res.data
}
let monitorDefaultData = ref(null)
// 设置当前路由导航栏
const setNav = async () => {
console.log(monitorDefaultData.value,'setNav 测试 ++++++++++++')
navLeft.value = []
navRight.value = []
otherLeftNav.value = []
@@ -294,8 +296,16 @@
},
...spotRes.data
]
current.value = navLeft.value[0].id
title.value = navLeft.value[0].name
if(monitorDefaultData.value){
current.value = monitorDefaultData.value.id
title.value = monitorDefaultData.value.name
pubSub.publish('monitorChange', monitorDefaultData.value)
}else{
current.value = navLeft.value[0].id
title.value = navLeft.value[0].name
}
break
case '/sceneTesting':
title.value = '三峡之巅-安全检测'
@@ -362,7 +372,26 @@
},
{ immediate: true }
)
onMounted(() => {
onMounted(async() => {
// 获取查询参数
PubSub.subscribe('navToChange', (msg, data) => {
monitorDefaultData.value = data
console.log(monitorDefaultData.value,'monitorDefaultData.valuemonitorDefaultData.value')
// getSpotListApi().then((res)=>{
// console.log(res.data[0],'spotResspotResspotRes')
// router.push('/monitor')
// router.currentRoute.value.path = '/monitor'
// setTimeout(()=>{
// current.value = res.data[1].id
// handleNav(res.data[1])
// pubSub.publish('monitorChange', res.data[1])
// },2000)
// })
})
getWeather()
getSpotList()
getCurrentDate()