From fa7c5428c542f875d4f0c2427003882a8240779c Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 8 Jun 2022 10:19:42 +0800 Subject: [PATCH] BUG 30095 --- project/beta/grid/AppBuildMap/AppBuildMap.vue | 79 ++++----- project/beta/grid/AppHouseMap/AppHouseMap.vue | 167 +++++++++--------- 2 files changed, 125 insertions(+), 121 deletions(-) diff --git a/project/beta/grid/AppBuildMap/AppBuildMap.vue b/project/beta/grid/AppBuildMap/AppBuildMap.vue index 33572f37..c4050a71 100644 --- a/project/beta/grid/AppBuildMap/AppBuildMap.vue +++ b/project/beta/grid/AppBuildMap/AppBuildMap.vue @@ -35,7 +35,7 @@

房屋信息

- {{ info.areaName}} + {{ info.areaName }}
@@ -43,7 +43,7 @@
- {{ dict.getLabel("communityBuildingType",info.buildingType) }} + {{ dict.getLabel("communityBuildingType", info.buildingType) }}
@@ -51,7 +51,7 @@
- {{ info.managerPhone}} + {{ info.managerPhone }}
@@ -59,7 +59,7 @@

人员信息

- {{ resident.name}} + {{ resident.name }}
@@ -67,7 +67,7 @@
- {{house.houseCode}} + {{ house.houseCode }}
@@ -86,7 +86,8 @@
楼栋模型 + @click="$router.push({query: {communityId: info.communityId, buildingId: info.id,unitNum:house ? house.unitNumber : 1,buildingNumber:info.buildingNumber}})"> + 楼栋模型
@@ -153,19 +154,19 @@ export default { list: [], areaList: [], info: {}, - resident:null, + resident: null, satellite: null, zoom: 11, chooseBuildId: '', buildList: [], searchList: [], - house:null, - center: [] + house: null, + center: [], + mapLib: null } }, computed: { ...mapState(['user']), - hasCommunityId() { return !!this.$route.query?.communityId } @@ -186,7 +187,7 @@ export default { }, created() { - this.dict.load('householdRelation','communityBuildingType') + this.dict.load('householdRelation', 'communityBuildingType') }, mounted() { @@ -198,9 +199,9 @@ export default { }, methods: { - getCorpLocation(){ - this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res=>{ - if(res.code==0){ + getCorpLocation() { + this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => { + if (res.code == 0) { this.initMap(res.data); } }) @@ -239,9 +240,9 @@ export default { }, getBuildInfo(id) { - this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`,null,{ - params:{ - buildId:id + this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`, null, { + params: { + buildId: id } }).then(res => { if (res.code === 0) { @@ -255,11 +256,11 @@ export default { }, chooseCommunity(item) { - this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`,null,{ - params:{ - buildId:item.buildingId, - houseId:item.id, - residentId:item.residentId + this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`, null, { + params: { + buildId: item.buildingId, + houseId: item.id, + residentId: item.residentId } }).then(res => { if (res.code === 0) { @@ -293,7 +294,7 @@ export default {

${context.count}

- ` + `, {mapLib: AMap} = this let offset = new AMap.Pixel(-9, -9) context.marker.setContent(el) @@ -308,12 +309,12 @@ export default { renderMarker(context) { const buildId = context.data[0].id - let el = `
+ let el = `
${context.data[0].communityName}   ${context.data[0].buildingNumber}栋
-
+
` context.marker.setContent(el); @@ -336,6 +337,7 @@ export default { }, addMakert(points) { + let {mapLib: AMap} = this new AMap.MarkerClusterer(this.map, points, { gridSize: 60, maxZoom: 15, @@ -352,29 +354,26 @@ export default { size: 1000000 } }).then(res => { - if (res.code === 0) { + if (res?.data) { this.buildList = res.data.records const points = res.data.records.map(item => { return { lnglat: [item.lng, item.lat], id: item.id, corpId: item.corpId, - areaName:item.areaName, - buildingNumber:item.buildingNumber, - communityName:item.communityName + areaName: item.areaName, + buildingNumber: item.buildingNumber, + communityName: item.communityName } }) - this.addMakert(points) } }) }, - hidePopup() { this.isShowArea = false this.isShowSearch = false }, - switchLayer(flag) { if (flag) { this.map.addLayer(this.satellite) @@ -384,9 +383,8 @@ export default { this.isImageMap = flag }, - - initMap({lng,lat}) { - this.center = [lng,lat]; + initMap({lng, lat}) { + this.center = [lng, lat]; AMapLoader.load({ key: 'b553334ba34f7ac3cd09df9bc8b539dc', version: '2.0', @@ -396,6 +394,7 @@ export default { plugins: [] } }).then((AMap) => { + this.mapLib = AMap this.map = new AMap.Map('map', { resizeEnable: true, zooms: [6, 20], @@ -422,7 +421,7 @@ export default { width: 100%; } -::v-deep .ai-list__content--right-wrapper{ +::v-deep .ai-list__content--right-wrapper { height: 100%; margin: 0px !important; background-color: transparent !important; @@ -804,7 +803,7 @@ export default { white-space: nowrap; } - p:first-child{ + p:first-child { font-size: 14px; } @@ -816,7 +815,7 @@ export default { } } -::v-deep .mark{ +::v-deep .mark { user-select: none; cursor: pointer; height: 32px; @@ -829,7 +828,7 @@ export default { box-sizing: border-box; padding: 0 12px; - .mark-contaienr{ + .mark-contaienr { color: white; font-size: 14px; position: relative; @@ -841,7 +840,7 @@ export default { justify-content: center; } - .arrow{ + .arrow { position: absolute; left: 50%; transform: translateX(-50%); diff --git a/project/beta/grid/AppHouseMap/AppHouseMap.vue b/project/beta/grid/AppHouseMap/AppHouseMap.vue index ae0f5173..e38b5447 100644 --- a/project/beta/grid/AppHouseMap/AppHouseMap.vue +++ b/project/beta/grid/AppHouseMap/AppHouseMap.vue @@ -20,7 +20,7 @@
+ @click="chooseCommunity(item)">

{{ item.residentName }}

{{ item.createAddress }} @@ -42,23 +42,23 @@

户主信息

- {{info.areaName}} + {{ info.areaName }}
- {{info.name}} + {{ info.name }}
- {{info.phone}} + {{ info.phone }}
- {{info.sex == 1 ? '男' : '女'}} + {{ info.sex == 1 ? '男' : '女' }}
- {{info.age}} + {{ info.age }}
@@ -66,22 +66,22 @@

宅基地信息

- {{info.liveBuildingArea}}m² + {{ info.liveBuildingArea }}m²
- {{info.buildingFloorNumber}}层 + {{ info.buildingFloorNumber }}层
- {{info.buildingHeight}}m + {{ info.buildingHeight }}m

房屋信息

- {{ info.areaName}} + {{ info.areaName }}
@@ -89,7 +89,7 @@
- {{ dict.getLabel("communityBuildingType",info.buildingType) }} + {{ dict.getLabel("communityBuildingType", info.buildingType) }}
@@ -97,27 +97,28 @@
- {{ info.managerPhone}} + {{ info.managerPhone }}
楼栋模型 + @click="showStatistics=true; $router.push({query: {communityId: info.communityId, buildingId: info.id,unitNum:house ? house.unitNumber : 1,buildingNumber:info.buildingNumber}})"> + 楼栋模型
- +
+ :class="[!isImageMap ? 'map-layers__item-active' : '']">
地图
+ :class="[isImageMap ? 'map-layers__item-active' : '']">
卫星
@@ -158,6 +159,7 @@ export default { data() { return { map: null, + mapLib: null, community: '', isShowLayer: false, isShowSearch: false, @@ -171,13 +173,13 @@ export default { list: [], areaList: [], info: {}, - resident:null, + resident: null, satellite: null, zoom: 11, chooseBuildId: '', buildList: [], searchList: [], - house:null, + house: null, center: [], type: '', typeList: [ @@ -222,7 +224,7 @@ export default { }, created() { - this.dict.load('householdRelation','communityBuildingType') + this.dict.load('householdRelation', 'communityBuildingType') }, mounted() { @@ -232,12 +234,12 @@ export default { }, methods: { - getCorpLocation(){ - if(this.showStatistics) { //楼栋模型返回重新查询 + getCorpLocation() { + if (this.showStatistics) { //楼栋模型返回重新查询 return } - this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res=>{ - if(res.code==0){ + this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => { + if (res.code == 0) { this.initMap(res.data); } }) @@ -255,14 +257,14 @@ export default { }, search() { - if(this.type === '') { + if (this.type === '') { this.searchList = [] this.$message.error('请先选择房屋类型') return } this.isShowArea = false var url = '/app/appcommunityhouseinfo/queryHouseByName' - if(this.type == 1) { + if (this.type == 1) { url = '/app/apphomesteadinfo/list' } this.instance.post(url, null, { @@ -275,9 +277,9 @@ export default { }).then(res => { if (res.code === 0) { var data = [] - if(this.type == 1) { + if (this.type == 1) { data = res.data.records - }else { + } else { data = res.data } @@ -293,14 +295,14 @@ export default { getBuildInfo(id, type) { var url = `/app/apphomesteadinfo/queryDetailById?id=${id}` - if(type == 0) { - url= `/app/appcommunityhouseinfo/queryDetailByIdWithBuilding?buildId=${id}` + if (type == 0) { + url = `/app/appcommunityhouseinfo/queryDetailByIdWithBuilding?buildId=${id}` } this.instance.post(url).then(res => { if (res.code === 0) { - if(type == 1) { + if (type == 1) { this.info = res.data - }else { + } else { this.info = res.data.build this.resident = null; } @@ -312,10 +314,10 @@ export default { }, chooseCommunity(item) { - if(item.name) { //宅基地 - if(!item.lng || !item.lat) { + if (item.name) { //宅基地 + if (!item.lng || !item.lat) { return this.$message.error('未获取到该房屋坐标信息') - }else { + } else { this.map.setZoomAndCenter(18, [item.lng, item.lat], false, 600) this.info = item this.$nextTick(() => { @@ -323,35 +325,35 @@ export default { this.isShowInfo = true }) } - - }else { //楼栋 - this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`,null,{ - params:{ - buildId:item.buildingId, - houseId:item.id, - residentId:item.residentId - } - }).then(res => { - if (res.code === 0) { - if (!res.data.build?.lng || !res.data.build?.lat) { - this.isShowInfo = true - this.isShowSearch = false - this.info = res.data.build; - return this.$message.error('未获取到该房屋坐标信息') - } else { - this.chooseBuildId = res.data.build.id - this.house = res.data.house - this.resident = res.data.resident; - } - this.map.setZoomAndCenter(18, [res.data.build?.lng, res.data.build?.lat], false, 600) - this.info = res.data.build - this.$nextTick(() => { - this.isShowSearch = false - this.isShowInfo = true - }) - } - }) + } else { //楼栋 + this.instance.post(`/app/appcommunityhouseinfo/queryDetailByIdWithBuilding`, null, { + params: { + buildId: item.buildingId, + houseId: item.id, + residentId: item.residentId + } + }).then(res => { + if (res.code === 0) { + if (!res.data.build?.lng || !res.data.build?.lat) { + this.isShowInfo = true + this.isShowSearch = false + this.info = res.data.build; + return this.$message.error('未获取到该房屋坐标信息') + } else { + this.chooseBuildId = res.data.build.id + this.house = res.data.house + this.resident = res.data.resident; + } + + this.map.setZoomAndCenter(18, [res.data.build?.lng, res.data.build?.lat], false, 600) + this.info = res.data.build + this.$nextTick(() => { + this.isShowSearch = false + this.isShowInfo = true + }) + } + }) } }, @@ -365,7 +367,7 @@ export default {

${context.count}

` - + let {mapLib: AMap} = this let offset = new AMap.Pixel(-9, -9) context.marker.setContent(el) context.marker.setOffset(offset) @@ -380,23 +382,23 @@ export default { const buildId = context.data[0].id let el = '' var urlType = '' - if(context.data[0].communityName == context.data[0].buildingNumber) { //宅基地 + if (context.data[0].communityName == context.data[0].buildingNumber) { //宅基地 urlType = 1 - el = `
+ el = `
${context.data[0].areaName}   ${context.data[0].communityName}
-
+
` - }else { + } else { urlType = 0 - el = `
+ el = `
${context.data[0].communityName}   ${context.data[0].buildingNumber}栋
-
+
` } @@ -421,6 +423,7 @@ export default { }, addMakert(points) { + let {mapLib: AMap} = this new AMap.MarkerClusterer(this.map, points, { gridSize: 60, maxZoom: 15, @@ -444,9 +447,9 @@ export default { lnglat: [item.lng, item.lat], id: item.id, corpId: item.corpId, - areaName:item.areaName, + areaName: item.areaName, buildingNumber: item.name || item.buildingNumber, - communityName:item.name || item.communityName, + communityName: item.name || item.communityName, } }) @@ -470,8 +473,8 @@ export default { this.isImageMap = flag }, - initMap({lng,lat}) { - this.center = [lng,lat]; + initMap({lng, lat}) { + this.center = [lng, lat]; AMapLoader.load({ key: 'b553334ba34f7ac3cd09df9bc8b539dc', version: '2.0', @@ -481,6 +484,7 @@ export default { plugins: [] } }).then((AMap) => { + this.mapLib = AMap this.map = new AMap.Map('map', { resizeEnable: true, zooms: [6, 20], @@ -507,7 +511,7 @@ export default { width: 100%; } -::v-deep .ai-list__content--right-wrapper{ +::v-deep .ai-list__content--right-wrapper { height: 100%; margin: 0px !important; background-color: transparent !important; @@ -889,7 +893,7 @@ export default { white-space: nowrap; } - p:first-child{ + p:first-child { font-size: 14px; } @@ -901,7 +905,7 @@ export default { } } -::v-deep .mark{ +::v-deep .mark { user-select: none; cursor: pointer; height: 32px; @@ -914,7 +918,7 @@ export default { box-sizing: border-box; padding: 0 12px; - .mark-contaienr{ + .mark-contaienr { color: white; font-size: 14px; position: relative; @@ -926,7 +930,7 @@ export default { justify-content: center; } - .arrow{ + .arrow { position: absolute; left: 50%; transform: translateX(-50%); @@ -1124,8 +1128,8 @@ export default { } } - .bg-fff{ - background-color: #fff!important; + .bg-fff { + background-color: #fff !important; } } } @@ -1336,7 +1340,8 @@ export default { color: #89B; } } - .map-area__right{ + + .map-area__right { margin-left: 16px; } }