|
|
@ -84,8 +84,8 @@ export default {
|
|
|
|
Chart,
|
|
|
|
Chart,
|
|
|
|
vueSeamlessScroll,
|
|
|
|
vueSeamlessScroll,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch:{
|
|
|
|
watch: {
|
|
|
|
async $route(to,from){
|
|
|
|
async $route(to, from) {
|
|
|
|
await this.getData()
|
|
|
|
await this.getData()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -145,7 +145,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
async getData() {
|
|
|
|
async getData() {
|
|
|
|
if(this.$store.getters.sceneId === null) return
|
|
|
|
if (this.$store.getters.sceneId === null) return
|
|
|
|
await this.createMap()
|
|
|
|
await this.createMap()
|
|
|
|
await this.getAlarmStats()
|
|
|
|
await this.getAlarmStats()
|
|
|
|
await this.getAubDevice()
|
|
|
|
await this.getAubDevice()
|
|
|
@ -198,12 +198,17 @@ export default {
|
|
|
|
position = [e.centerPoint.longitude, e.centerPoint.latitude]
|
|
|
|
position = [e.centerPoint.longitude, e.centerPoint.latitude]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let text = new AMap.Text({
|
|
|
|
let text = new AMap.Text({
|
|
|
|
text: '总数:' + e.deviceCount + (e.abnormalCount ? ('/异常数量:' + e.abnormalCount) : ''),
|
|
|
|
text: '<div style="color:#fff;width: 100%;height: 100%;">' + '总数:' + e.deviceCount + (e.abnormalCount ? ('/异常数量:' + e.abnormalCount) : '') + '</div>',
|
|
|
|
anchor: 'center',
|
|
|
|
anchor: 'center',
|
|
|
|
draggable: true,
|
|
|
|
draggable: true,
|
|
|
|
cursor: 'pointer',
|
|
|
|
cursor: 'pointer',
|
|
|
|
position: position
|
|
|
|
position: position
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
text.setStyle({
|
|
|
|
|
|
|
|
'background-color': e.abnormalCount? '#fe0000':'#0055fe',
|
|
|
|
|
|
|
|
padding:'4px 12px',
|
|
|
|
|
|
|
|
'font-size':'1vw'
|
|
|
|
|
|
|
|
})
|
|
|
|
map.add(text)
|
|
|
|
map.add(text)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setPolygon(position, val) {
|
|
|
|
setPolygon(position, val) {
|
|
|
@ -233,7 +238,7 @@ export default {
|
|
|
|
map.setFitView()
|
|
|
|
map.setFitView()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getAlarmStats() {
|
|
|
|
async getAlarmStats() {
|
|
|
|
if(this.$store.getters.sceneId === null) return
|
|
|
|
if (this.$store.getters.sceneId === null) return
|
|
|
|
const {data} = await alarmStats(this.$store.getters.sceneId)
|
|
|
|
const {data} = await alarmStats(this.$store.getters.sceneId)
|
|
|
|
let option1 = {
|
|
|
|
let option1 = {
|
|
|
|
...this.chart1Option,
|
|
|
|
...this.chart1Option,
|
|
|
|