shuhao před 5 měsíci
rodič
revize
243e54b417

+ 1 - 1
src/utils/ol-map/Map.js

@@ -164,7 +164,7 @@ class Map {
 	initDraw(callback){
 		const vm = this
 		this.draw = new Draw({
-			type: 'MultiPolygon',
+			type: 'Polygon',
 			source: this.polygonLayer.source,
 			free: true,
 			style: vm.drawStyleFunc

+ 12 - 12
src/views/authentic/authenticMap.js

@@ -118,19 +118,19 @@ class AuthenticMap {
         mapData.isEditArea = true;
       }
     }, function(e){
-        let f = null
-        that.kmap.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
+      let f = null
+      that.kmap.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
           f= feature
-        },{hitTolerance:10});
-        if(!f){
-          return false
-        }
-        console.log(f)
-        let res = f.get("id") === mapData.curPointData.id || !f.get("id")
-        if(!res){
-          ElMessage.warning("编辑中")
-        }
-        return res
+      },{hitTolerance:10});
+      if(!f){
+        return false
+      }
+      console.log(f)
+      let res = f.get("id") === mapData.curPointData.id || !f.get("id")
+      if(!res){
+        ElMessage.warning("编辑中")
+      }
+      return res
     });
     this.kmap.addLayer(this.clickPointLayer.layer);
     this.kmap.addLayer(this.locationLayer.layer);

+ 4 - 2
src/views/authentic/index.vue

@@ -646,8 +646,10 @@ watch(
   () => mapData.selectPointArr,
   (newVale, oldValue) => {
     if (mapData.selectPointArr.length === 1) {
-      const id = mapData.selectPointArr.map((item) => item.values_.id);
-      getDetailsData(id[0]);
+      const obj = mapData.selectPointArr[0];
+      const id = obj.values_.id
+      getDetailsData(id);
+      mapData.curPointData = obj.values_
     } else {
       if (isRefresh.value) {
         isEdit.value = false;