Hwf пре 7 месеци
родитељ
комит
768f70e865

+ 1 - 1
.env.production

@@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
 VITE_APP_SNAILJOB_ADMIN = '/snail-job'
 
 # 生产环境
-VITE_APP_BASE_API = '/'
+VITE_APP_BASE_API = ''
 VITE_APP_BASE_API2 = '/'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli

+ 0 - 2
src/components/NearbyVideos/index.vue

@@ -26,8 +26,6 @@
 <script lang="ts" setup name="NearbyVideos">
 // 请求参数
 import { getVideoInfo } from '@/api/globalMap';
-import { getWaterloggedRoadsUpdateTime } from '@/api/globalMap/potentialFloodHazard';
-import { parseTime } from "@/utils/ruoyi";
 
 interface Props {
   modelValue: boolean;

+ 1 - 37
src/types/components.d.ts

@@ -17,43 +17,6 @@ declare module 'vue' {
     Dialog: typeof import('./../components/Dialog/index.vue')['default']
     DictTag: typeof import('./../components/DictTag/index.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
-    ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
-    ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
-    ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
-    ElButton: typeof import('element-plus/es')['ElButton']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCol: typeof import('element-plus/es')['ElCol']
-    ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
-    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
-    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
-    ElDialog: typeof import('element-plus/es')['ElDialog']
-    ElDivider: typeof import('element-plus/es')['ElDivider']
-    ElDrawer: typeof import('element-plus/es')['ElDrawer']
-    ElDropdown: typeof import('element-plus/es')['ElDropdown']
-    ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
-    ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
-    ElForm: typeof import('element-plus/es')['ElForm']
-    ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElIcon: typeof import('element-plus/es')['ElIcon']
-    ElImage: typeof import('element-plus/es')['ElImage']
-    ElInput: typeof import('element-plus/es')['ElInput']
-    ElLink: typeof import('element-plus/es')['ElLink']
-    ElMenu: typeof import('element-plus/es')['ElMenu']
-    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
-    ElOption: typeof import('element-plus/es')['ElOption']
-    ElPagination: typeof import('element-plus/es')['ElPagination']
-    ElRow: typeof import('element-plus/es')['ElRow']
-    ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
-    ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
-    ElSlider: typeof import('element-plus/es')['ElSlider']
-    ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
-    ElSwitch: typeof import('element-plus/es')['ElSwitch']
-    ElTimeline: typeof import('element-plus/es')['ElTimeline']
-    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
-    ElTree: typeof import('element-plus/es')['ElTree']
-    ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FooterSection: typeof import('./../components/FooterSection/index.vue')['default']
     Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
@@ -95,6 +58,7 @@ declare module 'vue' {
     VideoContainer: typeof import('./../components/HKVideo/video-container.vue')['default']
     VideoContainer2: typeof import('./../components/HKVideo/video-container2.vue')['default']
     YMap: typeof import('./../components/Map/YMap.vue')['default']
+    YMapold: typeof import('./../components/Map/YMapold.vue')['default']
     YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
 }

+ 1 - 1
src/views/globalMap/SwitchMapTool.vue

@@ -31,7 +31,7 @@ const mapData = ref([
   // { name: '逻辑地图', key: 'logical' },
   { name: '卫星地图', key: 'satellite' },
   { name: '矢量地图', key: 'vectorgraph' },
-  { name: '影像图', key: 'imageMap' }
+  // { name: '影像图', key: 'imageMap' }
   // { name: '粤政图2', key: 'satellite3' }
 ]);
 let open = ref(false);

+ 31 - 5
src/views/globalMap/index.vue

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