<!DOCTYPE html>
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="description" content="">
|
<meta name="author" content="">
|
|
<title>大屏系统后台任务数据</title>
|
|
<!-- Bootstrap Core CSS -->
|
<link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css">
|
|
<!-- MetisMenu CSS -->
|
<link href="../vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
|
|
<!-- Custom CSS -->
|
<link href="../dist/css/sb-admin-2.css" rel="stylesheet">
|
|
<!-- Morris Charts CSS -->
|
<link href="../vendor/morrisjs/morris.css" rel="stylesheet">
|
|
<!-- Custom Fonts -->
|
<link rel="stylesheet" type="text/css" href="../vendor/font-awesome/css/font-awesome.min.css">
|
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
<!--[if lt IE 9]>
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
<![endif]-->
|
|
<style type="text/css">
|
|
.timeicon
|
{
|
background:url(../img/p.png) center right no-repeat;
|
}
|
|
|
button {
|
height: 32px;
|
}
|
|
|
</style>
|
|
<link rel="stylesheet" href="../ladda/dist/ladda-themeless.min.css">
|
<link rel="stylesheet" href="../ladda/dist/ladda.css">
|
<link rel="stylesheet" href="../ladda/css/prism.css">
|
|
</head>
|
|
<body>
|
<div id="wrapper">
|
<!-- Navigation -->
|
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
<div class="navbar-header">
|
<button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
<span class="sr-only">Toggle navigation</span>
|
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
</button>
|
<a class="navbar-brand" href="index.html">大屏系统后台任务数据</a>
|
</div>
|
<!-- /.navbar-header -->
|
|
<ul class="nav navbar-top-links navbar-right">
|
<li class="dropdown">
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
|
</a>
|
<ul class="dropdown-menu dropdown-user">
|
<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
|
</li>
|
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
|
</li>
|
<li class="divider"></li>
|
<li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
|
</li>
|
</ul>
|
<!-- /.dropdown-user -->
|
</li>
|
<!-- /.dropdown -->
|
</ul>
|
<!-- /.navbar-top-links -->
|
|
<div class="navbar-default sidebar" role="navigation">
|
<div class="sidebar-nav navbar-collapse">
|
<ul class="nav" id="side-menu">
|
<li class="sidebar-search">
|
<div class="input-group custom-search-form">
|
<input type="text" class="form-control" placeholder="Search...">
|
<span class="input-group-btn">
|
<button class="btn btn-default" >
|
<i class="fa fa-search"></i>
|
</button>
|
</span>
|
</div>
|
<!-- /input-group -->
|
</li>
|
<li>
|
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> 概况</a>
|
</li>
|
<li>
|
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 报表<span class="fa arrow"></span></a>
|
<ul class="nav nav-second-level">
|
<li>
|
<a href="flot.html">系统设备</a>
|
</li>
|
<li>
|
<!--
|
<a href="morris.html">Morris.js Charts</a>
|
-->
|
</li>
|
</ul>
|
<!-- /.nav-second-level -->
|
</li>
|
|
<li>
|
<a href="tables.html"><i class="fa fa-table fa-fw"></i> 表格<span class="fa arrow"></span></a>
|
<ul class="nav nav-second-level">
|
<li>
|
<a href="alluser.html">所有用户</a>
|
</li>
|
<li>
|
<a href="allequ.html">所有设备</a>
|
</li>
|
<li>
|
<a href="allnotice.html">通知用户</a>
|
</li>
|
<li>
|
<a href="allalarm.html">报警设备</a>
|
</li>
|
|
</ul>
|
<!-- /.nav-second-level -->
|
|
|
</li>
|
|
</ul>
|
</div>
|
<!-- /.sidebar-collapse -->
|
</div>
|
<!-- /.navbar-static-side -->
|
</nav>
|
|
<div id="page-wrapper">
|
<div class="row">
|
<div class="col-lg-12">
|
<h1 class="page-header">报表</h1>
|
</div>
|
<!-- /.col-lg-12 -->
|
</div>
|
<!-- /.row -->
|
<div class="row">
|
<div class="col-lg-12">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
系统报警数据
|
</div>
|
<!-- /.panel-heading -->
|
<div class="panel-body">
|
<div id="toolbar" >
|
<input id="stime" class="timeicon" type="text" style="display: inline-block; position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 起始时间" readonly >
|
</input>
|
--
|
<input id="etime" class="timeicon" type="text" style="display:inline-block;position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 结束时间" readonly>
|
</input>
|
|
<div class="btn-group btn-group-sm" >
|
<button id="search_system_alarm" class="btn btn-primary ladda-button" data-style="expand-right" data-color="blue" data-size="xs" >查询</button>
|
</div>
|
|
</div>
|
|
<div>
|
<div style="height:500px;margin-left:-90px;width: auto " id="system_alarm"></div>
|
</div>
|
</div>
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-12 -->
|
<br>
|
<div class="col-lg-12">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
设备报警数据
|
</div>
|
<!-- /.panel-heading -->
|
<div class="panel-body">
|
<div id="toolbarequ" >
|
<input id="stimeequ" class="timeicon" type="text" style="display: inline-block; position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 起始时间" readonly >
|
</input>
|
--
|
<input id="etimeequ" class="timeicon" type="text" style="display:inline-block;position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 结束时间" readonly>
|
</input>
|
|
<div class="btn-group btn-group-sm" >
|
<button class="btn btn-default"><span id="equlistselect">选择设备</span></button>
|
<button class="btn btn-default dropdown-toggle"
|
data-toggle="dropdown">
|
<span class="caret"></span>
|
<span class="sr-only">切换下拉菜单</span>
|
</button>
|
<ul id="equlists" class="dropdown-menu" role="menu">
|
<!--
|
<li name="abc"><a href ="javascript:void(0)">设备一</a></li>
|
-->
|
</ul>
|
</div>
|
|
<div class="btn-group btn-group-sm" >
|
<button id="searchequ" class="btn btn-default ladda-button" data-style="expand-right" data-color="blue" data-size="xs" >查询</button>
|
</div>
|
|
|
|
</div>
|
|
<div>
|
<div style="height:500px;margin-left:-90px;width: auto " id="equalarm"></div>
|
<div id="equalarm_tip" style="position:absolute;left: 600px;top:280px;">请输入查询条件进行查询</div>
|
</div>
|
</div>
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-6 -->
|
<br>
|
<div class="col-lg-12">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
设备传感器历史数据
|
</div>
|
<!-- /.panel-heading -->
|
<div class="panel-body">
|
|
<div id="toolbarhistory" >
|
<input id="stimehistory" class="timeicon" type="text" style="display: inline-block; position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 起始时间" readonly >
|
</input>
|
--
|
<input id="etimehistory" class="timeicon" type="text" style="display:inline-block;position: relative;height:32px;border:1px solid #cfcfcf;border-radius:4px;padding-top:0px"placeholder=" 结束时间" readonly>
|
</input>
|
|
<div class="btn-group btn-group-sm" >
|
<button id="equlisthistoryselect" class="btn btn-default">选择设备</button>
|
<button class="btn btn-default dropdown-toggle"
|
data-toggle="dropdown">
|
<span class="caret"></span>
|
<span class="sr-only">切换下拉菜单</span>
|
</button>
|
<ul id="equlisthistory" class="dropdown-menu" role="menu">
|
<!--
|
<li name="abc"><a href ="javascript:void(0)">设备一</a></li>
|
-->
|
</ul>
|
</div>
|
|
<div class="btn-group btn-group-sm" >
|
<button id="sensorselect" class="btn btn-default">选择传感器</button>
|
<button class="btn btn-default dropdown-toggle"
|
data-toggle="dropdown">
|
<span class="caret"></span>
|
<span class="sr-only">切换下拉菜单</span>
|
</button>
|
<ul id="sensor" class="dropdown-menu" role="menu">
|
<!--<li name="abc"><a href ="javascript:void(0)">设备一</a></li>
|
-->
|
</ul>
|
</div>
|
|
<div class="btn-group btn-group-sm" >
|
<button id="searchhistory" class="btn btn-default ladda-button" data-style="expand-right" data-color="blue" data-size="xs" >查询</button>
|
</div>
|
</div>
|
|
<div >
|
<div id="equhistory" style="height: 500px;margin-left:-90px;width: auto "></div>
|
<div id="equhistory_tip" style="position:absolute;left: 600px;top:280px;">请输入查询条件进行查询</div>
|
|
</div>
|
|
|
</div>
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-6 -->
|
<div class="col-lg-6">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
待定xxxxxxxx
|
</div>
|
<!-- /.panel-heading -->
|
<div class="panel-body">
|
<div class="flot-chart">
|
<div class="flot-chart-content" id="flot-line-chart-moving"></div>
|
</div>
|
</div>
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-6 -->
|
<div class="col-lg-6">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
待定xxxxxxxx
|
</div>
|
<!-- /.panel-heading -->
|
<div class="panel-body">
|
<div class="flot-chart">
|
<div class="flot-chart-content" id="flot-bar-chart"></div>
|
</div>
|
</div>
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-6 -->
|
<div class="col-lg-12">
|
<div class="panel panel-default">
|
<div class="panel-heading">
|
待定xxxxxxxx
|
</div>
|
<!-- /.panel-heading -->
|
<!-- <div class="panel-body">
|
<p>Flot is a pure JavaScript plotting library for jQuery, with a focus on simple usage, attractive looks, and interactive features. In SB Admin, we are using the most recent version of Flot along with a few plugins to enhance the user experience. The Flot plugins being used are the tooltip plugin for hoverable tooltips, and the resize plugin for fully responsive charts. The documentation for Flot Charts is available on their website, <a target="_blank" href="http://www.flotcharts.org/">http://www.flotcharts.org/</a>.</p>
|
<a target="_blank" class="btn btn-default btn-lg btn-block" href="http://www.baidu.com">View Flot Charts Documentation</a>
|
</div>-->
|
<!-- /.panel-body -->
|
</div>
|
<!-- /.panel -->
|
</div>
|
<!-- /.col-lg-6 -->
|
</div>
|
<!-- /.row -->
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<div class="modal-dialog">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
×
|
</button>
|
<h4 class="modal-title" id="myModalLabel">
|
提示
|
</h4>
|
</div>
|
<div class="modal-body">
|
请填写完整的查询条件
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<!-- /#page-wrapper -->
|
|
</div>
|
<!-- /#wrapper -->
|
|
<!-- jQuery -->
|
<script src="../vendor/jquery/jquery.min.js"></script>
|
|
<!-- Bootstrap Core JavaScript -->
|
<script src="../vendor/bootstrap/js/bootstrap.min.js"></script>
|
|
<!-- Metis Menu Plugin JavaScript -->
|
<script src="../vendor/metisMenu/metisMenu.min.js"></script>
|
|
<!-- Flot Charts JavaScript -->
|
<script src="../vendor/flot/excanvas.min.js"></script>
|
<script src="../vendor/flot/jquery.flot.js"></script>
|
<script src="../vendor/flot/jquery.flot.pie.js"></script>
|
<script src="../vendor/flot/jquery.flot.resize.js"></script>
|
<script src="../vendor/flot/jquery.flot.time.js"></script>
|
<script src="../vendor/flot-tooltip/jquery.flot.tooltip.min.js"></script>
|
<!--
|
<script src="../data/flot-data.js"></script>
|
-->
|
|
<!-- Custom Theme JavaScript -->
|
<script src="../dist/js/sb-admin-2.js"></script>
|
|
|
<!--time-->
|
<link rel="stylesheet" type="text/css" href="../date/jedate/skin/jedate.css">
|
<script src="../date/jedate/jquery.jedate.min.js"></script>
|
|
<script src="../echarts/echarts.common.min.js"></script>
|
|
<script src="../ladda/dist/spin.min.js"></script>
|
<script src="../ladda/dist/ladda.js"></script>
|
|
|
|
<script>
|
|
Ladda.bind('#search_system_alarm');
|
Ladda.bind('#searchequ');
|
Ladda.bind('#searchhistory');
|
|
$(function (){
|
// 系统报警数据初始化
|
var systemalarmChart = echarts.init(document.getElementById('system_alarm'));
|
optionsystemalarmChart = {
|
/* title: {
|
text: '未来一周气温变化',
|
subtext: '纯属虚构'
|
},*/
|
tooltip: {
|
trigger: 'axis',
|
formatter: function(params)
|
{
|
|
|
var string=null;
|
var level=params[0].value;
|
if(level==1){
|
string=":三级"
|
}else if(level==2){
|
string=":二级"
|
}else if(level==3){
|
string=":一级"
|
}
|
return params[0].name+'<br><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#c23531"></span>'+params[0].seriesName+string;
|
}
|
},
|
legend: {
|
/* data:['最高气温']*/
|
},
|
toolbox: {
|
show: true,
|
feature: {
|
magicType: {type: ['line', 'bar']},
|
},
|
right:160
|
},
|
xAxis: {
|
type: 'category',
|
boundaryGap: true,
|
data: []
|
},
|
yAxis: {
|
type: 'value',
|
max:4,
|
axisLabel: {
|
formatter: function (value, index) {
|
var date = new Date(value);
|
var texts = [];
|
if (index === 2) {
|
texts.push('三级');
|
}
|
if (index === 4) {
|
texts.push('二级');
|
}
|
if(index==6){
|
texts.push('一级');
|
}
|
return texts;
|
}
|
}
|
,
|
splitNumber:6
|
},
|
series: [
|
{
|
name:'警报级别',
|
type:'bar',
|
itemStyle : {
|
/* normal : {
|
lineStyle:{
|
color:'#00FF00'
|
}
|
}*/
|
},
|
data:[]
|
}
|
]
|
};
|
$.ajax({
|
type:'GET',
|
url:'/alarmtime',/*复用,与首页报表用的同一请求*/
|
dataType:'json',
|
async:false,
|
cache:false,
|
success:function(data){
|
optionsystemalarmChart.xAxis.data=data.xtime;
|
optionsystemalarmChart.series[0].data=data.yvalue;
|
systemalarmChart.setOption(optionsystemalarmChart);
|
}
|
});
|
|
|
// 设备报警数据初始化
|
var Equalarm = echarts.init(document.getElementById('equalarm'));
|
optionEqualarm = {
|
tooltip: {
|
trigger: 'axis',
|
formatter: function(params)
|
{
|
var val= params[0].name;
|
var s= val.split("_");
|
|
var string=null;
|
var level=params[0].value;
|
if(level==1){
|
string=":三级"
|
}else if(level==2){
|
string=":二级"
|
}else if(level==3){
|
string=":一级"
|
}
|
return s[0]+'<br><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#c23531"></span>'+params[0].seriesName+string+
|
'<br><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:#c23531"></span>'+s[1];
|
}
|
},
|
legend: {
|
},
|
toolbox: {
|
show: true,
|
feature: {
|
},
|
right:160
|
},
|
xAxis: {
|
type: 'category',
|
boundaryGap: true,
|
data: [],
|
axisLabel:{
|
formatter:function(val) {
|
var s =val.split("_");
|
return s[0];
|
}
|
}
|
},
|
yAxis: {
|
type: 'value',
|
max:4,
|
axisLabel: {
|
formatter: function (value, index) {
|
var date = new Date(value);
|
var texts = [];
|
if (index === 2) {
|
texts.push('三级');
|
}
|
if (index === 4) {
|
texts.push('二级');
|
}
|
if(index==6){
|
texts.push('一级');
|
}
|
return texts;
|
}
|
}
|
,
|
splitNumber:6
|
},
|
series: [
|
{
|
name:'警报级别',
|
type:'line',
|
itemStyle : {
|
},
|
data:[]
|
}
|
]
|
};
|
Equalarm.setOption(optionEqualarm);
|
/*设备列表初始化,传感器历史数据报表也一起初始化*/
|
$.ajax({
|
type:'GET',
|
url:'/equlist',
|
dataType:'json',
|
async:false,
|
cache:false,
|
success:function(data){
|
$("#equlists").html("");
|
for(var i=0;i<data.length;i++){
|
$("#equlists").append('<li name="'+data[i].mac+'"><a href ="javascript:void(0)">'+data[i].name+'</a></li>');
|
}
|
|
$("#equlisthistory").html("");
|
for(var i=0;i<data.length;i++){
|
$("#equlisthistory").append('<li name="'+data[i].mac+'"><a href ="javascript:void(0)">'+data[i].name+'</a></li>');
|
}
|
|
}
|
});
|
|
|
// 传感器历史数据
|
var Equhistory = echarts.init(document.getElementById('equhistory'));
|
optionhistory = {
|
tooltip: {
|
trigger: 'axis'
|
/*,
|
formatter: function(params)
|
{
|
var string=null;
|
var level=params[0].value;
|
if(level==1){
|
string=":三级"
|
}else if(level==2){
|
string=":二级"
|
}else if(level==3){
|
string=":一级"
|
}
|
return params[0].name+'<br>'+params[0].seriesName+string;
|
}
|
*/
|
},
|
legend: {
|
},
|
toolbox: {
|
show: true,
|
feature: {
|
},
|
right:160
|
},
|
xAxis: {
|
type: 'category',
|
boundaryGap: true,
|
data: []
|
},
|
yAxis: {
|
type: 'value',
|
axisLabel: {
|
formatter:''
|
}
|
},
|
series: [
|
{
|
name:'',
|
type:'line',
|
itemStyle : {
|
normal : {
|
color:'#2a6cff',
|
lineStyle:{
|
color:'#2a6cff'
|
}
|
}
|
},
|
data:[]
|
}
|
]
|
};
|
Equhistory.setOption(optionhistory);
|
|
|
/*系统报警数据日期*/
|
var start = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: '2016-06-16 23:59:59',
|
ishmsVal: false,
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
end.minDate = date; //开始日选好后,重置结束日的最小日期
|
endDates();
|
}
|
};
|
var end = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: $.nowDate({
|
DD: 0
|
}),
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
start.maxDate = date; //将结束日的初始值设定为开始日的最大日期
|
}
|
};
|
//日期联动
|
function endDates() {
|
//将结束日期的事件改成 false 即可
|
end.trigger = false;
|
$("#etime").jeDate(end);
|
}
|
$('#stime').jeDate(start);
|
$('#etime').jeDate(end);
|
/*设备报警数据日期*/
|
var startequ = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: '2016-06-16 23:59:59',
|
ishmsVal: false,
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
endequ.minDate = date; //开始日选好后,重置结束日的最小日期
|
endDatesequ();
|
}
|
};
|
var endequ = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: $.nowDate({
|
DD: 0
|
}),
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
startequ.maxDate = date; //将结束日的初始值设定为开始日的最大日期
|
}
|
};
|
//日期联动
|
function endDatesequ() {
|
//将结束日期的事件改成 false 即可
|
endequ.trigger = false;
|
$("#etimeequ").jeDate(endequ);
|
}
|
$('#stimeequ').jeDate(startequ);
|
$('#etimeequ').jeDate(endequ);
|
/*设备传感器历史数据日期*/
|
var starthistory = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: '2016-06-16 23:59:59',
|
ishmsVal: false,
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
endhistory.minDate = date; //开始日选好后,重置结束日的最小日期
|
endDateshistory();
|
}
|
};
|
var endhistory = {
|
format: 'YYYY-MM-DD hh:mm:ss',
|
minDate: $.nowDate({
|
DD: 0
|
}),
|
maxDate: $.nowDate({
|
DD: 0
|
}),
|
choosefun: function(elem, val, date) {
|
starthistory.maxDate = date; //将结束日的初始值设定为开始日的最大日期
|
}
|
};
|
//日期联动
|
function endDateshistory() {
|
endhistory.trigger = false;
|
$("#etimehistory").jeDate(endhistory);
|
}
|
$('#stimehistory').jeDate(starthistory);
|
$('#etimehistory').jeDate(endhistory);
|
|
|
|
/*系统报警数据查询事件*/
|
$('#search_system_alarm').bind("click",function () {
|
var stime= $('#stime').val();
|
var etime= $('#etime').val();
|
if(stime==""||etime==""){
|
Ladda.stopAll();
|
$('#myModal').modal('show');
|
return;
|
}
|
var data={stime:stime,etime:etime};
|
$.ajax({
|
type:'POST',
|
url:'/alarmtimequery',
|
contentType: "application/json;charset=UTF-8",
|
data:JSON.stringify(data),
|
dataType:'json',
|
async:false,
|
cache:false,
|
success:function(data){
|
optionsystemalarmChart.xAxis.data=data.xtime;
|
optionsystemalarmChart.series[0].data=data.yvalue;
|
optionsystemalarmChart.series[0].type='bar';
|
optionsystemalarmChart.xAxis.boundaryGap=true;
|
systemalarmChart.setOption(optionsystemalarmChart);
|
Ladda.stopAll();
|
|
}
|
});
|
})
|
|
|
|
/*设备报警下拉框事件*/
|
var equalarm_mac=null;
|
$('#equlists li').bind('click', function(){
|
var text =$(this).text();
|
var s =$("#equlistselect").text(text);
|
equalarm_mac=$(this).attr("name")
|
});
|
|
/*设备报警查询事件*/
|
$('#searchequ').bind("click",function () {
|
var stime= $('#stimeequ').val();
|
var etime= $('#etimeequ').val();
|
if(stime==""||etime==""||equalarm_mac==null){
|
Ladda.stopAll();
|
$('#myModal').modal('show');
|
return;
|
}
|
var data={stime:stime,etime:etime,mac:equalarm_mac};
|
$.ajax({
|
type:'POST',
|
url:'/equalarms',
|
contentType: "application/json;charset=UTF-8",
|
data:JSON.stringify(data),
|
dataType:'json',
|
async:true,
|
cache:false,
|
success:function(data){
|
var count=data.yvalue.length;
|
optionEqualarm.xAxis.data=data.xtime;
|
optionEqualarm.series[0].data=data.yvalue;
|
optionEqualarm.xAxis.boundaryGap=false;
|
Equalarm.setOption(optionEqualarm);
|
if(count==0){
|
$("#equalarm_tip").html("没有查询到相关的数据");
|
}else {
|
$("#equalarm_tip").html("");
|
}
|
Ladda.stopAll();
|
}
|
});
|
|
})
|
|
|
/*传感器历史记录下拉框事件*/
|
var equhistory_mac=null;
|
var equhistory_sensor=null;
|
$('#equlisthistory li').bind('click', function(){
|
var text =$(this).text();
|
var s =$("#equlisthistoryselect").text(text);
|
equhistory_mac=$(this).attr("name")
|
/*根据mac联动传感器*/
|
$.ajax({
|
type:'GET',
|
url:'/equsensor',
|
dataType:'json',
|
data:{mac:equhistory_mac},
|
async:false,
|
cache:false,
|
success:function(data){
|
/*动态生成二级下拉框的传感器*/
|
$("#sensor").html("");
|
$("#sensorselect").text("选择传感器");
|
for(var i=0;i<data.length;i++){
|
$("#sensor").append('<li><a href ="javascript:void(0)">'+data[i].sensor+'</a></li>');
|
}
|
}
|
});
|
/*二级下拉框事件,先生成,再绑定*/
|
$('#sensor li').bind('click', function(){
|
var text =$(this).text();
|
equhistory_sensor=text;
|
var s =$("#sensorselect").text(text);
|
});
|
});
|
|
/*传感器历史查询记录*/
|
$('#searchhistory').bind("click",function () {
|
var stime= $('#stimehistory').val();
|
var etime= $('#etimehistory').val();
|
|
if(stime==""||etime==""||equhistory_mac==null||equhistory_sensor==null){
|
Ladda.stopAll();
|
$('#myModal').modal('show');
|
return;
|
}
|
/*查询历史记录*/
|
var data={stime:stime,etime:etime,mac:equhistory_mac,sensor:equhistory_sensor}
|
$.ajax({
|
type:'POST',
|
url:'/sensorhistory',
|
contentType: "application/json;charset=UTF-8",
|
data:JSON.stringify(data),
|
dataType:'json',
|
async:true,
|
cache:false,
|
success:function(data){
|
var count=data.yvalue.length;
|
optionhistory.xAxis.data=data.xtime;
|
optionhistory.series[0].data=data.yvalue;
|
optionhistory.series[0].name=data.sensor;
|
optionhistory.yAxis.axisLabel.formatter='{value}'+data.units;
|
optionhistory.xAxis.boundaryGap=false;
|
Equhistory.setOption(optionhistory);
|
if(count==0){
|
$("#equhistory_tip").html("没有查询到相关的数据");
|
}else {
|
$("#equhistory_tip").html("");
|
}
|
Ladda.stopAll();
|
}
|
});
|
})
|
})
|
|
</script>
|
|
|
</body>
|
|
</html>
|