Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into dev
This commit is contained in:
44
packages/2.0.5/AppGridMap/components/list.vue
vendored
44
packages/2.0.5/AppGridMap/components/list.vue
vendored
@@ -92,6 +92,7 @@ export default {
|
||||
created() {
|
||||
this.dict.load("onlineStatus")
|
||||
this.getTreeList().then(() => {
|
||||
this.getLeafNodes()
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
@@ -105,42 +106,49 @@ 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 = [];
|
||||
if (val?.points) {
|
||||
if (val?.points?.length>0) {
|
||||
path = val.points.map(e => [e.lng, e.lat])
|
||||
this.renderGridMap([path])
|
||||
}else{
|
||||
this.$message.error("所选网格没有标绘!")
|
||||
}
|
||||
},
|
||||
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 +330,7 @@ export default {
|
||||
& > b {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
line-height: 76px;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.tree {
|
||||
|
||||
Reference in New Issue
Block a user