Переглянути джерело

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/types/components.d.ts
yangyuxuan 1 місяць тому
батько
коміт
d6efef6d73

+ 26 - 0
src/api/globalMap/spatialAnalysis.ts

@@ -607,6 +607,32 @@ export const getPointInfoFloodControlHydropowerStation = (id: string) => {
   });
 };
 
+// 雨窝点重点村
+export const getPointInfoRainPitsNestVillages = (id: string) => {
+  return request({
+    url: '/api/gateway/v2/get_point_info_rain_pits_nest_villages',
+    method: 'post',
+    data: {
+      query: {
+        id: id
+      }
+    }
+  });
+};
+
+// 重点易灾村
+export const getPointInfoDisasterProneVillages = (id: string) => {
+  return request({
+    url: '/api/gateway/v2/get_point_info_disaster_prone_villages',
+    method: 'post',
+    data: {
+      query: {
+        id: id
+      }
+    }
+  });
+};
+
 // 视频详情
 export const getVideoInfo = (video_code: string) => {
   return request({

+ 9 - 9
src/components/HKVideo/video-container2.vue

@@ -4,7 +4,7 @@
       <div class="tag" :title="videoData[0].name">
         <div class="name">{{ videoData[0].name }}</div>
       </div>
-      <HKVideo :dot_data="videoData[0]" :height="595" />
+      <HKVideo :dot_data="videoData[0]" :height="595" autoplay />
     </div>
   </div>
   <div v-else-if="videoData.length >= 2 && videoData.length <= 4" class="video-container2">
@@ -12,7 +12,7 @@
       <div class="tag" :title="item.name">
         <div class="name">{{ item.name }}</div>
       </div>
-      <HKVideo :dot_data="item" :height="288" />
+      <HKVideo :dot_data="item" :height="288" autoplay />
     </div>
   </div>
   <div v-else-if="videoData.length >= 5 && videoData.length <= 6" class="video-container3">
@@ -21,7 +21,7 @@
         <div class="tag" :title="videoData[0].name">
           <div class="name">{{ videoData[0].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[0]" :height="383" />
+        <HKVideo :dot_data="videoData[0]" :height="383" autoplay />
       </div>
     </div>
     <div class="box2">
@@ -29,13 +29,13 @@
         <div class="tag" :title="videoData[1].name">
           <div class="name">{{ videoData[1].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[1]" :height="188" />
+        <HKVideo :dot_data="videoData[1]" :height="188" autoplay />
       </div>
       <div class="video-item3">
         <div class="tag" :title="videoData[2].name">
           <div class="name">{{ videoData[2].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[2]" :height="188" />
+        <HKVideo :dot_data="videoData[2]" :height="188" autoplay />
       </div>
     </div>
     <div class="box3">
@@ -43,19 +43,19 @@
         <div class="tag" :title="videoData[3].name">
           <div class="name">{{ videoData[3].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[3]" :height="188" />
+        <HKVideo :dot_data="videoData[3]" :height="188" autoplay />
       </div>
       <div class="video-item">
         <div class="tag" :title="videoData[4].name">
           <div class="name">{{ videoData[4].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[4]" :height="188" />
+        <HKVideo :dot_data="videoData[4]" :height="188" autoplay />
       </div>
       <div class="video-item">
         <div class="tag" :title="videoData[5].name">
           <div class="name">{{ videoData[5].name }}</div>
         </div>
-        <HKVideo :dot_data="videoData[5]" :height="188" />
+        <HKVideo :dot_data="videoData[5]" :height="188" autoplay />
       </div>
     </div>
   </div>
@@ -64,7 +64,7 @@
       <div class="tag" :title="item.name">
         <div class="name">{{ item.name }}</div>
       </div>
-      <HKVideo :dot_data="item" :height="180" />
+      <HKVideo :dot_data="item" :height="180" :autoplay="index < 9" />
     </div>
   </div>
   <div v-else class="tip">附近没有可用监控视频</div>

+ 39 - 28
src/components/Map/YztMap/index.vue

@@ -29,7 +29,7 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
 const appStore = useAppStore();
 const mapStore = useMapStore();
-const emits = defineEmits(['handleShowWarehouse', 'handleShowVideo', 'handleShowPeople', 'resize']);
+const emits = defineEmits(['handleShowWarehouse', 'handleShowVideo', 'handleShowPeople', 'closeDetailDialog', 'resize']);
 
 const mapRef = ref(null);
 const containerRef = ref();
@@ -55,6 +55,7 @@ watch(
 );
 const mapList = reactive({
   satellite2: [
+    { layer: 'map', layerType: 'WMTS', code: 'YZT1708679726700', zIndex: '-100', visible: true },
     { layer: 'map', layerType: 'WFS', code: 'YZT1712111943104', zIndex: '-99', visible: true },
     { layer: 'annotation', layerType: 'WMTS', code: 'YZT1695608158269', zIndex: '-98', visible: true }
   ],
@@ -115,7 +116,12 @@ const init = () => {
       // let drawTool = new DrawTool({ mapUtils, map });
       handleResize();
     },
-    onMarkerClick: (data) => {
+    onMarkerClick: (data, flag) => {
+      let title = titleList[data.dataType];
+      if (flag && !!title) {
+        data.title = title;
+        emits('closeDetailDialog', data);
+      }
       // 多点位
       if (data.type === '1') {
         getPointInfoList2({
@@ -159,7 +165,10 @@ const init = () => {
           content.appendChild(tableBox);
           let closeBtn = document.createElement('div');
           closeBtn.className = 'close';
-          closeBtn.onclick = () => mapUtils.hideInfo(true);
+          closeBtn.onclick = () => {
+            mapUtils.hideInfo(true);
+            emits('closeDetailDialog', data);
+          };
           content.appendChild(closeBtn);
           mapUtils.showInfo(content, [data.longitude, data.latitude], -data.scale * data.size[1], true);
         });
@@ -182,36 +191,35 @@ const handlePointDetails = (data) => {
       titleDom.className = 'title-box';
       titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
       div.appendChild(titleDom);
-      if (data.dataType === 2) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>物资详情</div>';
-        btn.onclick = () => {
-          emits('handleShowWarehouse', data);
-        };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 4) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>附近视频</div>';
-        btn.onclick = () => {
-          emits('handleShowVideo', data);
+      const objs = {
+        '2': {
+          title: '物资详情',
+          method: 'handleShowWarehouse'
+        },
+        '41': {
+          title: '人员列表',
+          method: 'handleShowPeople'
+        },
+        '43': {
+          title: '历史轨迹',
+          method: 'handleShowTrack'
+        }
+      };
+      let obj = objs[data.dataType];
+      if ([4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].includes(data.dataType)) {
+        obj = {
+          title: '附近视频',
+          method: 'handleShowVideo'
         };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 41) {
+      }
+      if (!!obj) {
         let btnBox = document.createElement('div');
         let btn = document.createElement('div');
         btnBox.className = 'flex';
         btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>人员列表</div>';
+        btn.innerHTML = '<div class="video-icon"></div>' + obj.title + '<div></div>';
         btn.onclick = () => {
-          emits('handleShowPeople', data);
+          emits(obj.method, data);
         };
         btnBox.appendChild(btn);
         div.appendChild(btnBox);
@@ -253,7 +261,10 @@ const handlePointDetails = (data) => {
       div.appendChild(table);
       let closeBtn = document.createElement('div');
       closeBtn.className = 'close';
-      closeBtn.onclick = () => mapUtils.hideInfo(true);
+      closeBtn.onclick = () => {
+        mapUtils.hideInfo(true);
+        emits('closeDetailDialog', data);
+      };
       div.appendChild(closeBtn);
       mapUtils.showInfo(div, [data.longitude, data.latitude], -data.scale * data.size[1], true);
     } else if (data.dataType === 'video') {

+ 9 - 3
src/components/Map/data.ts

@@ -44,7 +44,9 @@ import {
   getPointInfoLargeCoastalDikes,
   getPointInfoLargeSluices,
   getPointInfoMediumSluices,
-  getPointInfoFloodControlHydropowerStation
+  getPointInfoFloodControlHydropowerStation,
+  getPointInfoRainPitsNestVillages,
+  getPointInfoDisasterProneVillages
 } from '@/api/globalMap/spatialAnalysis';
 import { getRescueTeamsInfo } from '@/api/globalMap/rescueTeam';
 
@@ -99,7 +101,9 @@ export const methodList = {
   '53': getPointInfoLargeCoastalDikes,
   '54': getPointInfoLargeSluices,
   '55': getPointInfoMediumSluices,
-  '56': getPointInfoFloodControlHydropowerStation
+  '56': getPointInfoFloodControlHydropowerStation,
+  '57': getPointInfoRainPitsNestVillages,
+  '58': getPointInfoDisasterProneVillages
 };
 export const titleList = {
   'video': '视频',
@@ -153,5 +157,7 @@ export const titleList = {
   '53': '万亩以上海堤',
   '54': '大型水闸',
   '55': '中型水闸',
-  '56': '防汛任务电站'
+  '56': '防汛任务电站',
+  '57': '雨窝点重点村',
+  '58': '重点易灾村'
 };

+ 38 - 28
src/components/Map/index.vue

@@ -22,7 +22,7 @@ const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
 const appStore = useAppStore();
 const mapStore = useMapStore();
 
-const emits = defineEmits(['handleShowVideo', 'handleShowWarehouse', 'handleShowPeople', 'handleShowVideoDetail', 'resize']);
+const emits = defineEmits(['handleShowVideo', 'handleShowWarehouse', 'handleShowPeople', 'handleShowVideoDetail', 'closeDetailDialog', 'resize']);
 const containerRef = ref();
 const width = ref('100%');
 const height = ref('100%');
@@ -60,7 +60,12 @@ const mapUtils = useAMap({
     drawTool.initMouseTool({ container: 'aMap', map, AMap });
     handleResize();
   },
-  onMarkerClick: (data) => {
+  onMarkerClick: (data, flag) => {
+    let title = titleList[data.dataType];
+    if (flag && !!title) {
+      data.title = title;
+      emits('closeDetailDialog', data);
+    }
     // 多点位
     if (data.type === '1') {
       getPointInfoList2({
@@ -107,7 +112,10 @@ const mapUtils = useAMap({
         content.appendChild(tableBox);
         let closeBtn = document.createElement('div');
         closeBtn.className = 'close';
-        closeBtn.onclick = hideInfo;
+        closeBtn.onclick = () => {
+          hideInfo(true);
+          emits('closeDetailDialog', data);
+        };
         content.appendChild(closeBtn);
         showInfo(content, [data.longitude, data.latitude], -data.size[1], true);
       });
@@ -132,36 +140,35 @@ const handlePointDetails = (data) => {
       titleDom.className = 'title-box';
       titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
       div.appendChild(titleDom);
-      if (data.dataType === 2) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>物资详情</div>';
-        btn.onclick = () => {
-          emits('handleShowWarehouse', data);
-        };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 4) {
-        let btnBox = document.createElement('div');
-        let btn = document.createElement('div');
-        btnBox.className = 'flex';
-        btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>附近视频</div>';
-        btn.onclick = () => {
-          emits('handleShowVideo', data);
+      const objs = {
+        '2': {
+          title: '物资详情',
+          method: 'handleShowWarehouse'
+        },
+        '41': {
+          title: '人员列表',
+          method: 'handleShowPeople'
+        },
+        '43': {
+          title: '历史轨迹',
+          method: 'handleShowTrack'
+        }
+      };
+      let obj = objs[data.dataType];
+      if ([4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].includes(data.dataType)) {
+        obj = {
+          title: '附近视频',
+          method: 'handleShowVideo'
         };
-        btnBox.appendChild(btn);
-        div.appendChild(btnBox);
-      } else if (data.dataType === 41) {
+      }
+      if (!!obj) {
         let btnBox = document.createElement('div');
         let btn = document.createElement('div');
         btnBox.className = 'flex';
         btn.className = 'btn';
-        btn.innerHTML = '<div class="video-icon"></div><div>人员列表</div>';
+        btn.innerHTML = '<div class="video-icon"></div>' + obj.title + '<div></div>';
         btn.onclick = () => {
-          emits('handleShowPeople', data);
+          emits(obj.method, data);
         };
         btnBox.appendChild(btn);
         div.appendChild(btnBox);
@@ -203,7 +210,10 @@ const handlePointDetails = (data) => {
       div.appendChild(table);
       let closeBtn = document.createElement('div');
       closeBtn.className = 'close';
-      closeBtn.onclick = hideInfo;
+      closeBtn.onclick = () => {
+        hideInfo(true);
+        emits('closeDetailDialog', data);
+      };
       div.appendChild(closeBtn);
       showInfo(div, [data.longitude, data.latitude], -data.size[1], true);
     } else if (data.dataType === 'video') {

+ 21 - 3
src/components/TimeAxis/index.vue

@@ -67,6 +67,7 @@ let isNewMarkerPause = false;
 let trackPathArr = [];
 const timelineItems = ref([]);
 const timeAxisState = reactive({
+  id: '',
   expand: false,
   type: '',
   format: 'YYYY-MM-DD HH:mm',
@@ -134,12 +135,15 @@ const changeSpeed = () => {
   timeAxisState.speed = timeAxisState.speed === 1 ? 2 : 1;
 };
 let activeName = ref('');
+let isDetail = ref(false);
 // 外部数据传入,开始播放
-const initDataToPlay = (obj) => {
+const initDataToPlay = (obj, flag) => {
   activeName.value = obj.name;
+  timeAxisState.id = obj.id;
   timeAxisState.type = obj.type;
   originalData = obj.data;
   timeAxisState.data = obj.data;
+  isDetail.value = !!flag;
   trackPathArr = [];
   timeAxisState.data.forEach((item) => {
     trackPathArr.push(item.lnglat);
@@ -539,13 +543,27 @@ const clearObj = () => {
   }
 };
 
-const clearData = () => {
-  if (activeName.value !== name) return;
+const clearData = (name, flag) => {
+  if ((!flag && activeName.value !== name) || (flag && flag != isDetail.value)) return;
   activeName.value = '';
+  isDetail.value = false;
+  timeAxisState.id = '';
   timeAxisState.playing = false;
   timeAxisState.data = [];
   clearObj();
 };
+// 切换地图,清空
+watch(
+  () => mapStore.isAMap,
+  () => {
+    activeName.value = '';
+    isDetail.value = false;
+    timeAxisState.id = '';
+    timeAxisState.playing = false;
+    timeAxisState.data = [];
+    clearObj();
+  }
+);
 
 onMounted(() => {
   getInitTime();

+ 4 - 4
src/hooks/AMap/useAMap.ts

@@ -143,7 +143,7 @@ export function useAMap(options) {
     }
     addMarker([item], true);
     clickMarker = item;
-    options.onMarkerClick(item);
+    options.onMarkerClick(item, true);
   };
   // 添加多个点
   const addMarker = (points, notClean?: boolean) => {
@@ -324,7 +324,7 @@ export function useAMap(options) {
             }
           }
           clickMarker = e.target;
-          options.onMarkerClick(extData);
+          options.onMarkerClick(extData, true);
         });
         plotLayers['points2'].addOverlay(marker);
         addPoints.push(data);
@@ -411,11 +411,11 @@ export function useAMap(options) {
     infoWindow.on('mouseout', () => map.setStatus({ zoomEnable: true }));
   };
 
-  const hideInfo = (e?: any) => {
+  const hideInfo = (flag?: any) => {
     map.setStatus({ zoomEnable: true });
     if (!!infoWindow) {
       infoWindow.close();
-      if (!!clickMarker && e) {
+      if (!!clickMarker && flag) {
         const extData = clickMarker.getExtData ? clickMarker.getExtData() : clickMarker;
         for (let i = 0; i < addPoints.length; i++) {
           if (addPoints[i].id === extData.id) {

+ 7 - 7
src/types/components.d.ts

@@ -29,13 +29,10 @@ declare module 'vue' {
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     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']
-    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
-    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -46,8 +43,9 @@ declare module 'vue' {
     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']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
+    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']
@@ -58,15 +56,14 @@ declare module 'vue' {
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
-    ElTimeline: typeof import('element-plus/es')['ElTimeline']
-    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
@@ -82,6 +79,9 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
+    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 44 - 20
src/utils/olMap/olMap.ts

@@ -188,7 +188,7 @@ export class olMap {
                 })
               })
             );
-            options.onMarkerClick(extData);
+            options.onMarkerClick(extData, true);
           }
         } else if (extData.type === '3') {
           // 聚合要素
@@ -270,9 +270,7 @@ export class olMap {
         const xmlDoc = parser.parseFromString(res.data, 'text/xml');
         const featureType = xmlDoc.getElementsByTagName('FeatureType')[0];
         const layerParam = {
-          layerName: featureType.getElementsByTagName('Title')[0].textContent,
-          typeName: featureType.getElementsByTagName('Name')[0].textContent,
-          srsName: featureType.getElementsByTagName('SRS')[0].textContent
+          typeName: featureType.getElementsByTagName('Name')[0].textContent
         };
         this.createWfsLayer(options, layerParam);
       }
@@ -308,7 +306,6 @@ export class olMap {
         // 添加自定义 Headers
         const headers = globalHeaders();
         xhr.setRequestHeader('Authorization', headers.Authorization);
-        xhr.setRequestHeader('clientid', headers.clientid);
 
         xhr.responseType = 'arraybuffer'; // 确保支持图片二进制数据
         xhr.onload = function () {
@@ -340,22 +337,45 @@ export class olMap {
   createWfsLayer(options, layerParam) {
     const source = new VectorSource({
       format: new GeoJSON(),
-      url: `${commonUrl}${options.code}?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&typeName=流域:GEO_BAS_POLYGON&outputFormat=application/json& srsName=EPSG:4490`
+      loader: function (extent, resolution, projection) {
+        // 构建带认证头的请求参数
+        const url =
+          `${commonUrl}${options.code}?` +
+          `REQUEST=GetFeature` +
+          `&typeName=${encodeURIComponent(layerParam.typeName)}` +
+          `&outputFormat=application/json`;
+        const headers = globalHeaders();
+        fetch(url, {
+          headers: {
+            'Authorization': headers.Authorization
+          }
+        })
+          .then((response) => {
+            if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
+            return response.json();
+          })
+          .then((json) => {
+            const features = new GeoJSON().readFeatures(json, {
+              dataProjection: layerParam.srsName,
+              featureProjection: projection
+            });
+            this.addFeatures(features);
+          })
+          .catch(error => console.error('WFS加载失败:', error));
+      }
     });
 
     const vectorLayer = new VectorLayer({
       source: source,
       style: new Style({
-        fill: new Fill({
-          color: 'rgba(255, 255, 255, 0.6)'
-        }),
-        stroke: new Stroke({
-          color: '#319FD3',
-          width: 1
-        })
-      })
+        // 必须设置样式才能显示
+        fill: new Fill({ color: 'rgba(0,0,0, 0)' }),
+        stroke: new Stroke({ color: 'rgba(0,0,0, 1)', width: 1 })
+      }),
+      zIndex: options.zIndex ? options.zIndex : -99
     });
-
+    vectorLayer.set('layerName', options.layer);
+    vectorLayer.set('id', options.code);
     this.map.addLayer(vectorLayer);
   }
   // 加载json图层
@@ -376,6 +396,8 @@ export class olMap {
         }),
         zIndex: layer.zIndex ? layer.zIndex : -99
       });
+      jsonLayer.set('layerName', layer.layer);
+      jsonLayer.set('id', layer.code);
       this.map.addLayer(jsonLayer);
       resolve({});
     });
@@ -650,17 +672,19 @@ export class olMap {
     const layers = this.map.getLayers();
     const layerArray = layers.getArray().slice();
     layerArray.forEach((layer) => {
-      // 标注现在都是用同一个暂不移除'annotation'
-      if (!!layer && ['map'].includes(layer.get('layerName'))) {
+      if (!!layer && ['map', 'annotation'].includes(layer.get('layerName'))) {
         layer.getSource().clear();
         layer.dispose();
         this.map.removeLayer(layer);
       }
     });
-
     if (Array.isArray(newLayers)) {
       for (const layer of newLayers) {
-        await this.formatXml(layer);
+        if (layer.layerType === 'JSON') {
+          await this.createJsonLayer(layer);
+        } else {
+          await this.formatXml(layer);
+        }
       }
     } else if (newLayers.id === 'tianditu') {
       await this.formatXml2();
@@ -757,7 +781,7 @@ export class olMap {
     }
     this.addMarker2({ 'search': item });
     this.clickMarker = item;
-    this.options.onMarkerClick(item);
+    this.options.onMarkerClick(item, true);
   }
   addMarker(points) {
     this.clearMarker();

+ 1 - 1
src/utils/request.ts

@@ -149,7 +149,7 @@ service.interceptors.response.use(
       return Promise.reject(new Error(msg));
     } else if (code !== HttpStatus.SUCCESS) {
       ElNotification.error({ title: msg });
-      return Promise.reject('error');
+      return Promise.reject('错误');
     } else {
       return Promise.resolve(res.data);
     }

+ 3 - 3
src/views/globalMap/RightMenu/LayerAnalysis.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="menu-content">
-    <div class="gradient-text title">图层分析</div>
+    <div class="gradient-text common-dialog-title2">图层分析</div>
     <div class="scroll-box">
       <div class="box">
         <div
@@ -16,12 +16,12 @@
       </div>
       <div class="box2">
         <div class="box2-title">各区县分布统计</div>
-        <Chart :option="chartOption1" style="width: 100%; height: 948px" />
+        <Chart :option="chartOption1" style="width: 100%; height: 350px" />
       </div>
       <div class="box2">
         <div class="box2-title">类型统计</div>
         <div class="box2-right">
-          <Chart ref="chartRef" :option="chartOption2" style="width: 500px; height: 100%" />
+          <Chart ref="chartRef" :option="chartOption2" style="width: 250px; height: 100%" />
           <div class="legend-box">
             <div v-for="(item, index) in legendData" :key="index" class="legend-item" @click="handleClickLegend(item)">
               <span class="dot" :style="{ backgroundColor: getColor(item.checked, index) }"></span>{{ item.name }}:{{ item.value }}

+ 16 - 0
src/views/globalMap/data/mapData.ts

@@ -1179,5 +1179,21 @@ export const pointDetailTemplate = {
     safety_production_body: '安全生产责任主体',
     longitude: '经度',
     latitude: '纬度'
+  },
+  '57': {
+    village_name: '村名',
+    county: '县(市、区)',
+    town: '所属镇',
+    longitude: '经度',
+    latitude: '纬度'
+  },
+  '58': {
+    village: '村名',
+    city: '市',
+    county: '县(市、区)',
+    town: '镇(街道)',
+    disaster_type: '易发灾害',
+    longitude: '经度',
+    latitude: '纬度'
   }
 };

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

@@ -9,6 +9,7 @@
         @handle-show-warehouse="handleShowWarehouse"
         @handle-show-people="handleShowPeople"
         @handle-show-track="handleShowTrack"
+        @close-detail-dialog="handleCloseDetailDialog"
         @resize="mapMoveEnd"
       />
       <YztMap
@@ -19,6 +20,7 @@
         @handle-show-warehouse="handleShowWarehouse"
         @handle-show-people="handleShowPeople"
         @handle-show-track="handleShowTrack"
+        @close-detail-dialog="handleCloseDetailDialog"
         @resize="mapMoveEnd"
       />
       <!--左侧菜单-->
@@ -211,7 +213,7 @@ const addMarkersMethod = debounce(
       }
       mapUtils.addMarker2(data);
     });
-    if (!mapStore.pointParams.option.includes('43') && addMarkersTimer) {
+    if (addMarkersTimer) {
       clearInterval(addMarkersTimer);
       addMarkersTimer = null;
     }
@@ -281,6 +283,10 @@ const clickMenu = (item, dataList) => {
   if (['手机工作台', '重点车辆', '移动指挥车', '机动无人机', '卫星电话'].includes(item.name) && !item.checked) {
     timeAxisRef.value.clearData(item.name);
   }
+  if (item.component == '43' && !item.checked && !mapStore.pointParams.option.includes('43') && addMarkersTimer) {
+    clearInterval(addMarkersTimer);
+    addMarkersTimer = null;
+  }
 };
 const handleHideCommunicationSupport = () => {
   communicationSupport.show = false;
@@ -469,17 +475,20 @@ const handleShowTrack = (data) => {
           lnglat: [item.lng, item.lat]
         });
       });
-      initDataToPlay({ type: 'track', data: trajectory });
+      initDataToPlay({ id: data.id, type: 'track', data: trajectory, name: data.title }, true);
     }
   });
 };
 // 传递数据给时间轴
-const initDataToPlay = (data) => {
+const initDataToPlay = (data, isDetail?: boolean) => {
   if (!!timeAxisRef.value) {
-    timeAxisRef.value.initDataToPlay(data);
+    timeAxisRef.value.initDataToPlay(data, isDetail);
   }
 };
-
+// 点位详情弹窗关闭后
+const handleCloseDetailDialog = (data) => {
+  timeAxisRef.value.clearData(data.title, true);
+};
 const mapMoveEnd = () => {
   if (!mapStore.pointParams.dict_value && !mapStore.pointParams.option) return;
   addMarkersMethod();

+ 9 - 1
src/views/system/user/index.vue

@@ -131,7 +131,7 @@
           <div>{{ dialog.title }}</div>
         </div>
         <div class="common-dialog-box">
-          <el-form ref="userFormRef" :model="form" :rules="rules" label-width="80px">
+          <el-form ref="userFormRef" :model="form" :rules="rules" label-width="100px">
             <el-row>
               <el-col :span="12">
                 <el-form-item label="用户昵称:" prop="nickName">
@@ -220,6 +220,13 @@
                 </el-form-item>
               </el-col>
             </el-row>
+            <el-row>
+              <el-col :span="24">
+                <el-form-item label="粤政易账号:">
+                  <el-input v-model="form.yzyAccount" placeholder="请输入内容"></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
             <el-row>
               <el-col :span="24">
                 <el-form-item label="备注:">
@@ -345,6 +352,7 @@ const initFormData: UserForm = {
   phonenumber: undefined,
   email: undefined,
   sex: undefined,
+  yzyAccount: undefined,
   status: '0',
   remark: '',
   postIds: [],