| | |
| | | ...mapGetters(["userInfo", "$farmId"]), |
| | | }, |
| | | created () { |
| | | if (this.$farmId == 0){ |
| | | if (sessionStorage.getItem("myFarmId")){ |
| | | this.$store.commit("SET_FARMID",JSON.parse(sessionStorage.getItem("myFarmId"))) |
| | | } |
| | | } |
| | | window.addEventListener('beforeunload', () => { |
| | | sessionStorage.setItem('myFarmId', JSON.stringify(this.$farmId)) |
| | | }) |
| | | //获取种样品列表 |
| | | this.getFarmPlantList(this.page) |
| | | //获取地块列表 |
| | |
| | | }, |
| | | //获取地块列表 |
| | | getLandList (page, params = {}) { |
| | | const that = this |
| | | params['farmId'] = this.$farmId |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | this.loading = true |
| | |
| | | arr.forEach(it => { |
| | | brr.push(it.split(' ')) |
| | | }) |
| | | |
| | | this.$refs.plotMap.addPlotPolygon(brr, item) |
| | | that.$refs.plotMap.addPlotPolygon(brr, item) |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | // 地块定位 |
| | | setCenter (item) { |
| | | console.log(item) |
| | | this.$refs.plotMap.setPlotCenter(item) |
| | | }, |
| | | |
| | | plotDetailsPopupShow (params) { |
| | | this.currentPlotDetails = params |
| | | this.currentPlotName = params.landName |
| | | |
| | | let arr = [] |
| | | |
| | | this.farmPlantList.forEach((item, index) => { |