jyyhq/witDisplay/js/eMap_svg/eMap_svg.js

106 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2025-02-10 12:18:11 +08:00
// 电子地图-摄像头设备信息获取
function sendRequest() {
debugger
//点击弹出光字牌
$('.camera').on({
click : function(e){
console.log($(this).attr('id'))
console.log(e.pageX)
let ballSvgId = $(this).attr('id')
let transform = $(this).attr('transform')
let xy = transform.split("(")[1].split(")")[0].split(",")
$('#board').attr('transform','translate(' + (Number(xy[0])-180) + ',' + (Number(xy[1])-125) + ')')
$('#board').css('display','')
$.ajax({
url: dataUrl + 'electronicMap/monitor',
type: "POST",
data: {
ballSvgId : ballSvgId
},
dataType: "json",
success: function(res) {
let monitorData = res.obj.monitor;
console.log(monitorData.length);
if (monitorData.length > 0) {
let data = monitorData[0];
$('#deviceCode').html(data.ballName);
$('#deviceState').html(data.onLine);
localStorage.setItem("puid_svg",data.puid);
} else {
console.log("监控数据为空");
}
},
error: function(xhr, status, error) {
console.error(error);
}
});
}
})
}
// 电子地图-消防头设备信息获取
function fileRequest() {
//点击弹出光字牌
$('.firefight').on({
click : function(e){
console.log($(this).attr('id'))
console.log(e.pageX)
let ballSvgId = $(this).attr('id')
let transform = $(this).attr('transform')
let xy = transform.split("(")[1].split(")")[0].split(",")
$('#file').attr('transform','translate(' + (Number(xy[0])-180) + ',' + (Number(xy[1])-125) + ')')
$('#file').css('display','')
$.ajax({
url: dataUrl + 'electronicMap/fire',
type: "POST",
data: {
ballSvgId : ballSvgId
},
dataType: "json",
success: function(res) {
let fileData = res.obj.file;
console.log(fileData.length);
if (fileData.length > 0) {
let data = fileData[0];
$('#deviceCodes').html(data.deviceType);
$('#deviceStates').html(data.deviceAddress);
$('#imageLinks').html(data.alarmCount);
} else {
console.log("监控数据为空");
}
},
error: function(xhr, status, error) {
console.error(error);
}
});
}
})
}
// 电子地图-监控视频弹出
function videoContent() {
document.getElementById("imageLink").addEventListener("click", function() {
// 执行跳转操作
layui.use('layer', function(){
var layer = layui.layer;
layer.open({
title: ['监控页面','color:rgb(227 227 227);font-size:20px'],
type: 2,
content: 'monitor.html',
area: ['900px', '600px'],
maxmin: true
});
});
});
}