| | |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(",") |
| | | for (let k in usePolygons) { |
| | | usePolygons[k] = { |
| | | lng: +usePolygons[k].split(" ")[0], |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | mod(usePolygons) { |
| | |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | }, |
| | | setMapData(val) { |
| | | this.LineData = val[0]; |
| | | this.PointData = val[1]; |
| | | this.LineData = val[0] |
| | | this.PointData = val[1] |
| | | }, |
| | | //删除地块 |
| | | DelLand(delId) { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(delId); |
| | | return remove(delId) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | this.$router.push({ |
| | | path: `/land/cs`, |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | //修改地块 |
| | | upLand() { |
| | | var params = {} |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons; |
| | | let polLength = this.polygons.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygons |
| | | let polLength = this.polygons.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | params.userId = this.userInfo.user_id; |
| | | params.landRange = usePolygons; |
| | | params.userId = this.userInfo.user_id |
| | | params.landRange = usePolygons |
| | | params.id = this.delId, |
| | | params.landUnit = this.landUnit |
| | | } |
| | |
| | | }, |
| | | methods: { |
| | | draw (usePolygons) { |
| | | this.$store.commit("setpolygon", usePolygons) //用vuex传最终数据 |
| | | this.doThat(usePolygons) |
| | | |
| | | 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) => { |