|
@@ -62,11 +62,13 @@ import GridPointRainfall from './RightMenu/GridPointRainfall.vue';
|
|
|
import EmergencyCrew from './RightMenu/EmergencyCrew.vue';
|
|
|
import useMapStore from '@/store/modules/map';
|
|
|
import { getVehicleTrajectory } from '@/api/globalMap/KeyVehicles';
|
|
|
-import { iconList } from './data/mapData';
|
|
|
+import { getImageUrl, iconList } from './data/mapData';
|
|
|
import { debounce, deepClone } from '@/utils';
|
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
|
import { getPointInfo2 } from '@/api/videoMonitor';
|
|
|
import { toLonLat } from 'ol/proj';
|
|
|
+import { getEventDetail } from '@/api/duty/eventing';
|
|
|
+import gcoord from 'gcoord';
|
|
|
|
|
|
//dom元素
|
|
|
const rightMenuRef = ref(null);
|
|
@@ -74,7 +76,8 @@ const mapRef = ref(null);
|
|
|
const map2Ref = ref(null);
|
|
|
const leftMenuRef = ref(null);
|
|
|
const timeAxisRef = ref(null);
|
|
|
-
|
|
|
+const route = useRoute();
|
|
|
+const eventId = ref('');
|
|
|
// 地图
|
|
|
let map: any = {};
|
|
|
// 地图类
|
|
@@ -456,12 +459,44 @@ watch(
|
|
|
if (!!map && Object.keys(map).length !== 0) {
|
|
|
map.on('moveend', mapMoveEnd);
|
|
|
}
|
|
|
+ if (eventId.value) {
|
|
|
+ getEventDetail({ event_id: eventId.value }).then((res) => {
|
|
|
+ const lnglat = gcoord.transform([res.data.longitude, res.data.latitude], gcoord.GCJ02, gcoord.WGS84);
|
|
|
+ const newMap = mapStore.isAMap ? map : map.getView();
|
|
|
+ newMap.setCenter(lnglat);
|
|
|
+ mapUtils.setAddress({
|
|
|
+ longitude: lnglat[0],
|
|
|
+ latitude: lnglat[1],
|
|
|
+ image: getImageUrl('address.png'),
|
|
|
+ imageHover: getImageUrl('address_hover.png'),
|
|
|
+ size: [45, 48],
|
|
|
+ name: '灾害地点'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
immediate: true
|
|
|
}
|
|
|
);
|
|
|
+watch(
|
|
|
+ () => mapStore.updateAddress,
|
|
|
+ (lnglat) => {
|
|
|
+ if (lnglat && lnglat.length == 2) {
|
|
|
+ const newMap = mapStore.isAMap ? map : map.getView();
|
|
|
+ debugger
|
|
|
+ mapUtils.setAddress({
|
|
|
+ longitude: lnglat[0],
|
|
|
+ latitude: lnglat[1],
|
|
|
+ image: getImageUrl('address.png'),
|
|
|
+ imageHover: getImageUrl('address_hover.png'),
|
|
|
+ size: [45, 48],
|
|
|
+ name: '灾害地点'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
// 监听视频打点
|
|
|
watch(
|
|
|
() => mapStore.pointParams,
|
|
@@ -488,8 +523,10 @@ watch(
|
|
|
deep: true
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
mapStore.initData();
|
|
|
+ eventId.value = route.query.event_id;
|
|
|
});
|
|
|
onBeforeUnmount(() => {
|
|
|
if (!!map) {
|