类型:开发

描述:
This commit is contained in:
2025-04-28 23:25:31 +08:00
parent 4128fd8c63
commit db5dd3ae4d
3 changed files with 28 additions and 28 deletions

View File

@@ -107,10 +107,10 @@
import { getWeatherApi } from '@/api/home' import { getWeatherApi } from '@/api/home'
import { getSpotListApi } from '@/api/sentiment' import { getSpotListApi } from '@/api/sentiment'
import { getHotelListApi } from '@/api/hotel' import { getHotelListApi } from '@/api/hotel'
import pubSub from 'pubsub-js' import pubSub from 'pubsub-js'
import { useScenicStore } from '@/stores/scenic' import { useScenicStore } from '@/stores/scenic'
const scenicStore = useScenicStore() const scenicStore = useScenicStore()
const router = useRouter() const router = useRouter()
@@ -156,7 +156,7 @@
router.push('/home') router.push('/home')
} }
const handleCommand = (item, type) => { const handleCommand = (item, type) => {
current.value = '' current.value = ''
if (type === 'hotel') { if (type === 'hotel') {
otherRightLabel.value = '其他场馆' otherRightLabel.value = '其他场馆'
@@ -177,7 +177,7 @@
break break
} }
} }
// 点击导航 // 点击导航
const handleNav = (item) => { const handleNav = (item) => {
console.log(item,router.currentRoute.value.path,'测试一下 ') console.log(item,router.currentRoute.value.path,'测试一下 ')
@@ -241,7 +241,7 @@
{ name:'车船', path:'/vehicles'}, { name:'车船', path:'/vehicles'},
// { name: '工单', path: '/workOrder' }, // { name: '工单', path: '/workOrder' },
{ name: '舆情', path: '/sentiment' }, { name: '舆情', path: '/sentiment' },
{ name: '酒店', path: '/hotel' } { name: '场馆', path: '/hotel' }
] ]
break break
case '/vehicles': case '/vehicles':
@@ -254,7 +254,7 @@
isBack.value = true isBack.value = true
let res = await getSpotListApi() let res = await getSpotListApi()
navLeft.value = res.data navLeft.value = res.data
current.value = res.data[0].id current.value = res.data[0].id
title.value = navLeft.value[0].name title.value = navLeft.value[0].name
pubSub.publish('scenicChange', navLeft.value[0]) pubSub.publish('scenicChange', navLeft.value[0])
@@ -304,8 +304,8 @@
current.value = navLeft.value[0].id current.value = navLeft.value[0].id
title.value = navLeft.value[0].name title.value = navLeft.value[0].name
} }
break break
case '/sceneTesting': case '/sceneTesting':
title.value = '三峡之巅-异常检测' title.value = '三峡之巅-异常检测'
@@ -374,8 +374,8 @@
) )
onMounted(async() => { onMounted(async() => {
// 获取查询参数 // 获取查询参数
PubSub.subscribe('navToChange', (msg, data) => { PubSub.subscribe('navToChange', (msg, data) => {
monitorDefaultData.value = data monitorDefaultData.value = data
console.log(monitorDefaultData.value,'monitorDefaultData.valuemonitorDefaultData.value') console.log(monitorDefaultData.value,'monitorDefaultData.valuemonitorDefaultData.value')
@@ -389,8 +389,8 @@
// pubSub.publish('monitorChange', res.data[1]) // pubSub.publish('monitorChange', res.data[1])
// },2000) // },2000)
// }) // })
}) })
getWeather() getWeather()
getSpotList() getSpotList()

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="box-1"> <div class="box-1">
<div class="statistics"> <div class="statistics">
<Title1 title="总路段拥堵情况" /> <Title1 title="拥堵情况" />
<!-- <div class="item-box"> <!-- <div class="item-box">
<div class="item-t flex"> <img src="@/assets/images/t-icon-1.png" alt="" />拥堵总数 </div> <div class="item-t flex"> <img src="@/assets/images/t-icon-1.png" alt="" />拥堵总数 </div>
<div class="item-num"> <div class="item-num">
@@ -55,9 +55,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chart-item"> <div class="chart-item">
<Title3 title="拥堵类型频次占比" /> <Title3 title="拥堵类型频次" />
<div class="chart__inner"> <div class="chart__inner">
<div class="new-vehicle"> <div class="new-vehicle">
<vehicle-source :list="chartData.typeNum" /> <vehicle-source :list="chartData.typeNum" />
@@ -71,11 +71,11 @@
> >
<p class="dot" :style="{ background: colors[index] }" /> <p class="dot" :style="{ background: colors[index] }" />
<p class="name">{{ item.name }}</p> <p class="name">{{ item.name }}</p>
<p class="value">{{ item.value }}%</p> <p class="value">{{ item.value }}</p>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -102,9 +102,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="chart-item"> <div class="chart-item">
<Title3 title="拥堵类型时长占比" /> <Title3 title="拥堵类型时长" />
<div class="chart__inner"> <div class="chart__inner">
<div class="new-vehicle"> <div class="new-vehicle">
<!-- <spotRate <!-- <spotRate
@@ -122,11 +122,11 @@
> >
<p class="dot" :style="{ background: colors[index] }" /> <p class="dot" :style="{ background: colors[index] }" />
<p class="name">{{ item.name }}</p> <p class="name">{{ item.name }}</p>
<p class="value">{{ item.value }}%</p> <p class="value">{{ item.value }}分钟</p>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -206,7 +206,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
height: vh(380); height: vh(380);
} }
&__legend { &__legend {

View File

@@ -14,7 +14,7 @@
<div> <div>
<div class="title-1"> <div class="title-1">
<div class="title"> <div class="title">
<span> 核心路段 </span> <span> 核心路段 </span>
</div> </div>
</div> </div>
<div id="traffic-map" class="traffic-map-big" :class="{ 'traffic-map': routers.length > 0 }" /> <div id="traffic-map" class="traffic-map-big" :class="{ 'traffic-map': routers.length > 0 }" />
@@ -131,12 +131,12 @@
watch( watch(
() => [markerList.value,map.value], () => [markerList.value,map.value],
(val) => { (val) => {
if(val[0].length&&val[1]){ if(val[0].length&&val[1]){
nextTick(()=>{ nextTick(()=>{
val[0].forEach((item,index)=>{ val[0].forEach((item,index)=>{
addMarker(mapIcon,[item.longitude,item.latitude],[40, 60]) addMarker(mapIcon,[item.longitude,item.latitude],[40, 60])
marker.value.addEventListener('click', (e) => { marker.value.addEventListener('click', (e) => {
console.log(item,'111111111111') console.log(item,'111111111111')
cameraIndexCode.value = item.cameraIndexCode cameraIndexCode.value = item.cameraIndexCode
@@ -171,10 +171,10 @@
label.setStyle({ label.setStyle({
display:'none' display:'none'
}); });
}) })
}) })
}) })
} }
}, },