BUG 25642

This commit is contained in:
aixianling
2021-12-22 17:33:25 +08:00
parent c239b6aa04
commit 224caa595d

View File

@@ -92,6 +92,7 @@ export default {
created() {
this.dict.load("onlineStatus")
this.getTreeList().then(() => {
this.getLeafNodes()
})
},
watch: {
@@ -105,22 +106,24 @@ export default {
return data.girdName.indexOf(value) !== -1;
},
getTreeList() {
return this.instance.post(`/app/appgirdinfo/listAll`, null, null).then((res) => {
return this.instance.post(`/app/appgirdinfo/listAll`).then((res) => {
if (res.code == 0) {
this.treeObj.treeList = res.data;
}
})
},
getLeafNodes(count) {
let {tree} = this.$refs
if (tree) {
} else {
if (count < 5) {
setTimeout(() => {
this.getLeafNodes(++count)
}, 1000)
getLeafNodes() {
this.instance.post(`/app/appgirdinfo/listAll2`).then((res) => {
if (res?.data) {
let arr = []
res.data.forEach(e => {
if (e.points?.length > 0) {
arr.push(e.points.map(p => [p.lng, p.lat]))
}
})
this.renderGridMap(arr)
}
})
},
handleNodeClick(val) {
let path = [];
@@ -132,15 +135,18 @@ export default {
renderGridMap(paths) {
let {map, mapLib: AMap, retryMapCount} = this
if (AMap) {
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
map.clearMap()
paths.forEach(path => {
this.polygon = new AMap.Polyline({
paths.forEach((path, i) => {
let color = colors[i % colors.length]
this.polygon = new AMap.Polygon({
path,
strokeColor: "#FF33FF",
strokeWeight: 6,
strokeStyle: "solid",
strokeColor: color,
strokeWeight: 2,
strokeStyle: "dashed",
strokeOpacity: 1,
fillColor: "#1791fc",
fillColor: color,
fillOpacity: 0.1,
zIndex: 50,
lineJoin: "round",
lineCap: "round",
@@ -322,7 +328,7 @@ export default {
& > b {
color: #fff;
font-size: 18px;
line-height: 76px;
line-height: 60px;
}
.tree {