diff --git a/ruoyi-ui/src/views/board/GPS/index.vue b/ruoyi-ui/src/views/board/GPS/index.vue index 0181f99..c51ee56 100644 --- a/ruoyi-ui/src/views/board/GPS/index.vue +++ b/ruoyi-ui/src/views/board/GPS/index.vue @@ -193,13 +193,13 @@ export default { }); map.add(text) }, - setPolygon(position) { + setPolygon(position,val) { let e = position.map(val => { return [val.longitude, val.latitude] }) let thisPolygon = new AMap.Polygon({ path: e, - fillColor: e ? '#ff0000' : '#1791fc', + fillColor: val>0 ? '#ff0000' : '#1791fc', }); map.add(thisPolygon) map.setFitView() @@ -214,7 +214,7 @@ export default { strokeOpacity: 0.2, fillOpacity: 0.4, strokeDasharray: [10, 10], - fillColor: e ? '#ff0000' : '#1791fc', + fillColor: e>0 ? '#ff0000' : '#1791fc', }) map.add(circle); map.setFitView() @@ -289,7 +289,7 @@ export default { const {data} = await ElectronicNumVo(this.$store.getters.sceneId) data.forEach(e => { if (e.areaPoints?.length > 0) { - this.setPolygon(e.areaPoints) + this.setPolygon(e.areaPoints,e.abnormalCount) } if (e.centerPoint) { this.setCircle([e.centerPoint.longitude, e.centerPoint.latitude], e.radius, e.abnormalCount)