Merge remote-tracking branch 'origin/master'
commit
b362108099
@ -0,0 +1,246 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('温度阵列传感器曲线')" />
|
||||
<th:block th:include="include :: layout-latest-css" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="ui-layout-west">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-grid"></i> 测控点信息
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="测控点信息"><i class="fa fa-edit"></i></a>
|
||||
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-content">
|
||||
<div id="tree" class="ztree"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui-layout-center">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<input type="hidden" id="monitorId" name="monitorId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li class="select-time">
|
||||
<label>采集时间:</label><input type="text" class="form-control" style="width: 150px" id="laydate-demo-3" placeholder="开始时间" name="params[beginCollectTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="form-control" id="laydate-demo-4" style="width: 150px" placeholder="结束时间" name="params[endCollectTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ibox-content" style="margin-top: 80px;margin-right: 0px;">
|
||||
<div class="echarts" id="echarts-line-chart" style="height: 620px"></div>
|
||||
</div>
|
||||
<!-- <div class="col-sm-12 select-table table-striped">-->
|
||||
<!-- <table id="bootstrap-table"></table>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: layout-latest-js" />
|
||||
<th:block th:include="include :: ztree-js" />
|
||||
<th:block th:include="include :: echarts-js" />
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "system/ArrayTemperatureData"
|
||||
var timedata=[];
|
||||
var tempreturedata=[];
|
||||
var humdata=[];
|
||||
layui.use('laydate', function(){
|
||||
var laydate = layui.laydate;
|
||||
|
||||
laydate.render({
|
||||
elem: '#laydate-demo-3',
|
||||
type: 'datetime',
|
||||
trigger: 'click'
|
||||
});
|
||||
|
||||
laydate.render({
|
||||
elem: '#laydate-demo-4',
|
||||
type: 'datetime',
|
||||
trigger: 'click'
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
var panehHidden = false;
|
||||
getdata(null);
|
||||
if ($(this).width() < 769) {
|
||||
panehHidden = true;
|
||||
}
|
||||
$('body').layout({ initClosed: panehHidden, west__size: 185 });
|
||||
queryDeptTree();
|
||||
});
|
||||
|
||||
function queryDeptTree()
|
||||
{
|
||||
var url = ctx + "system/Monitor/treeData?monitorType=30";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 1,
|
||||
onClick : zOnClick,
|
||||
|
||||
};
|
||||
$.tree.init(options);
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
$("#monitorId").val(treeNode.id);
|
||||
$.table.search();
|
||||
getdata(treeNode.id);
|
||||
}
|
||||
}
|
||||
|
||||
$('#btnExpand').click(function() {
|
||||
$._tree.expandAll(true);
|
||||
$(this).hide();
|
||||
$('#btnCollapse').show();
|
||||
});
|
||||
|
||||
$('#btnCollapse').click(function() {
|
||||
$._tree.expandAll(false);
|
||||
$(this).hide();
|
||||
$('#btnExpand').show();
|
||||
});
|
||||
|
||||
$('#btnRefresh').click(function() {
|
||||
queryDeptTree();
|
||||
});
|
||||
|
||||
/* 社区信息 */
|
||||
function dept() {
|
||||
var url = ctx + "system/Monitor";
|
||||
$.modal.openTab("测控点信息", url);
|
||||
}
|
||||
|
||||
function getdata(monitorId) {
|
||||
var formData = new FormData();
|
||||
formData.append("monitorId",monitorId);
|
||||
formData.append("startTime",$("#laydate-demo-3").val());
|
||||
formData.append("endTime",$("#laydate-demo-4").val());
|
||||
$.ajax({
|
||||
url: prefix + "/getHighestPointTemperature",
|
||||
type: 'post',
|
||||
cache: false,
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: "json",
|
||||
success: function(result) {
|
||||
console.log(result);
|
||||
result.data.forEach(function(e){
|
||||
// console.log(e.fluxData);
|
||||
timedata.push(e.collectTime);
|
||||
tempreturedata.push(e.tempreture);
|
||||
// humdata.push(e.humidity);
|
||||
});
|
||||
design();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function design() {
|
||||
var lineChart = echarts.init(document.getElementById("echarts-line-chart"));
|
||||
var lineoption = {
|
||||
title: {
|
||||
text: '温度阵列传感器最高温度曲线',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
animation: false
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['温度'],
|
||||
left: 10
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
dataZoom: {
|
||||
yAxisIndex: 'none'
|
||||
},
|
||||
restore: {},
|
||||
saveAsImage: {}
|
||||
}
|
||||
},
|
||||
axisPointer: {
|
||||
link: { xAxisIndex: 'all' }
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
show: true,
|
||||
realtime: true,
|
||||
start: 0,
|
||||
end: 100,
|
||||
xAxisIndex: 0
|
||||
},
|
||||
{
|
||||
type: 'inside',
|
||||
realtime: true,
|
||||
start: 30,
|
||||
end: 70,
|
||||
xAxisIndex: 0
|
||||
}
|
||||
],
|
||||
grid: {
|
||||
left: 50,
|
||||
right: 50,
|
||||
height: '60%' // 调整height值以适应图表位置
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
axisLine: { onZero: true },
|
||||
data: timedata
|
||||
},
|
||||
yAxis: {
|
||||
name: '温度',
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '温度',
|
||||
type: 'line',
|
||||
symbolSize: 8,
|
||||
hoverAnimation: false,
|
||||
data: tempreturedata,
|
||||
smooth: true,
|
||||
markPoint: {
|
||||
data: [
|
||||
{ type: 'max', name: '最大值' },
|
||||
{ type: 'min', name: '最小值' }
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
lineChart.setOption(lineoption,true);
|
||||
$(window).resize(lineChart.resize);
|
||||
timedata.splice(0,timedata.length);
|
||||
tempreturedata.splice(0,tempreturedata.length);
|
||||
humdata.splice(0,humdata.length);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue