gemercheung пре 1 година
родитељ
комит
9fb876586d
2 измењених фајлова са 29 додато и 24 уклоњено
  1. 18 19
      src/views/map/index.vue
  2. 11 5
      src/views/scenes/list.vue

+ 18 - 19
src/views/map/index.vue

@@ -21,11 +21,10 @@
     }"
     :fullscreenControl="false"
     style="width: 100vw; height: 100vh"
-    @click="handleMapClick"
     v-loading="loadingRef"
     :loading-tip="t('common.loadingText')"
   >
-    <MarkerCluster>
+    <MarkerCluster v-if="locations.length > 0">
       <template v-for="(location, i) in locations" :key="i">
         <CustomMarker
           v-if="location.isPro"
@@ -230,8 +229,8 @@
       if (ready && lo.value.length > 0) {
         // debugger;
         try {
-          console.error('没开- mapFitBounds');
-          // mapFitBounds(mapRef, locations.value);
+          // console.error('没开- mapFitBounds');
+          mapFitBounds(mapRef, locations.value);
         } catch (error) {}
       }
     },
@@ -275,22 +274,22 @@
     location.reload();
   }
 
-  // function mapFitBounds(mapRef, markers) {
-  //   let bounds;
-  //   const api = mapRef.value.api;
-  //   const map = mapRef.value.map;
+  function mapFitBounds(mapRef, markers) {
+    let bounds;
+    const api = mapRef.value.api;
+    const map = mapRef.value.map;
 
-  //   bounds = new api.LatLngBounds();
-  //   for (let i = 0; i < markers.length; i++) {
-  //     bounds.extend(markers[i]);
-  //   }
-  //   map.fitBounds(bounds);
-  //   map.panToBounds(bounds);
-  // }
-  const handleMapClick = (event) => {
-    const { lat, lng } = event.latLng;
-    console.log('event', `{ lat: ${lat()}, lng: ${lng()}}`);
-  };
+    bounds = new api.LatLngBounds();
+    for (let i = 0; i < markers.length; i++) {
+      bounds.extend(markers[i]);
+    }
+    map.fitBounds(bounds);
+    map.panToBounds(bounds);
+  }
+  // const handleMapClick = (event) => {
+  //   const { lat, lng } = event.latLng;
+  //   console.log('event', `{ lat: ${lat()}, lng: ${lng()}}`);
+  // };
 
   const handleMarkerClick = (data) => {
     // const { lat, lng } = event.latLng;

+ 11 - 5
src/views/scenes/list.vue

@@ -130,11 +130,8 @@
               {
                 tooltip: t('routes.scenes.downloadSceneE57'),
                 disabled: record.status != -2,
-                ifShow: () => {
-                  return (
-                    (tableType === 2 || tableType === 5) && record.location === 4 && !record.isCopy
-                  );
-                },
+                ifShow:
+                  (tableType === 2 || tableType === 5) && record.location === 4 && !record.isCopy,
                 icon: 'gis:layer-download',
                 popConfirm: {
                   placement: 'left',
@@ -250,6 +247,15 @@
           defaultHidden: true,
         },
         {
+          title: 'isCopy(测试)',
+          dataIndex: 'isCopy',
+          ellipsis: false,
+          width: 80,
+          customRender: ({ record }) => {
+            return String(record.isCopy);
+          },
+        },
+        {
           title: t('routes.scenes.sceneName'),
           dataIndex: 'sceneName',
           ellipsis: false,