优化分屏监控
parent
76ef652e7c
commit
42427a2b8c
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="devicePosition" style="width: 100vw; height: 91vh;">
|
<div id="devicePosition" style="width: 100vw; height: 91vh;">
|
||||||
<el-container v-if="onOff" style="height: 91vh;" v-loading="isLoging">
|
<el-container v-if="onOff" style="height: 91vh;" v-loading="isLoging">
|
||||||
<el-aside width="auto" style="background-color: #ffffff">
|
<el-aside width="400px" style="background-color: #ffffff">
|
||||||
<DeviceTree ref="deviceTree" :clickEvent="clickEvent" :contextMenuEvent="contextmenuEventHandler" ></DeviceTree>
|
<DeviceTree ref="deviceTree" :clickEvent="clickEvent" :contextMenuEvent="contextmenuEventHandler" ></DeviceTree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-main style="height: 91vh; padding: 0">
|
<el-main style="height: 91vh; padding: 0">
|
||||||
|
@ -98,7 +98,41 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent: function (device, data, isCatalog) {
|
clickEvent: function (channelId) {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/common/channel/one`,
|
||||||
|
params: {
|
||||||
|
id: channelId,
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
if (!res.data.gbLongitude || res.data.gbLatitude) {
|
||||||
|
this.$message.error({
|
||||||
|
showClose: true,
|
||||||
|
message: "位置信息不存在"
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
if (this.layer != null) {
|
||||||
|
this.$refs.map.removeLayer(this.layer);
|
||||||
|
}
|
||||||
|
this.closeInfoBox()
|
||||||
|
this.layer = this.$refs.map.addLayer([{
|
||||||
|
position: [res.data.gbLongitude, res.data.gbLatitude],
|
||||||
|
image: {
|
||||||
|
src: this.getImageByChannel(res.data),
|
||||||
|
anchor: [0.5, 1]
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
}], this.featureClickEvent)
|
||||||
|
this.$refs.map.panTo([data[this.longitudeStr], data[this.latitudeStr]], mapParam.maxZoom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
this.device = device;
|
this.device = device;
|
||||||
if (data.channelId && !isCatalog) {
|
if (data.channelId && !isCatalog) {
|
||||||
// 点击通道
|
// 点击通道
|
||||||
|
@ -252,30 +286,30 @@ export default {
|
||||||
},
|
},
|
||||||
getImageByChannel: function (channel) {
|
getImageByChannel: function (channel) {
|
||||||
let src = "static/images/gis/camera.png"
|
let src = "static/images/gis/camera.png"
|
||||||
switch (channel.ptzType) {
|
switch (channel.gbPtzType) {
|
||||||
case 1:
|
case 1:
|
||||||
if (channel.status === 1) {
|
if (channel.gbStatus === "ON") {
|
||||||
src = "static/images/gis/camera1.png"
|
src = "static/images/gis/camera1.png"
|
||||||
} else {
|
} else {
|
||||||
src = "static/images/gis/camera1-offline.png"
|
src = "static/images/gis/camera1-offline.png"
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (channel.status === 1) {
|
if (channel.gbStatus === "ON") {
|
||||||
src = "static/images/gis/camera2.png"
|
src = "static/images/gis/camera2.png"
|
||||||
} else {
|
} else {
|
||||||
src = "static/images/gis/camera2-offline.png"
|
src = "static/images/gis/camera2-offline.png"
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (channel.status === 1) {
|
if (channel.gbStatus === "ON") {
|
||||||
src = "static/images/gis/camera3.png"
|
src = "static/images/gis/camera3.png"
|
||||||
} else {
|
} else {
|
||||||
src = "static/images/gis/camera3-offline.png"
|
src = "static/images/gis/camera3-offline.png"
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (channel.status === 1) {
|
if (channel.gbStatus === "ON") {
|
||||||
src = "static/images/gis/camera.png"
|
src = "static/images/gis/camera.png"
|
||||||
} else {
|
} else {
|
||||||
src = "static/images/gis/camera-offline.png"
|
src = "static/images/gis/camera-offline.png"
|
||||||
|
|
Loading…
Reference in New Issue