feat:完善功能
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="dialog">
|
||||
<el-dialog v-model="modelValue" align-center :modal="false" :show-close="false">
|
||||
<img class="close" src="@/assets/images/close.png" @click="modelValue = false" />
|
||||
<img class="close" src="@/assets/images/close.png" @click="handleClose" />
|
||||
<div class="flex">
|
||||
<div class="list-box">
|
||||
<title2 title="车船" />
|
||||
@@ -175,8 +175,8 @@
|
||||
let list = ref([])
|
||||
let carOverlays = ref([])
|
||||
let shipOverlays = ref([])
|
||||
let lastInfoBox = ref()
|
||||
let infoBox = ref()
|
||||
let lastInfoBox = ref(null)
|
||||
let infoBox = ref(null)
|
||||
let currentMarker = ref()
|
||||
let tabs = ref([
|
||||
{
|
||||
@@ -212,11 +212,12 @@
|
||||
{ immediate: true }
|
||||
)
|
||||
watch(
|
||||
() => [map.value, props.carList, props.shipList],
|
||||
(val) => {
|
||||
if (val[0]) {
|
||||
() => [map.value, props.carList, props.shipList, modelValue.value],
|
||||
() => {
|
||||
if (map.value && modelValue.value) {
|
||||
// 109.645729,31.041203
|
||||
if (carOverlays.value.length > 0) {
|
||||
console.log(11111)
|
||||
// 更新车辆marker位置
|
||||
let flag = false
|
||||
for (let i = 0; i < carOverlays.value.length; i++) {
|
||||
@@ -248,6 +249,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(2222)
|
||||
props.carList.map((item, i) => {
|
||||
if (item.lng && item.lat) {
|
||||
addMarker(carIcon, [item.lng, item.lat], [36, 50])
|
||||
@@ -255,7 +257,6 @@
|
||||
e.sim = e.target.sim
|
||||
currentMarker.value = e
|
||||
let obj = props.carList.find((item) => item.sim == e.target.sim)
|
||||
console.log(obj, 'obj')
|
||||
setInfoBox(e.latLng, obj)
|
||||
})
|
||||
marker.value.sim = item.sim
|
||||
@@ -320,6 +321,7 @@
|
||||
const day = date.getDate()
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
const setHtml = (data) => {
|
||||
data.gpsTime = timestampToYMD(data?.gpsTime)
|
||||
// <div class='marker-col'> <img src='${icon16}' /> <p> 18723232323 </p> </div>
|
||||
@@ -380,6 +382,15 @@
|
||||
active.value = index
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
carOverlays.value = []
|
||||
shipOverlays.value = []
|
||||
map.value = null
|
||||
infoBox.value = null
|
||||
lastInfoBox.value = null
|
||||
modelValue.value = false
|
||||
}
|
||||
|
||||
const getGpsList = async () => {
|
||||
let res = await getGpsListApi({
|
||||
scenicSpotId: scenicSpotId.value,
|
||||
|
||||
Reference in New Issue
Block a user