From 28b46fff30b86983ba1986ae3161d68bf4c00d2e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 30 Aug 2022 10:54:36 +0800
Subject: [PATCH] 首页地图模式按钮

---
 src/views/wel/index.vue |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 1a7e925..f197888 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -53,8 +53,8 @@
                             </div>
                         </div>
                     </div>
-                    <div class="map-view">
-                        <img src="../../../public/img/map.png" />
+                    <div class="map-view" @click="goToMapModel">
+                        <img src="../../../public/img/map.png"  />
                         <div class="title">农场地图→</div>
                     </div>
                 </div>
@@ -254,6 +254,18 @@
         ...mapGetters(["userInfo","$farmId"]),
     },
   created () {
+                
+        this.$EventBus.$on('getFarmObj', (farmObj)=>{
+            this.$nextTick(() => {
+                console.log(farmObj.id,444444)
+                this.$EventBus.$emit("setFarmId", farmObj.id);
+            });
+            // setTimeout(() => {
+            //     this.$EventBus.$emit("setFarmId", farmObj.id);
+            // }, 2000);
+        })
+
+
         //初始化农场信息
         // let farmId = this.userInfo.$farmId
         this.farm.id = this.$farmId
@@ -267,6 +279,7 @@
         //本年农事操作记录,分组
         this.getFarmingStatis()
         this.StockCount()
+
     },
   watch: {
     '$farmId':{
@@ -511,6 +524,13 @@
                 query: data,
             })
         },
+        //进入地图模式
+        goToMapModel () {
+            this.$router.push({
+                path: `/mapPattern`,
+                // query: row,
+            })
+        }
     },
 };
 </script>

--
Gitblit v1.9.3