From 2c8f7d06ec1694667e0d03a76b36eceed5f3bdbb Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Tue, 02 Aug 2022 08:33:06 +0800
Subject: [PATCH] 地块编辑
---
src/views/land/getMapDataInThere.vue | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/views/land/getMapDataInThere.vue b/src/views/land/getMapDataInThere.vue
index e3950e0..781985e 100644
--- a/src/views/land/getMapDataInThere.vue
+++ b/src/views/land/getMapDataInThere.vue
@@ -18,6 +18,12 @@
import MapInThere from "@/components/map/mainInThere.vue"
export default {
name: "getMapData",
+ props: {
+ currentPolygons: {
+ type: Array,
+ default: []
+ }
+ },
components: {
MapInThere,
},
@@ -38,6 +44,16 @@
this.isCheck = false
}
},
+ currentPolygons: {
+ immediate: true,
+ handler (newData, oldData) {
+ console.log(newData, 5656)
+ if (newData.length > 0) {
+
+ this.draw(newData)
+ }
+ },
+ }
},
data () {
return {
@@ -63,8 +79,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) => {
--
Gitblit v1.9.3