| | |
| | | /* |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-02 11:43:42 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2022-08-02 15:56:01 |
| | | * @FilePath: \zhny_web\src\api\land\land.js |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | */ |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const submit = (params) => { |
| | | return request({ |
| | | url: '/api/land/land/submit', |
| | | method: 'post', |
| | | data: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | that.$parent.plotDetailsPopupShow(e.overlay.attrParams) |
| | | }) |
| | | |
| | | console.log(item, 123) |
| | | |
| | | plotRegionLayer.addOverlay(polygon) |
| | | addPlotLayers.push({ center, name: item.landName }) |
| | | addPlotLayers.push({ center, name: item.landName, id: item.id }) |
| | | }, |
| | | |
| | | setCenter (name) { |
| | |
| | | }) |
| | | }, |
| | | |
| | | setPlotAttr (params) { |
| | | let overLayers = plotRegionLayer.getOverlays() |
| | | |
| | | overLayers.some(item => { |
| | | |
| | | if (item.attrParams.id == params.id) { |
| | | item.attrParams = params |
| | | |
| | | return true |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | |
| | | // 经纬度测算中心位置 |
| | | getCenter (arr) { |
| | | let centerLonLat = [] |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | .plot-detail-popup { |
| | | .header { |
| | | .plot-name { |
| | | input { |
| | | background: transparent; |
| | | color: #fff; |
| | | font-weight: bold; |
| | | border: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="wraaper-box farming-detail-box"> |
| | | <div class="dd"> |
| | | <div class="da"> |
| | | <!-- <div class="land-img" @click="mod(usePolygons)">--> |
| | | <!-- <div class="land-img" @click="mod(usePolygons)">--> |
| | | <div class="land-img"> |
| | | <img :src="url" class="landimg" /> |
| | | </div> |
| | |
| | | </el-tab-pane> |
| | | <!-- 农资记录 --> |
| | | <el-tab-pane label="农资使用记录" name="tab4"> |
| | | <stockUseInfo></stockUseInfo> |
| | | <stockUseInfo></stockUseInfo> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <el-dialog--> |
| | | <!-- title="地块位置"--> |
| | | <!-- class="current-map-box"--> |
| | | <!-- :visible.sync="gradeBoxVisible1"--> |
| | | <!-- :modal="true"--> |
| | | <!-- :modal-append-to-body="true"--> |
| | | <!-- :append-to-body="true"--> |
| | | <!-- :close-on-click-modal="false"--> |
| | | <!-- :close-on-press-escape="false"--> |
| | | <!-- :before-close="dialogBeforeClose"--> |
| | | <!-- >--> |
| | | <!-- <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>--> |
| | | <!-- <el-button class="save" type="success" @click="upLand()">保存</el-button>--> |
| | | <!-- </el-dialog>--> |
| | | <!-- <el-dialog--> |
| | | <!-- title="地块位置"--> |
| | | <!-- class="current-map-box"--> |
| | | <!-- :visible.sync="gradeBoxVisible1"--> |
| | | <!-- :modal="true"--> |
| | | <!-- :modal-append-to-body="true"--> |
| | | <!-- :append-to-body="true"--> |
| | | <!-- :close-on-click-modal="false"--> |
| | | <!-- :close-on-press-escape="false"--> |
| | | <!-- :before-close="dialogBeforeClose"--> |
| | | <!-- >--> |
| | | <!-- <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere>--> |
| | | <!-- <el-button class="save" type="success" @click="upLand()">保存</el-button>--> |
| | | <!-- </el-dialog>--> |
| | | <landUpdate v-if="landVisible" ref="landUpdate" id="landUpdate"></landUpdate> |
| | | </div> |
| | | </template> |
| | |
| | | import recovery from "@/views/recovery/recovery.vue" |
| | | import stockUseInfo from "@/views/farm/stockUseInfo.vue" |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | import {getList, remove, update} from "@/api/land/land" |
| | | import { getList, remove, update } from "@/api/land/land" |
| | | import landUpdate from "./landUpdate" |
| | | |
| | | export default { |
| | |
| | | methods: { |
| | | //圈地 |
| | | land () { |
| | | this.landVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.landUpdate.init() |
| | | }) |
| | | this.landVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.landUpdate.init() |
| | | }) |
| | | }, |
| | | openLandUpdate (page, params = {}) { |
| | | console.log('11111111111refreshOnLoad') |
| | | // getList(1, 10, Object.assign(params, this.query)).then(res => { |
| | | // const data = res.data.data |
| | | // |
| | | // this.farmPlanList = data.records |
| | | // }) |
| | | console.log('11111111111refreshOnLoad') |
| | | // getList(1, 10, Object.assign(params, this.query)).then(res => { |
| | | // const data = res.data.data |
| | | // |
| | | // this.farmPlanList = data.records |
| | | // }) |
| | | }, |
| | | mod (usePolygons) { |
| | | this.gradeBoxVisible1 = true |
| | |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | // loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | '$route.query': { |
| | | immediate: true, |
| | | handler(newData, oldData) { |
| | | this.url = this.$route.query.url |
| | | this.landName = this.$route.query.landName |
| | | this.dic = this.$route.query.dic |
| | | 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; |
| | | this.usePolygons = this.$route.query.landRange |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(",") |
| | | '$route.query': { |
| | | immediate: true, |
| | | handler (newData, oldData) { |
| | | this.url = this.$route.query.url |
| | | this.landName = this.$route.query.landName |
| | | this.dic = this.$route.query.dic |
| | | 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; |
| | | this.usePolygons = this.$route.query.landRange |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(",") |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | export default { |
| | | name: "getMapData", |
| | | props: { |
| | | currentPolygons: { |
| | | type: Array, |
| | | default: [] |
| | | } |
| | | currentPolygons: { |
| | | type: Array, |
| | | // eslint-disable-next-line vue/require-valid-default-prop |
| | | default: [] |
| | | } |
| | | }, |
| | | components: { |
| | | MapInThere, |
| | |
| | | this.isCheck = false |
| | | } |
| | | }, |
| | | currentPolygons: { |
| | | immediate: true, |
| | | handler (newData, oldData) { |
| | | console.log(newData, 5656) |
| | | if (newData.length > 0) { |
| | | currentPolygons: { |
| | | immediate: true, |
| | | handler (newData, oldData) { |
| | | console.log(newData, 5656) |
| | | if (newData.length > 0) { |
| | | |
| | | this.draw(newData) |
| | | } |
| | | }, |
| | | } |
| | | this.draw(newData) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | animateEnter: "animated fadeIn", |
| | | animateLeave: "animated fadeOut", |
| | | //未输入动画效果 |
| | | animateName: "custom-classes-transition", |
| | | animateEnter: "animated fadeInDown", |
| | | animateLeave: "animated fadeOut", |
| | | |
| | | |
| | | |
| | | |
| | | openTitle: "路径1", |
| | | MapDataShow: false, |
| | | fromView: false, |
| | |
| | | methods: { |
| | | draw (usePolygons) { |
| | | |
| | | console.log(usePolygons, 456) |
| | | console.log(usePolygons, 456) |
| | | |
| | | let arr = [] |
| | | |
| | |
| | | .list-leave { |
| | | opacity: 1; |
| | | } |
| | | .list-enter-active, |
| | | |
| | | .list-enter-active, |
| | | .list-leave-active { |
| | | transition: all 0.3s; |
| | | } |
| | |
| | | <template> |
| | | <div @click="bodyClick($event)" style="position: relative; height: 100%;"> |
| | | <plot-map ref="plotMap" style="position: absolute; width: 100%; height: 100%;"></plot-map> |
| | | |
| | | <div class="top"> |
| | | <div class="logo"> |
| | | <img src="../../../public/mg.png" /> |
| | |
| | | <span> 返回</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="farm-plant"> |
| | | <div class="title"> |
| | | <span>种养品种 · {{ this.plotPlantBreed.length }}种</span> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="land-info"> |
| | | <div class="content"> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="farm-land"> |
| | | <div class="title"> |
| | | <span>地块 · {{ this.pageLand.total }}种</span> |
| | |
| | | </div> |
| | | |
| | | <div class="plot-detail-popup" v-show="cPShow" ref="showCP"> |
| | | <div class="close-plot-popup" @click="closePlotPopup"> |
| | | <i class="el-icon-close" style="color: #fff;"></i> |
| | | </div> |
| | | |
| | | <div class="header"> |
| | | <div class="plot-name"> |
| | | <div class="name">{{ currentPlotDetails.landName }}</div> |
| | | <i class="el-icon-edit-outline" title="编辑地块名称"></i> |
| | | <div v-show="!plotNameEditShow"> |
| | | <div |
| | | class="name" |
| | | style="font-weight: bold;" |
| | | >{{ currentPlotDetails.landName }}</div> |
| | | <i |
| | | @click="plotNameEditShow=true" |
| | | class="el-icon-edit-outline edit-btn" |
| | | title="编辑地块名称" |
| | | style="margin-left: 9px;" |
| | | ></i> |
| | | </div> |
| | | |
| | | <div v-show="plotNameEditShow" class="edit-name"> |
| | | <el-input style="flex: 1;" v-model="currentPlotName" size="small"></el-input> |
| | | <div class="btn-grounp"> |
| | | <span class="edit-btn" @click="editName">保存</span> |
| | | |
| | | <span style="color: #999;">|</span> |
| | | |
| | | <span |
| | | class="edit-btn" |
| | | @click="plotNameEditShow=fasle" |
| | | style="color: #acdcd0;" |
| | | >取消</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="plot-area-type"> |
| | | <div class="l"> |
| | |
| | | class="type" |
| | | >{{ currentPlotDetails.dic }}</span> |
| | | </div> |
| | | <div class="r"> |
| | | <div class="r" @click="goToPlotDetail"> |
| | | 进入地块 |
| | | <i class="el-icon-arrow-right"></i> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <div class="body"> |
| | | <div class="list" v-for="(item, index) in cPPBreed" :key="index"> |
| | | <div |
| | | v-show="cPPBreed.length > 0" |
| | | class="list" |
| | | v-for="(item, index) in cPPBreed" |
| | | :key="index" |
| | | > |
| | | <div class="l"> |
| | | <img :src="item.url" /> |
| | | {{ item.strainName }} |
| | |
| | | class="r" |
| | | >{{ item.createTime }}{{ item.plantingWay == 0 ? "移摘" : item.plantingWay == 1 ? "播种" : "秧苗" }}</div> |
| | | </div> |
| | | |
| | | <div |
| | | v-show="cPPBreed.length == 0" |
| | | style="height: 100%; display: flex; align-items: center; justify-content: center;" |
| | | >暂无种养品种</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script> |
| | | import { mapGetters } from "vuex" |
| | | import { getList } from "@/api/farmplant/farmplant" |
| | | import { getList as getLandList, selectCount, getLandIsAreaStatistic } from "@/api/land/land" |
| | | import { getList as getLandList, selectCount, getLandIsAreaStatistic, submit } from "@/api/land/land" |
| | | import { getDetails } from "@/api/farm/farm" |
| | | export default { |
| | | components: { |
| | |
| | | |
| | | // 当前点击地块详情 |
| | | currentPlotDetails: {}, |
| | | currentPlotName: "", |
| | | |
| | | // 名称编辑是否显示 |
| | | plotNameEditShow: false, |
| | | |
| | | plotClickNum: 0, |
| | | |
| | |
| | | |
| | | plotDetailsPopupShow (params) { |
| | | this.currentPlotDetails = params |
| | | this.currentPlotName = params.landName |
| | | |
| | | let arr = [] |
| | | |
| | |
| | | this.cPShow = false |
| | | } |
| | | } |
| | | }, |
| | | |
| | | editName () { |
| | | if (this.currentPlotName == "") { |
| | | this.$message({ |
| | | message: '地块名称不能为空', |
| | | type: "warning", |
| | | }) |
| | | return |
| | | } |
| | | |
| | | submit({ |
| | | id: this.currentPlotDetails.id, |
| | | landName: this.currentPlotName |
| | | }).then(res => { |
| | | if (res.data.code == 200) { |
| | | this.currentPlotDetails.landName = this.currentPlotName |
| | | this.$refs.plotMap.setPlotAttr(this.currentPlotDetails) |
| | | this.landList.some(item => { |
| | | if (item.id == this.currentPlotDetails.id) { |
| | | item.landName = this.currentPlotDetails.landName |
| | | return true |
| | | } |
| | | }) |
| | | |
| | | this.plotNameEditShow = false |
| | | |
| | | this.$message({ |
| | | message: '地块名称修改成功', |
| | | type: "success", |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | closePlotPopup () { |
| | | this.plotClickNum = 0 |
| | | this.plotNameEditShow = false |
| | | this.cPShow = false |
| | | }, |
| | | |
| | | goToPlotDetail () { |
| | | this.landList.some(item => { |
| | | if (item.id == this.currentPlotDetails.id) { |
| | | var arr = [] |
| | | this.$store.state.tags.tagList.forEach((item) => { |
| | | if (item.label != "地块详情") { |
| | | arr.push(item) |
| | | } |
| | | }) |
| | | this.$store.state.tags.tagList = arr |
| | | |
| | | this.$router.push({ |
| | | path: `/LandDetail`, |
| | | query: item, |
| | | }) |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | z-index: 11; |
| | | background: rgba(255, 255, 255, 0.9); |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | |
| | | .close-plot-popup { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | position: absolute; |
| | | top: -10px; |
| | | right: -10px; |
| | | width: 20px; |
| | | height: 20px; |
| | | border-radius: 50%; |
| | | background: #ccc; |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | flex-direction: column; |
| | | padding: 0 20px; |
| | | padding: 10px 20px; |
| | | height: 80px; |
| | | background: #2cd2a9; |
| | | color: #fff; |
| | | border-radius: 8px 8px 0 0; |
| | | box-sizing: border-box; |
| | | |
| | | & > div { |
| | | flex: 1; |
| | |
| | | } |
| | | |
| | | .plot-name { |
| | | & > div { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .edit-btn { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .edit-name { |
| | | width: 100%; |
| | | background: rgba(0, 0, 0, 0.15); |
| | | border-radius: 4px; |
| | | |
| | | .btn-grounp { |
| | | margin-right: 15px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .plot-area-type { |
| | | justify-content: space-between; |
| | | font-size: 14px; |
| | | |
| | | .l { |
| | | color: #e7f7f3; |
| | | |
| | | .type { |
| | | padding: 2px 10px; |
| | | border-radius: 11px; |
| | | background-color: #31bd9a; |
| | | } |
| | | } |
| | | |
| | | .r { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | box-sizing: border-box; |
| | | overflow-x: hidden; |
| | | overflow-y: auto; |
| | | border-radius: 0 0 8px 8px; |
| | | |
| | | .list:first-child { |
| | | margin: 0; |
| | |
| | | entry.add('classlist-polyfill').end() |
| | | entry.add('@/mock').end() |
| | | }, |
| | | css: { |
| | | extract: { ignoreOrder: true } |
| | | }, |
| | | //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理 |
| | | devServer: { |
| | | port: 1888, |