|
@@ -2,7 +2,6 @@
|
|
<div id="globalMap">
|
|
<div id="globalMap">
|
|
<div class="global-map">
|
|
<div class="global-map">
|
|
<MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
|
|
<MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
|
|
- <!-- <YMap v-else-if="['imageMap', 'satellite2', 'satellite3'].includes(activeMap)" :activeMap="activeMap" />-->
|
|
|
|
<YztMap v-else-if="['imageMap'].includes(activeMap)" ref="map2Ref" :active-map="activeMap" :point-type="pointType" />
|
|
<YztMap v-else-if="['imageMap'].includes(activeMap)" ref="map2Ref" :active-map="activeMap" :point-type="pointType" />
|
|
<Map
|
|
<Map
|
|
v-else
|
|
v-else
|
|
@@ -51,11 +50,14 @@ import CommunicationSupport from '@/views/globalMap/RightMenu/CommunicationSuppo
|
|
|
|
|
|
const rightMenuRef = ref(null);
|
|
const rightMenuRef = ref(null);
|
|
const mapData = reactive(logicalData);
|
|
const mapData = reactive(logicalData);
|
|
|
|
+let map;
|
|
let mapRef = ref(null);
|
|
let mapRef = ref(null);
|
|
let map2Ref = ref(null);
|
|
let map2Ref = ref(null);
|
|
let leftMenuRef = ref(null);
|
|
let leftMenuRef = ref(null);
|
|
// vectorgraph satellite imageMap 废弃:logical satellite2 satellite3
|
|
// vectorgraph satellite imageMap 废弃:logical satellite2 satellite3
|
|
let activeMap = ref('satellite');
|
|
let activeMap = ref('satellite');
|
|
|
|
+// 附近视频菜单数据
|
|
|
|
+let videoMenu = ref({});
|
|
const communicationSupport = reactive({
|
|
const communicationSupport = reactive({
|
|
show: false,
|
|
show: false,
|
|
data: {}
|
|
data: {}
|
|
@@ -144,8 +146,15 @@ const clickMenu = (item, dataList) => {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
} else if (item.path === '3') {
|
|
} else if (item.path === '3') {
|
|
|
|
+ // 通讯保障
|
|
communicationSupport.show = !communicationSupport.show;
|
|
communicationSupport.show = !communicationSupport.show;
|
|
communicationSupport.data = item;
|
|
communicationSupport.data = item;
|
|
|
|
+ } else if (item.path === '4') {
|
|
|
|
+ videoMenu.value = item;
|
|
|
|
+ // 附近视频
|
|
|
|
+ map = getMap();
|
|
|
|
+ //为地图注册click事件获取鼠标点击出的经纬度坐标
|
|
|
|
+ map.on('click', handleClickMap);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const handleHideCommunicationSupport = () => {
|
|
const handleHideCommunicationSupport = () => {
|
|
@@ -229,10 +238,24 @@ const trackPlayback = (data) => {
|
|
return {};
|
|
return {};
|
|
};
|
|
};
|
|
let showNearbyVideos = ref(false);
|
|
let showNearbyVideos = ref(false);
|
|
-let location = reactive([]);
|
|
|
|
|
|
+let location = ref([]);
|
|
|
|
+watch(showNearbyVideos, () => {
|
|
|
|
+ if (!showNearbyVideos.value) {
|
|
|
|
+ location.value = [];
|
|
|
|
+ if (!!videoMenu.value) {
|
|
|
|
+ leftMenuRef.value.setMenuChange(videoMenu.value, false);
|
|
|
|
+ videoMenu.value = {};
|
|
|
|
+ map.off('click', handleClickMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+});
|
|
// 显示附近视频
|
|
// 显示附近视频
|
|
const handleShowVideo = (data) => {
|
|
const handleShowVideo = (data) => {
|
|
- location = [data.longitude, data.latitude];
|
|
|
|
|
|
+ location.value = [data.longitude, data.latitude];
|
|
|
|
+ showNearbyVideos.value = true;
|
|
|
|
+};
|
|
|
|
+const handleClickMap = (e) => {
|
|
|
|
+ location.value = [e.lnglat.getLng(), e.lnglat.getLat()];
|
|
showNearbyVideos.value = true;
|
|
showNearbyVideos.value = true;
|
|
};
|
|
};
|
|
let showWarehouse = ref(false);
|
|
let showWarehouse = ref(false);
|
|
@@ -241,11 +264,14 @@ const handleShowWarehouse = (data) => {
|
|
warehouseData.value = data;
|
|
warehouseData.value = data;
|
|
showWarehouse.value = true;
|
|
showWarehouse.value = true;
|
|
};
|
|
};
|
|
-// const handleResize = () => {
|
|
|
|
-// }
|
|
|
|
// onMounted(() => {
|
|
// onMounted(() => {
|
|
// mapRef.value.addEventListener('resize', handleResize);
|
|
// mapRef.value.addEventListener('resize', handleResize);
|
|
// })
|
|
// })
|
|
|
|
+onBeforeUnmount(() => {
|
|
|
|
+ if (!!map) {
|
|
|
|
+ map.off('click', handleClickMap);
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
|
|
provide('getMap', getMap);
|
|
provide('getMap', getMap);
|
|
provide('trackPlayback', trackPlayback);
|
|
provide('trackPlayback', trackPlayback);
|