<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>历史详细</title>
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<link href="./css/mui.min.css" rel="stylesheet" />
|
|
<style>
|
.mui-content {
|
width: 96%;
|
margin: auto;
|
}
|
.mui-bar-nav {
|
background: #245ca7;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
}
|
|
.mui-title {
|
color: #FFFFFF;
|
}
|
|
.mui-icon-back:before,
|
.mui-icon-left-nav:before {
|
color: #FFFFFF;
|
}
|
|
/* 粮情总览 */
|
.grain_all {
|
display: block;
|
height: 212px;
|
}
|
|
.grain_all .grain_title {
|
display: block;
|
font-size: 16px;
|
padding: 0 15px;
|
box-sizing: border-box;
|
color: #245ca7;
|
height: 40px;
|
line-height: 40px;
|
background: #FFFFFF;
|
}
|
|
.grain_all .t1 {
|
font-size: 16px;
|
font-weight: 400;
|
}
|
|
.grain_all .t2 {
|
font-size: 18px;
|
}
|
|
.down {
|
float: left;
|
width: 25%;
|
background: #FFFFFF;
|
padding: 10px 0;
|
text-align: center;
|
border-top: 1px #efefef solid;
|
}
|
|
.first {
|
float: left;
|
width: 100%;
|
background: #FFFFFF;
|
padding: 5px 0;
|
border-top: 1px #efefef solid;
|
}
|
|
.first strong {
|
font-weight: 400;
|
float: left;
|
}
|
|
.up {
|
float: left;
|
width: 33.333%;
|
background: #FFFFFF;
|
padding: 10px 0;
|
text-align: center;
|
border-top: 1px #efefef solid;
|
}
|
|
.f1 {
|
border-right: 1px #efefef solid;
|
}
|
|
.grain_title2 {
|
display: block;
|
font-size: 16px;
|
background: #fff;
|
padding: 0 15px;
|
box-sizing: border-box;
|
color: #245ca7;
|
height: 40px;
|
line-height: 40px;
|
margin-top: 5px;
|
}
|
|
.grain_table1 {
|
width: 100%;
|
}
|
|
.grain_table1 table {
|
width: 100%;
|
background-color: #fff !important
|
}
|
|
.grain_table1 th {
|
font-size: 15px;
|
text-align: center;
|
}
|
|
.grain_table1 tr {
|
font-size: 14px;
|
text-align: center;
|
line-height: 35px;
|
border-top: 1px #efefef solid !important;
|
}
|
|
.grain_table1 .yello {
|
color: #ffa800;
|
}
|
|
.grain_table1 .red {
|
color: #f00;
|
}
|
|
.grain_table1 .blue {
|
color: #0020c1;
|
}
|
|
.grain_table2 {
|
width: 100%;
|
overflow: scroll;
|
}
|
|
.grain_table2 table {
|
width: 100%;
|
background-color: #fff !important
|
}
|
|
.grain_table2 tr {
|
font-size: 13px;
|
text-align: center;
|
line-height: 30px;
|
border-top: 1px #efefef solid !important;
|
}
|
.grain_table2 th {
|
font-weight: 400;
|
min-width: 42px;
|
text-align: center;
|
padding: 0 5px;
|
}
|
|
.grain_table2 td {
|
min-width: 42px;
|
text-align: center;
|
padding: 0 5px;
|
}
|
</style>
|
</head>
|
<body>
|
<header class="mui-bar mui-bar-nav">
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
<h1 class="mui-title"><span id="depotName"></span>粮情详细</h1>
|
</header>
|
<div class="mui-content">
|
<div class="grain_all mb-2">
|
<div class="grain_title">
|
<strong>粮情总览</strong>
|
</div>
|
<div class="up">
|
<h3 class="t1">粮均温</h3>
|
<h3 class="t2"><span id="tempAve"></span>℃</h3>
|
</div>
|
<div class="up">
|
<h3 class="t1">粮高温</h3>
|
<h3 class="t2"><span id="tempMax"></span>℃</h3>
|
</div>
|
<div class="up">
|
<h3 class="t1">粮低温</h3>
|
<h3 class="t2"><span id="tempMin"></span>℃</h3>
|
</div>
|
<div class="down">
|
<h3 class="t1">仓内温</h3>
|
<h3 class="t2"><span id="tempIn"></span>℃</h3>
|
</div>
|
<div class="down f1">
|
<h3 class="t1">仓内湿</h3>
|
<h3 class="t2"><span id="humidityIn"></span>%</h3>
|
</div>
|
<div class="down">
|
<h3 class="t1">仓外温</h3>
|
<h3 class="t2"><span id="tempOut"></span>℃</h3>
|
</div>
|
<div class="down">
|
<h3 class="t1">仓外湿</h3>
|
<h3 class="t2"><span id="humidityOut"></span>%</h3>
|
</div>
|
<div class="first">
|
<strong style="padding-left: 15px;">采集时间:</strong>
|
<strong id="receiveDate"></strong>
|
</div>
|
</div>
|
<div class="grain_title2"><strong>各层粮情信息</strong></div>
|
<div class="grain_table1">
|
<table>
|
<thead>
|
<tr>
|
<th width="25%">显示控制</th>
|
<th width="25%" class="yello">平均温</th>
|
<th width="25%" class="red">最高温</th>
|
<th width="25%" class="blue">最低温</th>
|
</tr>
|
</thead>
|
<tbody id="table1">
|
<!-- <tr>
|
<td>
|
<input type="checkbox">
|
<span>1层</span>
|
</td>
|
<td class="yello">###℃</td>
|
<td class="red">###℃</td>
|
<td class="blue">###℃</td>
|
</tr>-->
|
</tbody>
|
</table>
|
</div>
|
<div class="grain_title2"><strong><span id="ceng"></span>层详细粮情</strong></div>
|
<div class="grain_table2" style="margin-top:2px;">
|
<table>
|
<thead id="table2_1">
|
<!-- <tr>
|
<th>圈\列</th>
|
<th>1列</th>
|
<th>2列</th>
|
<th>3列</th>
|
<th>4列</th>
|
<th>5列</th>
|
<th>6列</th>
|
<th>7列</th>
|
<th>8列</th>
|
</tr> -->
|
</thead>
|
<tbody id="table2_2">
|
<!-- <tr>
|
<td>1圈</td>
|
<td>0.0</td>
|
<td>0.0</td>
|
<td>0.0</td>
|
<td>—</td>
|
<td>—</td>
|
<td>—</td>
|
<td>—</td>
|
<td>—</td>
|
</tr>-->
|
</tbody>
|
</table>
|
</div>
|
|
<div style="margin-bottom: 10px;"></div>
|
</div>
|
<script src="./js/mui.js"></script>
|
<script src="./js/jquery.min.js"></script>
|
<script src="./js/echarts.min.js"></script>
|
<script type="text/javascript" charset="utf-8">
|
var grainData; //粮情信息
|
var depotName; //仓库名称
|
var tagCeng; //粮情层数
|
var tagHang; //粮情层数
|
var tagLie; //粮情层数
|
|
mui.init()
|
mui.plusReady(function() {
|
//获取粮情信息、仓库名称等参数
|
var curr = plus.webview.currentWebview();
|
grainData = curr.data;
|
depotName = curr.depotName;
|
$("#depotName").html(depotName);
|
//粮情渲染
|
renderGrain();
|
})
|
|
//渲染粮情数据
|
function renderGrain() {
|
if (grainData != null) {
|
//解析出层,取最大层
|
var array1 = grainData.cableCir.split("-");
|
tagCeng = parseInt(array1[0], 10);
|
for(var i = 1;i<array1.length;i++){
|
if(parseInt(array1[i], 10)>tagLie){
|
tagCeng = parseInt(array1[i], 10);
|
}
|
}
|
//解析出圈
|
tagHang = array1.length;
|
//解析出列,取最大列
|
var array2 = grainData.cable.split("-");
|
tagLie = parseInt(array2[0], 10);
|
for(var i = 1;i<array2.length;i++){
|
if(parseInt(array2[i], 10)>tagLie){
|
tagLie = parseInt(array2[i], 10);
|
}
|
}
|
|
//渲染总览信息
|
$("#tempAve").html(grainData.tempAve);
|
$("#tempMax").html(grainData.tempMax);
|
$("#tempMin").html(grainData.tempMin);
|
$("#tempIn").html(grainData.tempIn);
|
$("#humidityIn").html(grainData.humidityIn);
|
$("#tempOut").html(grainData.tempOut);
|
$("#humidityOut").html(grainData.humidityOut);
|
$("#receiveDate").html(grainData.receiveDate);
|
//渲染各层粮情
|
var tableOne = grainData.details;
|
var html1 = '';
|
tagCeng = tableOne.length;
|
if (tableOne != null && tableOne.length > 0) {
|
$.each(tableOne, function(index, item) {
|
html1 += '<tr><td><input id="check' + item.fz + '" type="checkbox" onclick="showCen(\'' + item.fz + '\')">';
|
html1 += '<span>' + item.fzName + '</span></td>';
|
html1 += '<td class="yello">' + item.tempAve + '℃</td>';
|
html1 += '<td class="red">' + item.tempMax + '℃</td>';
|
html1 += '<td class="blue">' + item.tempMin + '℃</td>';
|
})
|
} else {
|
html1 += '<tr><td colspan="4">暂无数据</td></tr>';
|
}
|
$("#table1").html(html1);
|
//默认选中1层并渲染
|
$("#check1").attr("checked", true);
|
renderTierGrain(1);
|
}
|
}
|
|
//选择层渲染
|
function showCen(fz) {
|
for (var i = 1; i <= tagCeng; i++) {
|
if (fz != i) {
|
$("#check" + i).attr("checked", false);
|
}
|
}
|
renderTierGrain(fz)
|
}
|
|
//渲染某层粮情
|
function renderTierGrain(tag) {
|
|
var tableTwo = grainData.points;
|
//每圈列数
|
var array = grainData.cable.split("-");
|
var html1 = '';
|
var html2 = '';
|
if (tableTwo != null && tableTwo.length > 0) {
|
var arrData = new Array;
|
arrData.push(0);
|
$.each(tableTwo, function(index, item) {
|
if (item.fz == tag) {
|
arrData.push(item.temp);
|
}
|
})
|
if (arrData.length > 1) {
|
var count = 1;
|
html1 += '<tr><th>圈\\列</th>';
|
for (var i = 1; i <= tagHang; i++) {
|
if(count < arrData.length){
|
html2 += '<tr><td>' + i + '圈</td>';
|
var temp = 0;
|
if(i>1){
|
temp = parseInt(array[i-2], 10);
|
}
|
for (var j = 1; j <= tagLie; j ++) {
|
if(i==1){
|
html1 += '<td>' + j + '列</td>';
|
}
|
if(j <= array[i-1]){
|
html2 += '<td>' + arrData[j+temp] + '</td>';
|
count += 1;
|
}else{
|
html2 += '<td>—</td>';
|
}
|
}
|
html1 += '</tr>';
|
html2 += '</tr>';
|
}
|
}
|
}
|
} else {
|
html1 += '<tr><td>暂无数据</td></tr>';
|
}
|
$("#ceng").html(tag);
|
$("#table2_1").html(html1);
|
$("#table2_2").html(html2);
|
}
|
</script>
|
</body>
|
</html>
|