Browse Source

修复点击后出现多个打点图标后无法取消

Hwf 1 month ago
parent
commit
80b8825bc8

+ 2 - 0
src/store/modules/map.ts

@@ -178,6 +178,8 @@ export const useMapStore = defineStore('map', () => {
       activeIndex: 0,
       menuData: []
     };
+    pointType.value = [];
+    setPointOption();
   };
   const setUpdateAddress = (data) => {
     updateAddress.value = data;

+ 0 - 3
src/types/components.d.ts

@@ -25,14 +25,11 @@ declare module 'vue' {
     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']
     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']
     ElText: typeof import('element-plus/es')['ElText']
     ElTimeline: typeof import('element-plus/es')['ElTimeline']

+ 0 - 2
src/views/globalMap/LeftMenu.vue

@@ -265,8 +265,6 @@ const handleShowDialog = (row) => {
 // 取消所有勾选
 const handleCancelAllChecked = () => {
   mapStore.handleCancelAllChecked();
-  // 清空所有打点
-  mapUtils.clearMarker('point');
 };
 defineExpose({ setMenuChange, setMenuIndex });
 </script>

+ 4 - 0
src/views/globalMap/index.vue

@@ -185,6 +185,10 @@ const addMarkersMethod = debounce(
       queryParams.latitude_min = lnglat2[1];
     }
     getPointInfo2(queryParams).then((res) => {
+      // 如果接口返回前,取消所有选择,不赋值
+      if (!mapStore.pointParams.option && !mapStore.pointParams.dict_value.toString()) {
+        return;
+      }
       const data = res.data ? res.data : [];
       // 通用详情
       if (!!detailsData.value.id) {