diff --git a/src/views/wellManage/listWell.vue b/src/views/wellManage/listWell.vue index fd450b1..31b2cd6 100644 --- a/src/views/wellManage/listWell.vue +++ b/src/views/wellManage/listWell.vue @@ -127,6 +127,7 @@ import { getWellList, getWellType, delWell, batchImportWell, batchExportWell, batchBfcf, bfcf } from '@/api/well/well' import DeptSelect from '@/components/DeptSelect' import DownloadTemplate from '@/components/DownloadTemplate/index' +import AMapLoader from '@amap/amap-jsapi-loader' export default { name: 'ListWell', @@ -454,6 +455,31 @@ this.listQuery.offset = 1 } getWellList(this.listQuery).then(response => { + window._AMapSecurityConfig = { + securityJsCode: this.$store.getters.amapSecurityCode + } + AMapLoader.load({ + key: this.$store.getters.amapKey // 秘钥,从store中取 + }).then((AMap) => { + AMap.plugin('AMap.Geocoder', function() { + var geocoder = new AMap.Geocoder({ + city: '' + }) + var lnglat = [] + response.data.rows.forEach((item, index) => { + lnglat = item.position.split(',') + }) + geocoder.getAddress(lnglat, function(status, result) { + if (status === 'complete' && result.info === 'OK') { + response.data.rows.forEach((item, index) => { + item.position = result.regeocode.formattedAddress + }) + // console.log(result.regeocode.formattedAddress, '======result======') + // result为对应的地理位置详细信息 + } + }) + }) + }) this.list = response.data.rows this.total = parseInt(response.data.total) this.listLoading = false