出入管理

This commit is contained in:
sliang 2024-04-02 19:58:45 +08:00
parent cd6a0b587b
commit 0d7dbce2d3
3 changed files with 71 additions and 66 deletions

View File

@ -103,7 +103,7 @@ function getStatistics(data){
document.getElementById("threesc").textContent=dycNums[2];
document.getElementById("foursc").textContent=dycNums[3];
var s = "https://unpkg.com/outeres/demo/carousel/720x360-1.jpg";
var s = "../../img/video/voi_photo4.png";
var htmls = '<img src ="'+s+'" alt="" style="height:100%;width:100%; margin-top:5%" />';
$('#photo').empty().append(htmls);
@ -127,7 +127,27 @@ function getVehicleStatisticsPhoto(accessType,timeType){
html +='</div>';
})
}else{
html += '<div style="color:red;">未找到关联信息</div>'
// html += '<div style="color:#71757B;">无数据</div>'
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警1</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo2.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警2</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo3.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警3</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo4.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警4</span>';
html +='</div>';
}
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
@ -235,7 +255,7 @@ function getStatisticsPer(data){
document.getElementById("threescPer").textContent=dycNums[2];
document.getElementById("fourscPer").textContent=dycNums[3];
var s = "https://unpkg.com/outeres/demo/carousel/720x360-1.jpg";
var s = "../../img/video/voi_photo4.png";
var htmls = '<img src ="'+s+'" alt="" style="height:100%;width:100%; margin-top:5%" />';
$('#photos').empty().append(htmls);
}
@ -253,12 +273,31 @@ function getPerStatisticsPhoto(accessType,timeType){
var a = "sss";
$.each(result.data, function (index, item) {
html +='<div class="abnormalAlarmImg">';
html +='<img src ="'+s+'" alt="" style="height:100%;width:100%; margin-top:5%" />';
html +='<img src ="'+s+'" alt="" style="height:95%;width:100%; margin-top:5%" />';
html +='<span>'+ a +'</span>';
html +='</div>';
})
}else{
html += '<div style="color:red;">未找到关联信息</div>'
// html += '<div style="color:#71757B;">无数据</div>'
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警1</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo2.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警2</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo3.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警3</span>';
html +='</div>';
html +='<div class="abnormalAlarmImg">';
html +='<img src ="../../img/video/voi_photo4.png" alt="" style="height:85%;width:100%; margin-top:5%" />';
html +='<span>告警4</span>';
html +='</div>';
}
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });

View File

