feat:完善功能

This commit is contained in:
zjc
2025-02-26 22:18:09 +08:00
parent 5bdb5ea5c6
commit 01e3aabbfc
9 changed files with 456 additions and 108 deletions

View File

@@ -3,7 +3,7 @@
<ul class="nav">
<li
class="nav-item"
:class="{ active: current == index }"
:class="{ active: current === index }"
v-for="(item, index) in routerList"
:key="index"
@click="handleNav(item, index)"
@@ -11,20 +11,11 @@
{{ item.name }}
</li>
</ul>
<div id="traffic-map" :class="[routers.length == 0 ? 'traffic-map-big' : 'traffic-map']" />
<div class="map-box">
<!-- <div class="video-list">
<div class="li">
<vue3VideoPlay v-bind="options" />
</div>
<div class="li">
<vue3VideoPlay v-bind="options" />
</div>
<div class="menu">查看更多</div>
</div> -->
</div>
<div v-if="routers.length > 0" class="list">
<div class="item" v-for="(item, index) in routers" :key="index">
<div class="item" v-for="(item, index) in routers" :key="index" @click="handleRouter(item)">
<div class="header">
<div class="header-left">
<img src="@/assets/images/work-icon-xl-1.png" />
@@ -49,7 +40,7 @@
<img src="@/assets/images/t-icon-1.png" alt="" />拥堵距离
</div>
<div class="statistics-item__value flex">
{{item.congestLength}}
{{ item.congestLength }}
<span>km</span>
</div>
</div>
@@ -133,6 +124,13 @@
map.value.centerAndZoom(new BMapGL.Point(e.longitude, e.latitude), e.level)
}
const handleRouter = (e) => {
let location = e.location.split(',')
console.log(location, 'location')
current.value = ''
map.value.centerAndZoom(new BMapGL.Point(location[0], location[1]), 15)
}
const getRouterList = async () => {
let res = await getRouterListApi()
routerList.value = res.data
@@ -141,7 +139,6 @@
const getRouters = async () => {
let res = await getRoutersApi()
routers.value = res.data
console.log(routers.value, 'routers')
}
onMounted(() => {