';
@@ -90,7 +64,7 @@ function getDeviceList(gtId){
})
getInfo(result.data[0].deviceId)
}else{
- html += '
'
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 +='
';
+ let modeName = nullToEmpty(item.modeName);
+ let val = nullToEmpty(item.val);
+ html +='
' ;
html +='
';
- html +='
倾斜检测
';
- html +='
倾角'+item.val +'
';
+ html +='
'+ modeName +'
';
+ html +='
'+ val +'
';
html +='
';
html +='
';
- }else if(item.dataType=="2"){
- html +='
';
- html +='
';
- html +='
张力检测
';
- html +='
张力'+item.val +'
';
- html +='
';
- html +='
';
- }else if(item.dataType=="3"){
- html +='
';
- html +='
';
- html +='
碰撞检测
';
- html +='
碰撞'+item.val +'
';
- html +='
';
- html +='
';
- }
})
+ //当日检测变化趋势
+ getTrend(deviceId,result.data[0].id)
}else{
- html += '
未找到关联设备
'
+ html += '
无数据
'
}
} 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 += '
未找到关联设备
'
+ 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);
diff --git a/pages/towerAssInspect/towerAssInspect.html b/pages/towerAssInspect/towerAssInspect.html
index 245815e..788c2ab 100644
--- a/pages/towerAssInspect/towerAssInspect.html
+++ b/pages/towerAssInspect/towerAssInspect.html
@@ -76,8 +76,8 @@