智慧农业绘制地图
guoshilong
2022-08-30 4677779d3ea99789e59f7a00e769401852943909
src/views/clickmap.vue
@@ -162,7 +162,7 @@
<script>
import wx from 'weixin-js-sdk'
import clickMap from '@/components/clickMap.vue'
import { getLandIsAreaStatistic, getList, getLandList } from "@/api/index"
import { getLandIsAreaStatistic, getList, getLandList,getFarmDetail } from "@/api/index"
export default {
    name: 'clickmap',
    components: {
@@ -170,7 +170,7 @@
    },
    data () {
        return {
            title: "今天",
            title: "农场",
            zydksb: 'zy',
            choosepz: -1,
            choosedk: -1,
@@ -190,6 +190,7 @@
            landList: [],
            farmPlantList: [],
            landDetails: {},
            farmDetail:{},
            isShowLandDetails: false,
            isShowFooter: true,
            farmId: null,
@@ -198,13 +199,14 @@
    },
    created () {
        this.farmId = this.getQueryString('farmId')
        // 获取有无轮廓地块数量
        this.getLandIsAreaStatistic()
        // 获取农产品列表
        this.getFarmPlantList(this.page)
        //获取地块列表
        this.getLandList(this.pageLand)
        //获取农场信息
        this.getFarmDetail()
    },
    methods: {
        // 获取url信息
@@ -338,6 +340,17 @@
            this.$refs.ClickMap.closePlotDetails()
        },
        //获取农场信息
        getFarmDetail(){
            var params = {
                id:this.farmId
            }
            getFarmDetail(params).then((res)=>{
                this.farmDetail = res.data.data
                this.title = this.farmDetail.farmName
            })
        },
        /**
         * 根据经纬度范围计算中心点位置