| 
					
				 | 
			
			
				@@ -43,7 +43,7 @@ import { onMounted, ref } from "vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { useStore } from "vuex"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { unByKey } from "ol/Observable"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { deepClone } from "@/common/commonFun"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { Search } from '@element-plus/icons-vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Search } from "@element-plus/icons-vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const store = useStore(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const areaRef = ref(null); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,7 +57,7 @@ let listenKey = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 let regionLayer = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 let clusterSource = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-const currentFarmId = store.getters.userinfo.curFarmId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const currentFarmId = store.getters.userinfo.curFarmId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // const currentFarmId = sessionStorage.getItem('userinfo').curFarmId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 样式缓存优化 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -70,27 +70,44 @@ const styleCache = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default1: (zoomLevel) => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            radius: zoomLevel > 19 ? 10 : 6, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            fill: new Fill({ color: "#ffffff00" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     selected: new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         image: new Icon({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             src: require("@/assets/images/map/status/active-icon.png"), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             scale: 0.6, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            crossOrigin: 'anonymous' // 添加crossOrigin属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            crossOrigin: "anonymous", // 添加crossOrigin属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     current: new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         image: new Icon({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             src: require("@/assets/images/map/status/current-icon.png"), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             scale: 0.8, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            crossOrigin: 'anonymous' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            crossOrigin: "anonymous", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    renYang1: new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            radius: 12, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            fill: new Fill({ color: "#EEEEEE" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    renYang1: () => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                radius: 12, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fill: new Fill({ color: "#EEEEEE" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    renYang11: (zoomLevel) => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                radius: zoomLevel > 19 ? 10 : 6, // 层级大于19时半径为10,小于等于19时为6 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fill: new Fill({ color: "#EEEEEE" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     renYang2: new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             radius: 12, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -98,14 +115,15 @@ const styleCache = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             stroke: new Stroke({ color: "#fff", width: 1 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    clusterText: (size, isRenyang) => new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        text: new Text({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            text: size.toString(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            font: "bold 10px sans-serif", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            fill: new Fill({ color: isRenyang === 1 ? "#000" : "#fff" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    clusterText: (size, isRenyang) => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            text: new Text({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                text: size.toString(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                font: "bold 10px sans-serif", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                fill: new Fill({ color: isRenyang === 1 ? "#000" : "#fff" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            zIndex: 3, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        zIndex: 3, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     photoStyle: (src) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return new Style({ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -118,10 +136,10 @@ const styleCache = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     displacement: [0, 0], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     stroke: new Stroke({ width: 2, color: "#fff" }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                zIndex: 4 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                zIndex: 4, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            console.warn('Failed to create photo style:', e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.warn("Failed to create photo style:", e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return new Style({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 image: new Circle({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     radius: 12, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -130,7 +148,7 @@ const styleCache = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 初始化地图 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -139,14 +157,21 @@ onMounted(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const coordinate = util.wktCastGeom(store.getters.userinfo.location).getFirstCoordinate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     kmap = new KMap.Map(areaRef.value, level, coordinate[0], coordinate[1], null, 1, 22, "img", true, true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     regionLayer = new RegionLayer(kmap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 添加地图层级变化监听 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    kmap.getView().on("change:resolution", () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (treeClusterLayer) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            refreshClusterStyle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 启用框选 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const enableBoxSelect = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const data = mapPoint.value.filter(item => !item.isRenyang); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const data = mapPoint.value.filter((item) => !item.isRenyang); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     updateClusterData(data, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     isDrawing.value = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     dragBox = new DragBox({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         condition: platformModifierKeyOnly, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -160,14 +185,14 @@ const enableBoxSelect = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 启用框选--分配果树 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const enableDistributeBoxSelect = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const data = mapPoint.value.filter(item => item.isRenyang === 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const treeData = deepClone(data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    treeData.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        item.isTreePoint = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const data = mapPoint.value.filter((item) => item.isRenyang === 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const treeData = deepClone(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    treeData.map((item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        item.isTreePoint = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     updateClusterData(treeData, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     isDrawing.value = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     dragBox = new DragBox({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         condition: platformModifierKeyOnly, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -193,15 +218,19 @@ const handleKeyUp = (e) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const handleBoxEnd = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const extent = dragBox.getGeometry().getExtent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    treeClusterLayer.layer.getSource().getSource().getFeatures().forEach(feature => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 只对当前框选范围内且未被认养的树进行操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (feature.getGeometry().intersectsExtent(extent)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 累加选中状态(不会取消之前选中的) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            feature.set("highlight", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // if (!feature.get("isRenyang")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    treeClusterLayer.layer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getFeatures() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .forEach((feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 只对当前框选范围内且未被认养的树进行操作 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (feature.getGeometry().intersectsExtent(extent)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 累加选中状态(不会取消之前选中的) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                feature.set("highlight", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // if (!feature.get("isRenyang")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     refreshClusterStyle(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -217,19 +246,24 @@ const stopBoxSelect = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 保存选择 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const saveSelect = (callback) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const sampleIds = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    treeClusterLayer.layer.getSource().getSource().getFeatures().forEach(feature => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (feature.get("highlight")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            sampleIds.push(feature.get("sampleId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    treeClusterLayer.layer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .getFeatures() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .forEach((feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (feature.get("highlight")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sampleIds.push(feature.get("sampleId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const params = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sampleIds, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         isRenyang: 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        farmId: currentFarmId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        farmId: currentFarmId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    VE_API.manage_interface.batchOpenOrCloseSample(params).then(() => {// 保存成功后刷新数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    VE_API.manage_interface.batchOpenOrCloseSample(params).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 保存成功后刷新数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         callback?.(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -237,21 +271,23 @@ const saveSelect = (callback) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 更新集群数据而不重新渲染整个图层 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const updateClusterData = (treeListData, distanceVal = 20) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!treeListData || !Array.isArray(treeListData)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        console.error('Invalid data provided to updateClusterData'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.error("Invalid data provided to updateClusterData"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (distanceVal === 20) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         mapPoint.value = treeListData; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const features = treeListData.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            item.wkt = item.geom; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return newPoint(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            console.error('Error creating point:', err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }).filter(Boolean); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const features = treeListData 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .map((item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                item.wkt = item.geom; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return newPoint(item); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                console.error("Error creating point:", err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .filter(Boolean); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!treeClusterLayer) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         createClusterLayer(features, distanceVal); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -260,7 +296,7 @@ const updateClusterData = (treeListData, distanceVal = 20) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         clusterSource.getSource().clear(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         clusterSource.getSource().addFeatures(features); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         clusterSource.setDistance(distanceVal); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!distanceVal) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             zoomToFeatures(features); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -275,7 +311,7 @@ const createClusterLayer = (features, distance) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     treeClusterLayer = new KMap.VectorLayer("forest-cluster", 1000, { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         minZoom: 15, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         source: clusterSource, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        style: clusterStyleFunction 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        style: clusterStyleFunction, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     kmap.addLayer(treeClusterLayer.layer); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -290,7 +326,7 @@ const createClusterLayer = (features, distance) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const clusterStyleFunction = (feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const size = feature.get("features").length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const features = feature.get("features"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!features || features.length === 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return new Style({}); // 返回空样式作为fallback 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -298,7 +334,7 @@ const clusterStyleFunction = (feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (size === 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return getSingleFeatureStyle(features[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return getClusterFeatureStyle(features[0], size); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -306,51 +342,62 @@ const clusterStyleFunction = (feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const getSingleFeatureStyle = (feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!feature) return new Style({}); // 防御性编程 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 获取当前地图层级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const zoomLevel = kmap.getView().getZoom(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 有图标的使用照片样式优先 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const imgIcon = feature.get('icon'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const isTreePoint = feature.get('isTreePoint'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const imgIcon = feature.get("icon"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const isTreePoint = feature.get("isTreePoint"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (imgIcon && !isTreePoint) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return styleCache.photoStyle(imgIcon); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            console.warn('Failed to create photo style:', e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.warn("Failed to create photo style:", e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return styleCache.default; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 高亮样式其次 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (feature.get("highlight")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return styleCache.selected; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 当前树样式其次 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (feature.get("currentTree")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return styleCache.current; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 根据认养状态返回不同样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const isRenyang = feature.get("isRenyang"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     switch (isRenyang) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        case 1: return styleCache.renYang1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        case 2: return styleCache.renYang2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: return styleCache.default; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        case 1: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (isDrawing.value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return styleCache.renYang11(zoomLevel); // 传入当前层级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return styleCache.renYang1(); // 传入当前层级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        case 2: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return styleCache.renYang2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        default: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (isDrawing.value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return styleCache.default1(zoomLevel); // 传入当前层级 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return styleCache.default 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 更新后的获取集群要素样式函数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const getClusterFeatureStyle = (feature, size) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!feature) return [styleCache.default]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const styles = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const baseStyle = getSingleFeatureStyle(feature); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 确保基础样式有效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (baseStyle) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         styles.push(baseStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 添加集群文字样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (size > 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const textStyle = styleCache.clusterText(size, feature.get("isRenyang")); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -358,7 +405,7 @@ const getClusterFeatureStyle = (feature, size) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             styles.push(textStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return styles.length > 0 ? styles : [styleCache.default]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -369,11 +416,15 @@ const refreshClusterStyle = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (isDrawing.value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         const sampleIds = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        treeClusterLayer.layer.getSource().getSource().getFeatures().forEach(feature => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (feature.get("highlight")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sampleIds.push(feature.get("sampleId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        treeClusterLayer.layer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .getSource() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .getFeatures() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .forEach((feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (feature.get("highlight")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sampleIds.push(feature.get("sampleId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 数据处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         emit("update:selectedTree", sampleIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -384,10 +435,10 @@ const setupMapClickHandler = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (listenKey) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         unByKey(listenKey); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     listenKey = kmap.on("click", (e) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!treeClusterLayer) return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         treeClusterLayer.layer.getFeatures(e.pixel).then((clickedFeatures) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!clickedFeatures.length) return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -403,12 +454,12 @@ const setupMapClickHandler = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 处理集群点击 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const handleClusterClick = (features) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const extent = boundingExtent(features.map(r => r.getGeometry().getCoordinates())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const extent = boundingExtent(features.map((r) => r.getGeometry().getCoordinates())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     kmap.getView().fit(extent, { duration: 1000, padding: [250, 250, 250, 250] }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     const currentZoom = kmap.getView().getZoom(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (currentZoom > 17) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        kmap.getView().setZoom(17); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (currentZoom > 20) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        kmap.getView().setZoom(20); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -421,11 +472,11 @@ const handleSingleFeatureClick = (feature) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         resetCurrentTree(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         feature.set("currentTree", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         currentTree.value = feature; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        eventBus.emit("click:point", {  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            farmId: currentFarmId,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            sampleId: feature.get("sampleId"),  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            data: feature.getProperties()  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        eventBus.emit("click:point", { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            farmId: currentFarmId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            sampleId: feature.get("sampleId"), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            data: feature.getProperties(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -442,7 +493,7 @@ const clearCluster = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 缩放到要素范围 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const zoomToFeatures = (features) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const extent = boundingExtent(features.map(r => r.getGeometry().getCoordinates())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const extent = boundingExtent(features.map((r) => r.getGeometry().getCoordinates())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     kmap.getView().fit(extent, { duration: 500, padding: [80, 250, 100, 250] }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -456,58 +507,51 @@ const resetCurrentTree = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 搜索 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 搜索相关代码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-const searchWord = ref('') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-const searchResults = ref([]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const searchWord = ref(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const searchResults = ref([]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 搜索方法 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const querySearch = (queryString, cb) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (!queryString || !mapPoint.value?.length) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        cb([]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cb([]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const results = mapPoint.value.filter(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        const searchFields = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            item.tel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            item.userNickName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            item.makeTel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            item.makeName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ].filter(Boolean).map(f => f.toString().toLowerCase()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return searchFields.some(field =>  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            field.includes(queryString.toLowerCase()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        console.log('results', results, mapPoint.value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const results = mapPoint.value.filter((item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const searchFields = [item.tel, item.userNickName, item.makeTel, item.makeName] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .filter(Boolean) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            .map((f) => f.toString().toLowerCase()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return searchFields.some((field) => field.includes(queryString.toLowerCase())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 格式化结果供el-autocomplete使用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    const formattedResults = results.map(item => ({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const formattedResults = results.map((item) => ({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ...item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        value: item.userNickName || item.makeName || '未命名点位' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    })) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    cb(formattedResults) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        value: item.userNickName || item.makeName || "未命名点位", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    })); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    cb(formattedResults); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 选中搜索结果项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const handleSelect = (item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (!item || !item.geom) return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (!item || !item.geom) return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 定位到选中的点位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        const coordinate = util.wktCastGeom(item.geom).getFirstCoordinate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        const coordinate = util.wktCastGeom(item.geom).getFirstCoordinate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         kmap.getView().animate({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             center: coordinate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             zoom: 22, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            duration: 500 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            duration: 500, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 高亮显示选中的点位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // if (treeClusterLayer) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //     treeClusterLayer.layer.getSource().getSource().getFeatures().forEach(feature => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //         if (feature.get('sampleId') === item.sampleId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //             feature.set('highlight', true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //             refreshClusterStyle() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //             // 3秒后取消高亮 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //             setTimeout(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //                 feature.set('highlight', false) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -518,32 +562,31 @@ const handleSelect = (item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         setTimeout(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            eventBus.emit("click:point", {  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                farmId: currentFarmId,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                sampleId: item.sampleId,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data: item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            eventBus.emit("click:point", { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                farmId: currentFarmId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sampleId: item.sampleId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                data: item, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }, 1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 1000); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } catch (e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        console.error('定位失败:', e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.error("定位失败:", e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // 初始化区域地图 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const initAreaMap = (arr) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     regionLayer?.initData(arr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-defineExpose({  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    addCluster: updateClusterData,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+defineExpose({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    addCluster: updateClusterData, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     enableBoxSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     enableDistributeBoxSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    stopBoxSelect,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    initAreaMap,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    resetCurrentTree,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    stopBoxSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    initAreaMap, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    resetCurrentTree, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     saveSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    refreshClusterStyle // 暴露刷新方法 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    refreshClusterStyle, // 暴露刷新方法 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const emit = defineEmits(["update:selectedTree"]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -572,14 +615,13 @@ const emit = defineEmits(["update:selectedTree"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     right: 410px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     z-index: 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     width: 300px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ::v-deep { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         .el-input__wrapper { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             background: rgba(255, 255, 255, 0.8); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.88) inset; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </style> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -588,15 +630,15 @@ const emit = defineEmits(["update:selectedTree"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     display: flex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     align-items: center; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     padding: 5px 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .name { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         font-weight: bold; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         padding: 0 8px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     .tel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         color: #888; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         font-size: 12px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-</style> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</style> 
			 |