@ -20,14 +20,14 @@ function getGtLists(){
}, function (result) {
if (result.code === 200) {
let html = '';
if (result.data && result.data.length > 0) {
if (result.data && result.data.length > 0 && result.data[0] !== null) {
$.each(result.data, function (index, item) {
html += '<option value="' + item.gtId + '">' + item.name + '</option>'
})
// 设备列表
getDeviceList(result.data[0].gtId);
}else{
html += '<option value="">未找到关联信息</option>'
html += '<option value="">无数据</option>'
getDeviceList("");
}
$('#gt').empty().append(html);
@ -38,32 +38,6 @@ function getGtLists(){
}, function (xhr) {
layer.msg(xhr, { icon: 2 });
});
// let paramData = 'bidCode=' + bidCode + '&roleCode=' + roleCode + '&orgId=' + orgId + '&userId=' + userId;
// let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData);
// const url = commonUrl + "system/sys/select/getGtLists?params="+ montageParam; // 杆塔url
// ajaxRequestGet(url, "GET", true, function () {
// }, function (result) {
// if (result.code === 200) {
// let html = '';
// if (result.data && result.data.length > 0) {
// $.each(result.data, function (index, item) {
// html += '<option value="' + item.gtId + '">' + item.name + '</option>'
// })
// }
// $('#gt').empty().append(html);
// layui.form.render();
// // 设备列表
// getDeviceList(result.data[0].gtId);
// // updateSelection();
// } else if (result.code === 500) {
// layer.msg(result.msg, { icon: 2 });
// }
// }, function (xhr, status, error) {
// error(xhr, status, error)
// setData(null);
// }, aqEnnable);
}
function getDeviceList(gtId){
@ -74,7 +48,7 @@ function getDeviceList(gtId){
}, function (result) {
let html = '';
if (result.code === 200) {
if (result.data && result.data.length > 1) {
if (result.data && result.data.length > 0 && result.data[0] !== null) {
$.each(result.data, function (index, item) {
html += '<div class="device-list-device" style="cursor: pointer;" onclick="getInfo(\'' +item.deviceId+ '\')" >';
html +='<input value = "'+item.deviceId +'" style="display:none;" />';
@ -90,7 +64,7 @@ function getDeviceList(gtId){
})
getInfo(result.data[0].deviceId)
}else{
html += '<div style="color:red;">未找到关联设备</div>'
html += '<div style="color:#71757B;">无数据</div>'
getInfo("")
}
} else if (result.code === 500) {
@ -107,9 +81,6 @@ function getInfo(deviceId){
//实时检测
getRealTimeDetection(deviceId);
//当日检测变化趋势
getTrend(deviceId)
//实时告警
getRealTimeAlarmList(deviceId)
@ -125,33 +96,21 @@ function getRealTimeDetection(deviceId){
}, function (result) {
let html = '';
if (result.code === 200) {
if (result.data && result.data.length > 1) {
if (result.data && result.data.length > 0 && result.data[0] !== null) {
$.each(result.data, function (index, item) {
if(item.dataType=="1"){
html +='<div class="detection-style detection-incline">';
let modeName = nullToEmpty(item.modeName);
let val = nullToEmpty(item.val);
html +='<div style="cursor: pointer;" class="detection-style detection-incline" onclick="getTrend(\'' +deviceId+ '\', \'' +item.id+ '\')">' ;
html +='<div class="detection-style-font">';
html +='<div class="detection-style-font-top">倾斜检测</div>';
html +='<div class="detection-style-font-bot">倾角'+item.val +'</div>';
html +='<div class="detection-style-font-top">'+ modeName +'</div>';
html +='<div class="detection-style-font-bot">'+ val +'</div>';
html +='</div>';
html +='</div>';
}else if(item.dataType=="2"){
html +='<div class="detection-style detection-tension">';
html +='<div class="detection-style-font">';
html +='<div class="detection-style-font-top">张力检测</div>';
html +='<div class="detection-style-font-bot">张力'+item.val +'</div>';
html +='</div>';
html +='</div>';
}else if(item.dataType=="3"){
html +='<div class="detection-style detection-crash">';
html +='<div class="detection-style-font">';
html +='<div class="detection-style-font-top">碰撞检测</div>';
html +='<div class="detection-style-font-bot">碰撞'+item.val +'</div>';
html +='</div>';
html +='</div>';
}
})
//当日检测变化趋势
getTrend(deviceId,result.data[0].id)
}else{
html += '<div style="color:red;">未找到关联设备</div>'
html += '<div style="color:#71757B;">无数据</div>'
}
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
@ -163,15 +122,22 @@ function getRealTimeDetection(deviceId){
}, aqEnnable);
}
function getTrend(deviceId){
let paramData = 'bidCode=' + bidCode + '&roleCode=' + roleCode + '&orgId=' + orgId + '&userId=' + userId + '&deviceId=' + deviceId;
function nullToEmpty(name){
if (name === null || name === undefined) {
name = "";
}
return name
}
function getTrend(deviceId,id){
let paramData = 'bidCode=' + bidCode + '&roleCode=' + roleCode + '&orgId=' + orgId + '&userId=' + userId + '&deviceId=' + deviceId + '&id=' + id;
let montageParam = aqEnnable ? encryptCBC(paramData) : ' &' + encryptCBC(paramData);
const url = commonUrl + "screen/largeScreen/towerAssInspect/getTrend?params="+montageParam; // url
ajaxRequestGet(url, "GET", true, function () {
}, function (result) {
let html = '';
if (result.code === 200) {
if (result.data && result.data.length > 1) {
if (result.data && result.data.length > 0 && result.data[0] !== null) {
let xLabel =[];
let dataValue = [];
$.each(result.data, function (index, item) {
@ -180,12 +146,12 @@ function getTrend(deviceId){
});
initEchartsOne(xLabel,dataValue);
}else{
html += '<div style="color:red;">未找到关联设备</div>'
initEchartsOne([],[]);
}
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
$('#tendency').empty().append(html);
}, function (xhr, status, error) {
error(xhr, status, error)
setData(null);

View File

@ -76,8 +76,8 @@
</div>
<!-- 变化趋势 -->
<div class="top-box-right">
<div class="img-style tendency" id="tendency">
<div class="img-style tendency" >
<div id="tendency" style="height: 100%;width: 100%;"></div>
</div>
</div>
</div>