| | |
| | | @setMapData="setMapData" |
| | | ></getMapDataInThere> |
| | | </template> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | icon="el-icon-circle-plus-outline" |
| | | type="text" |
| | | size="mini" |
| | | @click="start(row)" |
| | | :size="size" |
| | | >农事记录 |
| | | </el-button |
| | | > |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | |
| | | } |
| | | done(); |
| | | }, |
| | | //农事操作 |
| | | start(row) { |
| | | this.$router.push({ |
| | | path: `/framing`, |
| | | query: row |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | |
| | | }); |
| | | } |
| | | } |
| | | // methods: { |
| | | // sizeChange(val) { |
| | | // this.page1.currentPage = 1; |
| | | // this.page1.pageSize = val; |
| | | // this.onLoad(this.page, this.query); |
| | | // }, |
| | | // currentChange(val) { |
| | | // this.page1.currentPage = val; |
| | | // // this.getData(); |
| | | // this.onLoad(this.page, this.query); |
| | | // }, |
| | | // rowSave(row, done, loading) { |
| | | // 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 += ";"; |
| | | // } |
| | | // } |
| | | // //设置坐标点 |
| | | // row.userId=this.userInfo.user_id; |
| | | // row.landRange = usePolygons; |
| | | // } |
| | | // // return; |
| | | // add(row).then(res => { |
| | | // if (res.data.success) { |
| | | // this.$message({ |
| | | // message: "操作成功", |
| | | // type: "success" |
| | | // }); |
| | | // this.refreshChange(); |
| | | // done(); |
| | | // } else { |
| | | // this.$message({ |
| | | // message: "操作失败", |
| | | // type: "warning" |
| | | // }); |
| | | // done(); |
| | | // } |
| | | // }); |
| | | // }, |
| | | // searchChange(params, done) { |
| | | // this.query = params; |
| | | // this.page.currentPage = 1; |
| | | // this.onLoad(this.page, params); |
| | | // done(); |
| | | // }, |
| | | // beforeOpen(done, type) { |
| | | // if (["edit", "view"].includes(type)) { |
| | | // getDetail(this.form.id).then(res => { |
| | | // this.form = res.data.data; |
| | | // }); |
| | | // } |
| | | // if (type == "add") { |
| | | // this.$store.commit("setpolygon", []); //用vuex传最终数据 |
| | | // done(); |
| | | // } |
| | | // done(); |
| | | // }, |
| | | // setMapData(val) { |
| | | // this.LineData = val[0]; |
| | | // this.PointData = val[1]; |
| | | // }, |
| | | // searchReset() { |
| | | // this.query = {}; |
| | | // this.onLoad(this.page); |
| | | // }, |
| | | // rowUpdate(row, index, done, loading) { |
| | | // if (this.polygons.length == 0) { |
| | | // //没有面的数据 |
| | | // this.$refs.getMapData.isCheck = true; |
| | | // loading(); |
| | | // return; |
| | | // } |
| | | // let pol = this.polygons; |
| | | // // console.log(pol); |
| | | // let polLength = this.polygons.length - 1; |
| | | // let usePolygons = ""; |
| | | // for (let k in pol) { |
| | | // usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | // if (k != polLength) { |
| | | // usePolygons += ";"; |
| | | // } |
| | | // } |
| | | // row.coordinate = usePolygons; |
| | | // update(row).then( |
| | | // () => { |
| | | // this.onLoad(this.page); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!" |
| | | // }); |
| | | // done(); |
| | | // }, |
| | | // error => { |
| | | // window.console.log(error); |
| | | // loading(); |
| | | // } |
| | | // ); |
| | | // }, |
| | | // rowDel(row) { |
| | | // this.$confirm("确定删除当前合同信息数据?", { |
| | | // confirmButtonText: "确定", |
| | | // cancelButtonText: "取消", |
| | | // type: "warning" |
| | | // }) |
| | | // .then(() => { |
| | | // console.log(row); |
| | | // return remove(row.id); |
| | | // }) |
| | | // .then(() => { |
| | | // this.onLoad(this.page); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!" |
| | | // }); |
| | | // }); |
| | | // }, |
| | | // selectionChange(list) { |
| | | // this.selectionList = list; |
| | | // }, |
| | | // handleDelete() { |
| | | // if (this.selectionList.length === 0) { |
| | | // this.$message.warning("请选择至少一条数据"); |
| | | // return; |
| | | // } |
| | | // this.$confirm("确定批量将选择数据删除?", { |
| | | // confirmButtonText: "确定", |
| | | // cancelButtonText: "取消", |
| | | // type: "warning" |
| | | // }) |
| | | // .then(() => { |
| | | // return remove(this.ids).then(res => { |
| | | // this.refreshChange(); |
| | | // }); |
| | | // }) |
| | | // .then(() => { |
| | | // this.onLoad(this.page); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!" |
| | | // }); |
| | | // this.$refs.crudrec.toggleSelection(); |
| | | // }) |
| | | // .catch(res => { |
| | | // }); |
| | | // }, |
| | | // refreshChange() { |
| | | // this.onLoad(this.page, this.query); |
| | | // }, |
| | | // onLoad(page, params = {}) { |
| | | // this.loading = true; |
| | | // getList( |
| | | // page.currentPage, |
| | | // page.pageSize, |
| | | // Object.assign(params, this.query) |
| | | // ).then(res => { |
| | | // const data = res.data.data; |
| | | // this.page.total = data.total; |
| | | // this.data = data.records; |
| | | // this.loading = false; |
| | | // }); |
| | | // } |
| | | // } |
| | | }; |
| | | </script> |
| | | |