BUG 30074
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
||||
<span class="label">网格长</span>
|
||||
<span class="value">
|
||||
{{ [item.name,item.phone].join(" ") }}
|
||||
{{ [item.name, item.phone].join(" ") }}
|
||||
|
||||
</span>
|
||||
</div>
|
||||
@@ -32,11 +32,11 @@
|
||||
<span class="label">网格长</span>
|
||||
<span class="value">{{ item.name }} {{ item.phone }}
|
||||
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
|
||||
v-if="item.phone">
|
||||
v-if="item.phone">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
@@ -65,43 +65,14 @@ export default {
|
||||
created() {
|
||||
this.$dict.load('girdType')
|
||||
this.areaId = this.user.areaId
|
||||
// this.getLeafNodes()
|
||||
uni.$on('goback', e => {
|
||||
this.getGridList(e.id, true)
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = "网格管理"
|
||||
},
|
||||
|
||||
methods: {
|
||||
toChoose () {
|
||||
uni.navigateTo({
|
||||
url: './SelectGird?isFormMap=1'
|
||||
})
|
||||
},
|
||||
getLeafNodes() {
|
||||
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data
|
||||
|
||||
const arr = res.data.filter(v => v.points).map(e => {
|
||||
return {
|
||||
id: e.id,
|
||||
girdName: e.girdName,
|
||||
points: e.points.map(p => [p.lng, p.lat])
|
||||
}
|
||||
})
|
||||
|
||||
arr.length > 0 && this.renderGridMap(arr)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getGridList (id) {
|
||||
getGridList(id) {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
|
||||
this.$hideLoading()
|
||||
if (res?.data) {
|
||||
const arr = res.data.map(v => {
|
||||
return {
|
||||
@@ -112,12 +83,11 @@ export default {
|
||||
})
|
||||
this.renderGridMap(arr)
|
||||
}
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.$hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
getGridInfo (id, flag) {
|
||||
getGridInfo(id, flag) {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {
|
||||
this.$hideLoading()
|
||||
@@ -142,7 +112,6 @@ export default {
|
||||
this.$hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
renderGridMap(paths, count = 0) {
|
||||
let {map, lib: TMap, $refs: {AiTMap: {fitBounds}}} = this
|
||||
if (TMap) {
|
||||
@@ -157,58 +126,54 @@ export default {
|
||||
}
|
||||
if (paths?.length > 0) {
|
||||
let bounds = []
|
||||
|
||||
paths.forEach((path, i) => {
|
||||
let color = colors[i % colors.length]
|
||||
let polygon = new TMap.MultiPolygon({
|
||||
map, styles: {
|
||||
default: new TMap.PolygonStyle({
|
||||
showBorder: true,
|
||||
borderColor: '#5088FF',
|
||||
borderWidth: 2,
|
||||
color: this.$colorUtils.Hex2RGBA('#5088FF', 0.1)
|
||||
})
|
||||
},
|
||||
id: path.id,
|
||||
geometries: [{paths: path.points.map(e => new TMap.LatLng(e[1], e[0]))}]
|
||||
})
|
||||
this.polygons.push(polygon)
|
||||
bounds.push(fitBounds(path.points.map(e => new TMap.LatLng(e[1], e[0]))))
|
||||
|
||||
polygon.on('click', e => {
|
||||
const id = e.target.id
|
||||
this.getGridInfo(id)
|
||||
})
|
||||
|
||||
const points = path.points.map(e => new TMap.LatLng(e[1], e[0]))
|
||||
|
||||
var position = TMap.geometry.computeCentroid(points)
|
||||
|
||||
let label = new TMap.MultiLabel({
|
||||
id: `label~${path.id}`,
|
||||
data: path.id,
|
||||
map: map,
|
||||
styles: {
|
||||
building: new TMap.LabelStyle({
|
||||
color: '#3777FF',
|
||||
size: 20,
|
||||
alignment: 'center',
|
||||
verticalAlignment: 'middle'
|
||||
})
|
||||
},
|
||||
geometries: [
|
||||
{
|
||||
id: `label-class-${i}`,
|
||||
styleId: 'building',
|
||||
position: position,
|
||||
content: path.girdName,
|
||||
}
|
||||
]
|
||||
})
|
||||
this.labels.push(label)
|
||||
label.on('click', e => {
|
||||
this.getGridInfo(e.target.id.split('~')[1])
|
||||
});
|
||||
if(path.points?.length>0){
|
||||
let polygon = new TMap.MultiPolygon({
|
||||
map, styles: {
|
||||
default: new TMap.PolygonStyle({
|
||||
showBorder: true,
|
||||
borderColor: '#5088FF',
|
||||
borderWidth: 2,
|
||||
color: this.$colorUtils.Hex2RGBA('#5088FF', 0.1)
|
||||
})
|
||||
},
|
||||
id: path.id,
|
||||
geometries: [{paths: path.points.map(e => new TMap.LatLng(e[1], e[0]))}]
|
||||
})
|
||||
this.polygons.push(polygon)
|
||||
bounds.push(fitBounds(path.points.map(e => new TMap.LatLng(e[1], e[0]))))
|
||||
polygon.on('click', e => {
|
||||
const id = e.target.id
|
||||
this.getGridInfo(id)
|
||||
})
|
||||
const points = path.points.map(e => new TMap.LatLng(e[1], e[0]))
|
||||
const position = TMap.geometry.computeCentroid(points)
|
||||
let label = new TMap.MultiLabel({
|
||||
id: `label~${path.id}`,
|
||||
data: path.id,
|
||||
map: map,
|
||||
styles: {
|
||||
building: new TMap.LabelStyle({
|
||||
color: '#3777FF',
|
||||
size: 20,
|
||||
alignment: 'center',
|
||||
verticalAlignment: 'middle'
|
||||
})
|
||||
},
|
||||
geometries: [
|
||||
{
|
||||
id: `label-class-${i}`,
|
||||
styleId: 'building',
|
||||
position,
|
||||
content: path.girdName,
|
||||
}
|
||||
]
|
||||
})
|
||||
this.labels.push(label)
|
||||
label.on('click', e => {
|
||||
this.getGridInfo(e.target.id.split('~')[1])
|
||||
});
|
||||
}
|
||||
})
|
||||
bounds = bounds.reduce((a, b) => {
|
||||
return fitBounds([
|
||||
@@ -234,16 +199,9 @@ export default {
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({phoneNumber: phone})
|
||||
},
|
||||
handleSelect(e) {
|
||||
if (e?.points?.length > 0) {
|
||||
this.form = e
|
||||
const points = e.points.map(e => new TMap.LatLng(e.lat, e.lng))
|
||||
var position = TMap.geometry.computeCentroid(points)
|
||||
this.map.setCenter(position)
|
||||
this.map.setZoom(18)
|
||||
} else {
|
||||
this.$u.toast("所选网格没有标绘!")
|
||||
}
|
||||
handleSelectGird(v) {
|
||||
this.form = v || {}
|
||||
this.getGridList(v?.id, true)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user