|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="centerImg"></div>
|
|
|
|
|
<BoardTopNav nowMenu="2"></BoardTopNav>
|
|
|
|
|
<BoardTopNav nowMenu="2" @sceneIdChange="sceneIdChange"></BoardTopNav>
|
|
|
|
|
<Chart ref="chart1" class="chart1"></Chart>
|
|
|
|
|
<div class="table1">
|
|
|
|
|
<div style="background-color: #094170">
|
|
|
|
@ -133,17 +133,24 @@ export default {
|
|
|
|
|
boundaryGap: [0, 0.01],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
table1Data: []
|
|
|
|
|
table1Data: [],
|
|
|
|
|
sceneId: 0,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.createMap()
|
|
|
|
|
this.getAlarmStats()
|
|
|
|
|
this.getAubDevice()
|
|
|
|
|
this.setAlarmInfos()
|
|
|
|
|
this.setElectronicNumVo()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
sceneIdChange(e) {
|
|
|
|
|
this.sceneId = e
|
|
|
|
|
this.getData()
|
|
|
|
|
},
|
|
|
|
|
async getData() {
|
|
|
|
|
await this.createMap()
|
|
|
|
|
await this.getAlarmStats()
|
|
|
|
|
await this.getAubDevice()
|
|
|
|
|
await this.setAlarmInfos()
|
|
|
|
|
await this.setElectronicNumVo()
|
|
|
|
|
},
|
|
|
|
|
dispose() {
|
|
|
|
|
this.$confirm('该问题已处理?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
@ -167,12 +174,12 @@ export default {
|
|
|
|
|
center: [113.4, 23.35],
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
setMarker(position) {
|
|
|
|
|
let marker =new AMap.Marker({
|
|
|
|
|
position: position,
|
|
|
|
|
icon: red,
|
|
|
|
|
setPolygon(position) {
|
|
|
|
|
let e = position.map(val => {
|
|
|
|
|
return [val.longitude, val.latitude]
|
|
|
|
|
})
|
|
|
|
|
map.add(marker)
|
|
|
|
|
let thisPolygon = new AMap.Polygon({path: e});
|
|
|
|
|
map.add(thisPolygon)
|
|
|
|
|
map.setFitView()
|
|
|
|
|
},
|
|
|
|
|
setCircle(center, radius) {
|
|
|
|
@ -191,7 +198,7 @@ export default {
|
|
|
|
|
map.setFitView()
|
|
|
|
|
},
|
|
|
|
|
async getAlarmStats() {
|
|
|
|
|
const {data} = await alarmStats()
|
|
|
|
|
const {data} = await alarmStats(this.sceneId)
|
|
|
|
|
let option1 = {
|
|
|
|
|
...this.chart1Option,
|
|
|
|
|
yAxis: {
|
|
|
|
@ -239,10 +246,10 @@ export default {
|
|
|
|
|
this.$refs.chart1.setData(option1)
|
|
|
|
|
},
|
|
|
|
|
async getAubDevice() {
|
|
|
|
|
let data = await subDevice()
|
|
|
|
|
let data = await subDevice(this.sceneId)
|
|
|
|
|
this.num1 = data.deviceNum
|
|
|
|
|
this.num2 = data.onlineDeviceNum
|
|
|
|
|
this.num3 = data.subSum
|
|
|
|
|
this.num2 = data.subSum
|
|
|
|
|
this.num3 = data.onlineDeviceNum
|
|
|
|
|
},
|
|
|
|
|
async setAlarmInfos() {
|
|
|
|
|
const {rows: data} = await getAlarmInfos()
|
|
|
|
@ -256,13 +263,10 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async setElectronicNumVo() {
|
|
|
|
|
const {data} = await ElectronicNumVo()
|
|
|
|
|
console.log(data)
|
|
|
|
|
const {data} = await ElectronicNumVo(this.sceneId)
|
|
|
|
|
data.forEach(e => {
|
|
|
|
|
if (e.areaPoints?.length > 0) {
|
|
|
|
|
e.areaPoints.forEach(val => {
|
|
|
|
|
this.setMarker([val.longitude,val.latitude])
|
|
|
|
|
})
|
|
|
|
|
this.setPolygon(e.areaPoints)
|
|
|
|
|
}
|
|
|
|
|
if (e.centerPoint) {
|
|
|
|
|
this.setCircle([e.centerPoint.longitude, e.centerPoint.latitude], e.radius)
|
|
|
|
|