|
|
|
@ -184,11 +184,11 @@
|
|
|
|
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
|
|
|
<el-form-item label="搜索">
|
|
|
|
|
<el-select
|
|
|
|
|
:reserve-keyword="true"
|
|
|
|
|
v-model="value"
|
|
|
|
|
multiple
|
|
|
|
|
filterable
|
|
|
|
|
remote
|
|
|
|
|
reserve-keyword
|
|
|
|
|
placeholder="请输入关键词"
|
|
|
|
|
@change="setMarker2"
|
|
|
|
|
:remote-method="searchMap1"
|
|
|
|
@ -253,7 +253,7 @@
|
|
|
|
|
{{ warInfo.alarmInfoType === '2' ? '监控单元报警' : '' }}
|
|
|
|
|
{{ warInfo.alarmInfoType === '3' ? '离线报警' : '' }}
|
|
|
|
|
{{ warInfo.alarmInfoType === '4' ? '电子围栏' : '' }}
|
|
|
|
|
<!-- {{ warInfo.alarmTypeName }}-->
|
|
|
|
|
<!-- {{ warInfo.alarmTypeName }}-->
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item>
|
|
|
|
|
<template slot="label">
|
|
|
|
@ -581,9 +581,9 @@ export default {
|
|
|
|
|
this.setChart2()
|
|
|
|
|
this.setAllNums()
|
|
|
|
|
this.setDeviceOperations()
|
|
|
|
|
setInterval(()=>{
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
this.setTable3()
|
|
|
|
|
},5000)
|
|
|
|
|
}, 5000)
|
|
|
|
|
|
|
|
|
|
// let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`)
|
|
|
|
|
// let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`)
|
|
|
|
@ -672,7 +672,8 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async setDeviceOperations() {
|
|
|
|
|
let {data: data} = await getDeviceOperations()
|
|
|
|
|
// let {data: data} = await getDeviceOperations(this.$store.getters.tenantId)
|
|
|
|
|
let {data: data} = await getDeviceOperations(0)
|
|
|
|
|
let onlineDevicesTrend = data["onlineDevicesTrend"];
|
|
|
|
|
let sortArr = Object.keys(onlineDevicesTrend)
|
|
|
|
|
sortArr = sortArr.sort((a, b) => {
|
|
|
|
@ -1028,7 +1029,13 @@ export default {
|
|
|
|
|
const data = await getDeviceByAreaId(this.$store.getters.tenantId)
|
|
|
|
|
this.markerData = data.data.map(e => e.devicesList).flat(1)
|
|
|
|
|
data.data.map(e => e.devicesList).flat(1).forEach(e => {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
if (e.latitude && e.longitude) {
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker3(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -1041,25 +1048,27 @@ export default {
|
|
|
|
|
title: `信息\n经度:${e.longitude}\n纬度:${e.latitude}\n名称:${e.deviceName}\n`,
|
|
|
|
|
offset: new AMap.Pixel(-15, -30),
|
|
|
|
|
content: `<div> <svg t="1718261114618" class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="4305" style="width: 30px;height: 30px;">
|
|
|
|
|
<path fill="${(e.ifAlarm === '1') ? '#3D93FD' : '#ff0000'}" d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" p-id="4306">
|
|
|
|
|
<path fill="${(e.ifAlarm !== '1') ? '#3D93FD' : '#ff0000'}" d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" p-id="4306">
|
|
|
|
|
</path></svg></div>`
|
|
|
|
|
});
|
|
|
|
|
marker.on('rightclick', async () => {
|
|
|
|
|
// if (markerIds.includes(e.deviceId)) {
|
|
|
|
|
// return
|
|
|
|
|
// } else {
|
|
|
|
|
// markerIds.push(e.deviceId)
|
|
|
|
|
// }
|
|
|
|
|
const {data} = await selectMonitorElectronic(e.deviceId)
|
|
|
|
|
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
|
|
|
|
|
if (e.areaShapeFlag === '1') {
|
|
|
|
|
this.setPolygon(e.areaRange.split('_').map(e => e.split(',').map(v => parseFloat(v))))
|
|
|
|
|
}
|
|
|
|
|
if (e.areaShapeFlag === '2') {
|
|
|
|
|
let arr = e.areaRange.split(',')
|
|
|
|
|
this.setCircle([arr[0], arr[1]], arr[2])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(polygons.length>0||circles.length>0){
|
|
|
|
|
polygons = []
|
|
|
|
|
circles = []
|
|
|
|
|
map.remove(polygons)
|
|
|
|
|
map.remove(circles)
|
|
|
|
|
}else{
|
|
|
|
|
const {data} = await selectMonitorElectronic(e.deviceId)
|
|
|
|
|
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
|
|
|
|
|
if (e.areaShapeFlag === '1') {
|
|
|
|
|
this.setPolygon(e.areaRange.split('_').map(e => e.split(',').map(v => parseFloat(v))))
|
|
|
|
|
}
|
|
|
|
|
if (e.areaShapeFlag === '2') {
|
|
|
|
|
let arr = e.areaRange.split(',')
|
|
|
|
|
this.setCircle([arr[0], arr[1]], arr[2])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
marker.on('dblclick', () => {
|
|
|
|
|
this.equipmentInfoDialog = true
|
|
|
|
@ -1118,19 +1127,60 @@ export default {
|
|
|
|
|
map.remove(markers)
|
|
|
|
|
map.remove(polygons)
|
|
|
|
|
map.remove(circles)
|
|
|
|
|
polygons = []
|
|
|
|
|
circles = []
|
|
|
|
|
markers = []
|
|
|
|
|
e.forEach(v => {
|
|
|
|
|
console.log(v)
|
|
|
|
|
console.log(this.options)
|
|
|
|
|
let arr = this.options.filter(r => r.value.deviceId === v) || []
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
this.setMarker1(arr[0].value)
|
|
|
|
|
if (arr[0].value.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker1(arr[0].value)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(arr[0].value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(!bl){
|
|
|
|
|
if (!bl) {
|
|
|
|
|
map.setFitView(markers)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setMarker3(e) {
|
|
|
|
|
let marker = new AMap.Marker({
|
|
|
|
|
position: [e.longitude, e.latitude],
|
|
|
|
|
title: `信息\n经度:${e.longitude}\n纬度:${e.latitude}\n名称:${e.deviceName}\n`,
|
|
|
|
|
offset: new AMap.Pixel(-20, -40),
|
|
|
|
|
content: `<div>
|
|
|
|
|
<img src="${gif}" alt="" width=" 40px" >
|
|
|
|
|
</div>`
|
|
|
|
|
});
|
|
|
|
|
marker.on('rightclick', async () => {
|
|
|
|
|
// if (markerIds.includes(e.deviceId)) {
|
|
|
|
|
// return
|
|
|
|
|
// } else {
|
|
|
|
|
// markerIds.push(e.deviceId)
|
|
|
|
|
// }
|
|
|
|
|
const {data} = await selectMonitorElectronic(e.deviceId)
|
|
|
|
|
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
|
|
|
|
|
if (e.areaShapeFlag === '1') {
|
|
|
|
|
this.setPolygon(e.areaRange.split('_').map(e => e.split(',').map(v => parseFloat(v))))
|
|
|
|
|
}
|
|
|
|
|
if (e.areaShapeFlag === '2') {
|
|
|
|
|
let arr = e.areaRange.split(',')
|
|
|
|
|
this.setCircle([arr[0], arr[1]], arr[2])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
marker.on('dblclick', () => {
|
|
|
|
|
this.equipmentInfoDialog = true
|
|
|
|
|
this.equipmentInfo = this.markerData.filter(v => v.monitorUnitId === e.monitorUnitId)
|
|
|
|
|
this.monitorUnitId = e.monitorUnitId
|
|
|
|
|
// this.$router.push({path: '/board/equipment', query: {monitorUnitId: e.monitorUnitId}})
|
|
|
|
|
});
|
|
|
|
|
map.add(marker);
|
|
|
|
|
markers.push(marker)
|
|
|
|
|
},
|
|
|
|
|
getDeviceInfo() {
|
|
|
|
|
this.$router.push({path: '/board/equipment', query: {monitorUnitId: this.monitorUnitId}})
|
|
|
|
|
},
|
|
|
|
@ -1168,7 +1218,7 @@ export default {
|
|
|
|
|
createMap() {
|
|
|
|
|
map = new AMap.Map('map', {
|
|
|
|
|
zoom: 11,
|
|
|
|
|
center: this.centerGeo,
|
|
|
|
|
center: this.centerGeo.length === 2 ? this.centerGeo : [116.23, 39.54],
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async searchMap() {
|
|
|
|
@ -1176,33 +1226,53 @@ export default {
|
|
|
|
|
map.remove(markers)
|
|
|
|
|
map.remove(polygons)
|
|
|
|
|
map.remove(circles)
|
|
|
|
|
polygons = []
|
|
|
|
|
circles = []
|
|
|
|
|
markers = []
|
|
|
|
|
this.markerData = data
|
|
|
|
|
console.log(data)
|
|
|
|
|
data.forEach(e => {
|
|
|
|
|
if (e.latitude && e.longitude) {
|
|
|
|
|
this.setMarker1(e)
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker1(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
map.setFitView(markers)
|
|
|
|
|
},
|
|
|
|
|
async searchMap1(name, e) {
|
|
|
|
|
console.log(111)
|
|
|
|
|
// if(!e){
|
|
|
|
|
if (time2) {
|
|
|
|
|
clearInterval(time2)
|
|
|
|
|
}
|
|
|
|
|
time2 = null
|
|
|
|
|
if(name.length === 0){
|
|
|
|
|
if (name.length === 0) {
|
|
|
|
|
|
|
|
|
|
const data = await getDeviceByAreaId(this.$store.getters.tenantId)
|
|
|
|
|
this.markerData = data.data.map(e => e.devicesList).flat(1)
|
|
|
|
|
data.data.map(e => e.devicesList).flat(1).forEach(e => {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker1(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
time2 = setInterval(async () => {
|
|
|
|
|
const {data} = await selectDeviceByName({name: name})
|
|
|
|
|
this.markerData = data
|
|
|
|
|
map.remove(markers)
|
|
|
|
|
markers = []
|
|
|
|
|
data.forEach(e => {
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker1(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}, 5000)
|
|
|
|
|
// }
|
|
|
|
|
const {data} = await selectDeviceByName({name: name})
|
|
|
|
@ -1210,6 +1280,8 @@ export default {
|
|
|
|
|
map.remove(markers)
|
|
|
|
|
map.remove(polygons)
|
|
|
|
|
map.remove(circles)
|
|
|
|
|
polygons = []
|
|
|
|
|
circles = []
|
|
|
|
|
markers = []
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.loading = false;
|
|
|
|
@ -1220,6 +1292,11 @@ export default {
|
|
|
|
|
label: e.deviceName,
|
|
|
|
|
value: e
|
|
|
|
|
})
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker1(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.options = option
|
|
|
|
@ -1235,7 +1312,11 @@ export default {
|
|
|
|
|
if (this.isRail) {
|
|
|
|
|
const data = await getDeviceByAreaId(this.$store.getters.tenantId)
|
|
|
|
|
data.data.map(e => e.devicesList).flat(1).forEach(e => {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
if (e.ifAlarm !== '1') {
|
|
|
|
|
this.setMarker3(e)
|
|
|
|
|
} else {
|
|
|
|
|
this.setMarker(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
map.remove(markers)
|
|
|
|
|