| | |
| | | |
| | | import { getList, add, update, remove, getDetails } from "@/api/farm/farm" |
| | | import { mapGetters } from "vuex" |
| | | import AvueMap from 'avue-plugin-map' |
| | | Vue.use(AvueMap); |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | }, |
| | | { |
| | | label: "农场地址", |
| | | prop: "farmAddress", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入农场地址", |
| | | trigger: "blur" |
| | | }], |
| | | prop: "avueMapAddress", |
| | | type: "map", |
| | | component: 'avueMap', |
| | | value: { |
| | | "formattedAddress": "", |
| | | "longitude": 0, |
| | | "latitude": 0 |
| | | }, |
| | | // formslot: true, |
| | | labelWidth: 145, |
| | | hide: true, |
| | | overHidden: true, |
| | | }, |
| | | { |
| | |
| | | required: true, |
| | | message: "请输入农场面积", |
| | | trigger: "blur" |
| | | }], |
| | | }] |
| | | }, |
| | | { |
| | | label: "经度", |
| | | prop: "longitude", |
| | | disabled: true, |
| | | hide: true, |
| | | labelWidth: 145 |
| | | }, |
| | | { |
| | | label: "纬度", |
| | | prop: "latitude", |
| | | disabled: true, |
| | | hide: true, |
| | | labelWidth: 145 |
| | | }, |
| | | { |
| | | label: "口号", |
| | |
| | | }, |
| | | created () { |
| | | // this.getRailLazyTree(); |
| | | }, |
| | | watch: { |
| | | //latitude longitude formattedAddress |
| | | "form.avueMapAddress":{ |
| | | handler (newObj, oldObj) { |
| | | console.log(newObj,111) |
| | | if (newObj) { |
| | | this.form.farmAddress = newObj.formattedAddress |
| | | this.form.latitude = newObj.latitude |
| | | this.form.longitude = newObj.longitude |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission", "polygonsFarm"]), |
| | |
| | | getDetails(this.form.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.form = res.data.data |
| | | console.log(this.form,22222) |
| | | this.form.avueMapAddress = { |
| | | "formattedAddress": this.form.farmAddress, |
| | | "longitude": this.form.longitude, |
| | | "latitude": this.form.latitude |
| | | } |
| | | let usePolygons = this.form.position |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |