首页异常修改
This commit is contained in:
parent
8fe66850c3
commit
c9d78a107d
|
|
@ -136,6 +136,11 @@ body {
|
|||
background-position: center center !important;
|
||||
background-size: initial;
|
||||
}
|
||||
#logo{
|
||||
background: url("../../img/index/pm10.png") no-repeat 0 0 / 100% 100%;
|
||||
background-position: center center !important;
|
||||
background-size: initial;
|
||||
}
|
||||
|
||||
#pro-risk {
|
||||
width: 100%;
|
||||
|
|
|
|||
|
|
@ -64,21 +64,27 @@ function loadRealMonitor(montageParam) {
|
|||
|
||||
/* 实时检测赋值 */
|
||||
function setData(data) {
|
||||
console.log(data)
|
||||
if (data && data.length > 0) {
|
||||
$("#real-time-monitor").empty();
|
||||
$.each(data, function (index, item) {
|
||||
if (item.modelName === '温度') {
|
||||
$('#wd').html(item.val ? item.val : 0);
|
||||
} else if (item.modelName === '湿度') {
|
||||
$('#sd').html(item.val ? item.val : 0);
|
||||
} else if (item.modelName === '噪声') {
|
||||
$('#zs').html(item.val ? item.val : 0);
|
||||
} else if (item.modelName === '光照') {
|
||||
$('#gz').html(item.val ? item.val : 0);
|
||||
} else if (item.modelName === 'pm2') {
|
||||
$('#pm2').html(item.val ? item.val : 0);
|
||||
} else if (item.modelName === 'pm10') {
|
||||
$('#pm10').html(item.val ? item.val : 0);
|
||||
}
|
||||
let div=" <div class=\"layout monitor-data\"> <p><span id=\"wd\">"
|
||||
+item.val+"</span><span>"+item.unit+"</span></p><p>"+item.modelName+"</p>"+
|
||||
" <div id='logo' class=\"monitor-icon\"></div>";
|
||||
$("#real-time-monitor").append(div);
|
||||
// if (item.modelName === '温度') {
|
||||
// $('#wd').html(item.val ? item.val : 0);
|
||||
// } else if (item.modelName === '湿度') {
|
||||
// $('#sd').html(item.val ? item.val : 0);
|
||||
// } else if (item.modelName === '噪声') {
|
||||
// $('#zs').html(item.val ? item.val : 0);
|
||||
// } else if (item.modelName === '光照') {
|
||||
// $('#gz').html(item.val ? item.val : 0);
|
||||
// } else if (item.modelName === 'pm2') {
|
||||
// $('#pm2').html(item.val ? item.val : 0);
|
||||
// } else if (item.modelName === 'pm10') {
|
||||
// $('#pm10').html(item.val ? item.val : 0);
|
||||
// }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="right-box" class="layout">
|
||||
<div id="real-time-monitor" class="layout">
|
||||
<div id="real-time-monitor" class="layout">
|
||||
<div class="layout monitor-data">
|
||||
<p><span id="wd">0</span><span>℃</span></p>
|
||||
<p>温度</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue