智慧农业后台管理页面
guoshilong
2022-11-08 082613d446e29e4ec1c16bfaa52345106a498b23
src/views/land/getMapDataInThere.vue
@@ -18,6 +18,13 @@
import MapInThere from "@/components/map/mainInThere.vue"
export default {
    name: "getMapData",
    props: {
        currentPolygons: {
            type: Array,
            // eslint-disable-next-line vue/require-valid-default-prop
            default: []
        }
    },
    components: {
        MapInThere,
    },
@@ -38,6 +45,16 @@
                this.isCheck = false
            }
        },
        currentPolygons: {
            immediate: true,
            handler (newData, oldData) {
                // console.log(newData, 5656)
                if (newData.length > 0) {
                    this.draw(newData)
                }
            },
        }
    },
    data () {
        return {
@@ -47,9 +64,10 @@
            animateEnter: "animated fadeIn",
            animateLeave: "animated fadeOut",
            //未输入动画效果
            animateName: "custom-classes-transition",
            animateEnter: "animated fadeInDown",
            animateLeave: "animated fadeOut",
            openTitle: "路径1",
            MapDataShow: false,
            fromView: false,
@@ -63,8 +81,22 @@
    },
    methods: {
        draw (usePolygons) {
            this.$store.commit("setpolygon", usePolygons) //用vuex传最终数据
            this.doThat(usePolygons)
            console.log(usePolygons, 456)
            let arr = []
            usePolygons.forEach(item => {
                arr.push({
                    lng: item.split(' ')[0],
                    lat: item.split(' ')[1]
                })
            })
            console.log(arr, 23)
            this.$store.commit("setpolygon", arr) //用vuex传最终数据
            this.doThat(arr)
        },
        doThat (val) {
            this.checkDom("getMapDataRefs", (dom) => {
@@ -319,7 +351,8 @@
.list-leave {
    opacity: 1;
}
​ .list-enter-active,
.list-enter-active,
.list-leave-active {
    transition: all 0.3s;
}