智慧农业后台管理页面
guoshilong
2022-08-30 28b46fff30b86983ba1986ae3161d68bf4c00d2e
首页地图模式按钮
1 files modified
24 ■■■■■ changed files
src/views/wel/index.vue 24 ●●●●● patch | view | raw | blame | history
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>