Jelajahi Sumber

页面调整

shuhao 2 minggu lalu
induk
melakukan
9ae476cfc0

+ 9 - 5
src/components/fnHeader.vue

@@ -105,13 +105,17 @@ const getGardenList = () => {
         show3dFarm: true,
         location: "113.746646,22.970229",
     };
-    VE_API.home.userGarden(params).then((res) => {
+    if(userInfo.phone === "游客"){
+      options.value = [{name: "从化井岗基地",organId:90263, wkt: "POINT(113.5081595 23.5320866)"}]
+    }else{
+      VE_API.home.userGarden(params).then((res) => {
         options.value = res.data;
         options.value.push({name: "从化凤二基地",organId:90264, wkt: "POINT(113.67884027228604 23.511176408307904)"},
-        {name: "从化井岗基地",organId:90263, wkt: "POINT(113.5081595 23.5320866)"},
-        {name: "创业果园",organId:26196, wkt: "POINT(110.4909544 21.4152538)"},
-    );
-    });
+            {name: "从化井岗基地",organId:90263, wkt: "POINT(113.5081595 23.5320866)"},
+            {name: "创业果园",organId:26196, wkt: "POINT(110.4909544 21.4152538)"},
+        );
+      });
+    }
 };
 
 const time = ref("");

+ 1 - 1
src/views/Login.vue

@@ -90,7 +90,7 @@ const store = useStore();
 const router = useRouter();
 const form = reactive({
   "code": "",
-  "phone": "13797066447"
+  "phone": "游客"
 });
 const { phone, code } = toRefs(form);
 const ref_form = ref(null);

+ 7 - 9
src/views/addFarm/farmMap.js

@@ -29,14 +29,8 @@ class FarmMap {
         let vectorStyle = new KMap.VectorStyle();
         this.vectorStyle = vectorStyle;
 
-        this.clusterSource = new Cluster({
-            distance: 15,
-            minDistance: 60,
-        });
-
         this.treeClusterLayer = new KMap.VectorLayer("tree-cluster", 999, {
             minZoom: 15,
-            source: this.clusterSource,
             style: (f) => this.getStyle(f)
         })
 
@@ -108,10 +102,14 @@ class FarmMap {
             if (this.treeClusterLayer &&  this.treeClusterLayer.layer.getSource()) {
                 // this.treeClusterLayer.layer.getSource().getSource().clear()
             }
-            const source = new VectorSource({
-                features: features,
+            that.clusterSource = new Cluster({
+                distance: 15,
+                minDistance: 60,
+                source: new VectorSource({
+                    features: features,
+                }),
             });
-            that.clusterSource.setSource(source)
+            that.treeClusterLayer.layer.setSource(that.clusterSource)
         })
     }
     //多点的过滤方法

+ 1 - 1
src/views/workDetail/index.vue

@@ -196,7 +196,7 @@ const goBack = () => {
                                 border-radius: 11px;
                             }
                         }
-                        
+
                     }
                     .box-item + .box-item {
                         margin-top: 12px;