智慧农业后台管理页面
guoshilong
2022-08-30 d0c05096374565228d277e93c56c55d10d93bd1b
地图模式返回,原页面显示当前农场
3 files modified
16 ■■■■■ changed files
src/components/map/plotMap.vue 3 ●●●● patch | view | raw | blame | history
src/views/land/cs.vue 11 ●●●● patch | view | raw | blame | history
src/views/mapPattern/index.vue 2 ●●● patch | view | raw | blame | history
src/components/map/plotMap.vue
@@ -242,7 +242,7 @@
                position += `${item[0]}, ${item[1]};`
            })
            console.log(position, 565656)
            // console.log(position, 565656)
            const polyline = new global.DC.Polyline(position)
            polyline.setStyle({
@@ -323,7 +323,6 @@
                that.drawLandPolyLine(positions)
            })
            console.log(item, 123)
            plotRegionLayer.addOverlay(polygon)
            addPlotLayers.push({ center, name: item.landName, id: item.id })
src/views/land/cs.vue
@@ -143,14 +143,19 @@
    watch: {
        '$farmId': {
            handler (newName, oldName) {
                this.farm.id = newName
                // this.farm.id = newName
                //地块页面
                this.onLoad()
            }
        }
    },
    created () {
        this.farm.id = this.$farmId
        // this.farm.id = this.$farmId
        this.$EventBus.$on('getFarmObj', (farmObj)=>{
            this.$nextTick(() => {
                this.$EventBus.$emit("setFarmId", farmObj.id);
            });
        })
        this.onLoad(this.page)
    },
    methods: {
@@ -204,7 +209,7 @@
            if (typeof (page) == "undefined") {
                page = this.page
            }
            Object.assign(params, { farmId: this.farm.id })
            Object.assign(params, { farmId: this.$farmId })
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = res.data.data
                this.page.total = data.total
src/views/mapPattern/index.vue
@@ -303,6 +303,7 @@
        },
        //返回上一页
        goToBack () {
            this.$EventBus.$emit("getFarmObj", this.farmInfo);
            this.$router.go(-1)
        },
        //获取农场信息
@@ -355,7 +356,6 @@
            }
            if (this.$refs.showCP) {
                console.log(1)
                let isSelf = this.$refs.showCP.contains(e.target)
                if (!isSelf) {
                    this.plotClickNum = 0