|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import AMapLoader from '@amap/amap-jsapi-loader';
|
|
|
|
import AMapLoader from '@amap/amap-jsapi-loader';
|
|
|
|
import {getCarGpsList, listBasetyre} from '@/api/realTimeMonitoring/vehicleMonitoring'
|
|
|
|
import {getCarGpsList, listBasetyre,queryCardata} from '@/api/realTimeMonitoring/vehicleMonitoring'
|
|
|
|
import {parseTime} from "@/utils/ruoyi";
|
|
|
|
import {parseTime} from "@/utils/ruoyi";
|
|
|
|
import {onBeforeUnmount} from "@vue/runtime-core";
|
|
|
|
import {onBeforeUnmount} from "@vue/runtime-core";
|
|
|
|
|
|
|
|
|
|
|
@ -20,19 +20,26 @@ const treeClick = (data) => {
|
|
|
|
if (!data.baseCarList) {
|
|
|
|
if (!data.baseCarList) {
|
|
|
|
map.remove(markers.value);
|
|
|
|
map.remove(markers.value);
|
|
|
|
markers.value = []
|
|
|
|
markers.value = []
|
|
|
|
setMarker({id: data.id}, 14)
|
|
|
|
setMarker({id: data.id}, 14,false)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
map.remove(markers.value);
|
|
|
|
map.remove(markers.value);
|
|
|
|
markers.value = []
|
|
|
|
markers.value = []
|
|
|
|
setMarker({queueId: data.id}, 8)
|
|
|
|
setMarker({queueId: data.id}, 8,true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.$tab = proxy.$tab
|
|
|
|
window.$tab = proxy.$tab
|
|
|
|
const setMarker = async (data, zoom) => {
|
|
|
|
const setMarker = async (data, zoom,isChildren) => {
|
|
|
|
const {data: markerArr} = await getCarGpsList(data)
|
|
|
|
let markerArr = []
|
|
|
|
|
|
|
|
if(isChildren){
|
|
|
|
|
|
|
|
let e= await listBasetyre(data)
|
|
|
|
|
|
|
|
markerArr = e.rows?.[0]?.baseCarList
|
|
|
|
|
|
|
|
} else{
|
|
|
|
|
|
|
|
let e = await queryCardata(data)
|
|
|
|
|
|
|
|
markerArr = [e.data]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(markerArr)
|
|
|
|
markerArr.forEach((e, index) => {
|
|
|
|
markerArr.forEach((e, index) => {
|
|
|
|
|
|
|
|
|
|
|
|
// 点标记
|
|
|
|
// 点标记
|
|
|
|
markers.value[index] = new AMap.Marker({
|
|
|
|
markers.value[index] = new AMap.Marker({
|
|
|
|
content: '<div class="markerIcon" />',
|
|
|
|
content: '<div class="markerIcon" />',
|
|
|
@ -69,7 +76,7 @@ AMapLoader.load({
|
|
|
|
zoom: 8, //初始化地图级别
|
|
|
|
zoom: 8, //初始化地图级别
|
|
|
|
center: [116.397428, 39.90923], //初始化地图中心点位置
|
|
|
|
center: [116.397428, 39.90923], //初始化地图中心点位置
|
|
|
|
});
|
|
|
|
});
|
|
|
|
await setMarker()
|
|
|
|
await setMarker(undefined,undefined,true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在图面添加工具条控件,工具条控件集成了缩放、平移、定位等功能按钮在内的组合控件
|
|
|
|
// 在图面添加工具条控件,工具条控件集成了缩放、平移、定位等功能按钮在内的组合控件
|
|
|
|