This commit is contained in:
liuye
2022-02-11 14:26:59 +08:00
parent 97faf29a8f
commit 806bfeaabc
7 changed files with 51 additions and 45 deletions

View File

@@ -32,7 +32,7 @@
<div class="popup">
<div class="bg"></div>
<div class="title">{{ detailInfo.house.createAddress || '' }}</div>
<p class="address">{{ detailInfo.community.address || '' }}</p>
<p class="address" v-if="detailInfo.community">{{ detailInfo.community.address || '' }}</p>
<div class="info-flex">
<span class="label">所属社区</span>
<span class="value">{{ detailInfo.build.areaName }}</span>
@@ -47,20 +47,21 @@
</div>
<div class="info-flex">
<span class="label">所属网格</span>
<span class="value">{{ detailInfo.gird.girdName || '' }}</span>
<span class="value" v-if="detailInfo.gird && detailInfo.gird.girdName">{{ detailInfo.gird.girdName || '' }}</span>
</div>
<div class="info-flex">
<span class="label">网格管理员</span>
<span class="value">{{ detailInfo.gird.girdMemberNames || '' }}</span>
<span class="value" v-if="detailInfo.gird && detailInfo.gird.girdMemberNames">{{ detailInfo.gird.girdMemberNames || '' }}</span>
</div>
<div class="info-flex">
<span class="label">楼栋长</span>
<span
class="value">{{ detailInfo.build.managerName || '' }}&nbsp;&nbsp;{{
class="value">{{ detailInfo.build.managerName || '' }}
<!-- &nbsp;&nbsp;{{
detailInfo.build.managerPhone || ''
}}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(detailInfo.build.managerPhone)"
class="phone-icon" v-if="detailInfo.build.managerPhone">
class="phone-icon" v-if="detailInfo.build.managerPhone"> -->
</span>
</div>
</div>
@@ -88,14 +89,19 @@
</div>
<div class="info-flex">
<span class="label">网格管理员</span>
<span class="value" v-text="building.girdMemberNames||''"/>
<span class="value">
<span v-for="(item, index) in building.girdMemberNames" :key="index">
<span v-if="index>0">,</span><AiOpenData v-if="item" type="userName" :openid="item" style="display:inline-block;" />
</span>
</span>
</div>
<div class="info-flex">
<span class="label">楼栋长</span>
<span
class="value">{{ building.managerName || '' }}&nbsp;&nbsp;{{ building.managerPhone || '' }}
class="value">{{ building.managerName || '' }}
<!-- &nbsp;&nbsp;{{ building.managerPhone || '' }}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(detailInfo.build.managerPhone)"
class="phone-icon" v-if="detailInfo.build.managerPhone">
class="phone-icon" v-if="detailInfo.build.managerPhone"> -->
</span>
</div>
</div>
@@ -167,6 +173,10 @@ export default {
},
getMarkerCluster(points, count = 0) {
let {lib: TMap, map} = this
console.log(points)
if(!points.length) {
return
}
if (map) {
// map.setCenter(this.config.latlng)
let MarkerCluster = new TMap.MarkerCluster({
@@ -253,6 +263,7 @@ export default {
overlay.on('click', () => {
this.buildPopup = true
this.building = item.geometries?.[0]?.properties || {}
this.building.girdMemberNames = this.building.girdMemberNames.split(',')
})
markers.push(overlay)
}
@@ -304,14 +315,19 @@ export default {
if (res.code == 0 && res.data.length) {
this.show = true
this.buildList = res.data
const points = res.data.map(item => {
return {
lnglat: [item.lng, item.lat],
id: item.id,
corpId: item.corpId,
areaName: item.areaName,
buildingNumber: item.name || item.buildingNumber,
communityName: item.name || item.communityName,
const points = []
res.data.map(item => {
if(item.lng && item.lat) {
points.push(
{
lnglat: [item.lng, item.lat],
id: item.id,
corpId: item.corpId,
areaName: item.areaName,
buildingNumber: item.name || item.buildingNumber,
communityName: item.name || item.communityName,
}
)
}
})
this.getMarkerCluster(points)