| | |
| | | <div class="wraaper-box farming-detail-box"> |
| | | <div class="dd"> |
| | | <div class="da"> |
| | | <div class="land-img" @click="mod()"> |
| | | <div class="land-img" @click="mod(usePolygons)"> |
| | | <img :src="url" class="landimg" /> |
| | | </div> |
| | | <div class="cent"> |
| | |
| | | <div class="edit"> |
| | | <el-button @click="btnGrounpShow = !btnGrounpShow" icon="el-icon-menu"></el-button> |
| | | |
| | | <div v-show="btnGrounpShow" class="btn-grounp"> |
| | | <div v-show="btnGrounpShow" class="btn-grounp" @click="DelLand(delId)"> |
| | | <el-button>删除地块</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | :before-close="dialogBeforeClose" |
| | | > |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | <el-button class="save" type="success">保存</el-button> |
| | | <el-button class="save" type="success" @click="upLand()">保存</el-button> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import farming from "@/views/farm/farmingrecord.vue" |
| | | import recovery from "@/views/recovery/recovery.vue" |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | import {remove, update} from "@/api/land/land" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | url: "", |
| | | dica: "", |
| | | deptname: "", |
| | | landUnit: "", |
| | | delId: "", |
| | | landArea: "", |
| | | usePolygons: "", |
| | | dic: "", |
| | | formC: {}, |
| | | gradeBoxVisible1: false, |
| | |
| | | this.landArea = this.$route.query.landArea |
| | | this.dica = this.$route.query.dica |
| | | this.deptname = this.$route.query.deptname |
| | | this.delId = this.$route.query.id |
| | | this.landUnit = this.$route.query.landUnit |
| | | // this.form = res.data.data; |
| | | let usePolygons = this.$route.query.landRange |
| | | this.usePolygons = this.$route.query.landRange |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(",") |
| | |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | } |
| | | } |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | }, |
| | | methods: { |
| | | mod () { |
| | | this.formC = {} |
| | | mod(usePolygons) { |
| | | this.gradeBoxVisible1 = true |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | }, |
| | | setMapData(val) { |
| | | this.LineData = val[0]; |
| | | this.PointData = val[1]; |
| | | }, |
| | | //删除地块 |
| | | DelLand(delId) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | 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(); |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons; |
| | | let polLength = this.polygons.length - 1; |
| | | let usePolygons = ""; |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | params.userId = this.userInfo.user_id; |
| | | params.landRange = usePolygons; |
| | | params.id = this.delId, |
| | | params.landUnit = this.landUnit |
| | | } |
| | | // update(params).then(() => { |
| | | // that.$refs.form.resetFields(); |
| | | // that.visible = false; |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!" |
| | | // }); |
| | | // done(); |
| | | // }, error => { |
| | | // loading(); |
| | | // window.console.log(error); |
| | | // }); |
| | | } |
| | | }, |
| | | watch: {}, |
| | | } |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .wraaper-box { |
| | | padding: 0 !important; |
| | | position: absolute; |
| | |
| | | margin-left: 340px; |
| | | width: 175px; |
| | | } |
| | | |
| | | .dck { |
| | | width: 151px; |
| | | margin-left: 340px; |