智慧农业后台管理页面
guoshilong
2022-10-26 c518ffa02013402da032a18941f96ec2dcab9c8b
src/views/mapPattern/index.vue
@@ -202,6 +202,14 @@
        ...mapGetters(["userInfo", "$farmId"]),
    },
    created () {
        if (this.$farmId == 0){
          if (sessionStorage.getItem("myFarmId")){
            this.$store.commit("SET_FARMID",JSON.parse(sessionStorage.getItem("myFarmId")))
          }
        }
        window.addEventListener('beforeunload', () => {
          sessionStorage.setItem('myFarmId', JSON.stringify(this.$farmId))
        })
        //获取种样品列表
        this.getFarmPlantList(this.page)
        //获取地块列表
@@ -290,7 +298,6 @@
                        arr.forEach(it => {
                            brr.push(it.split(' '))
                        })
                        this.$refs.plotMap.addPlotPolygon(brr, item)
                    }
                })
@@ -303,6 +310,7 @@
        },
        //返回上一页
        goToBack () {
            this.$EventBus.$emit("getFarmObj", this.farmInfo);
            this.$router.go(-1)
        },
        //获取农场信息
@@ -321,7 +329,6 @@
        //获取地块轮廓统计信息
        getLandIsAreaStatistic () {
            getLandIsAreaStatistic(this.$farmId).then(res => {
                console.log(res)
                this.landIsAreaStatistic = res.data.data
            })
        },
@@ -355,7 +362,6 @@
            }
            if (this.$refs.showCP) {
                console.log(1)
                let isSelf = this.$refs.showCP.contains(e.target)
                if (!isSelf) {
                    this.plotClickNum = 0