202 lines
6.9 KiB
Plaintext
202 lines
6.9 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8"%>
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
|
<html>
|
|
<head>
|
|
<title>
|
|
<spring:message code="traffic_ip_active"></spring:message>
|
|
</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="page-content">
|
|
<div class="theme-panel hidden-xs hidden-sm">
|
|
<button type="button" class="btn btn-default" onClick="javascript:window.location.reload()"><i class="fa fa-refresh"></i></button>
|
|
<button type="button" class="btn btn-default" onClick="javascript:window.location='${ctx}/dashboard/logChart'"><i class="fa fa-history"></i></button>
|
|
</div>
|
|
<h3 class="page-title">
|
|
<spring:message code="${searchAction}"></spring:message>
|
|
</h3>
|
|
<div class="row" >
|
|
<form:form id="searchForm" method="get" class="form-search">
|
|
<!-- 搜索内容与操作按钮栏 -->
|
|
<div class="col-md-12">
|
|
<div class="pull-left">
|
|
<div class="input-group">
|
|
<div class="input-group-btn">
|
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
|
</div>
|
|
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
|
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
|
</div>
|
|
</div>
|
|
<div class="pull-left">
|
|
<div class="input-group">
|
|
<div class="input-group-btn">
|
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
|
</div>
|
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
|
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'${endDate}'});"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pull-left">
|
|
<button type="button" class="btn blue" onClick="return searchList()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
|
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
|
</div>
|
|
</div>
|
|
<!-- 搜索内容与操作按钮栏 -->
|
|
</form:form>
|
|
</div>
|
|
<div id="chart" style="width:97%;height:550px;"></div>
|
|
|
|
<input id="searchAction" name="searchAction" type="hidden" value="${searchAction}"/>
|
|
<input id="beginDateh" type="hidden" value="${beginDate}"/>
|
|
<input id="endDateh" type="hidden" value="${endDate}"/>
|
|
|
|
</div>
|
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var starth=$("#beginDateh").val();
|
|
var endh=$("#endDateh").val();
|
|
$("#beginDate").val(starth);
|
|
$("#endDate").val(endh);
|
|
actionTransAjax($("#searchAction").val(),starth,endh);
|
|
//筛选功能初始化
|
|
$("#resetBtn").on("click",function(){
|
|
$("select.selectpicker").each(function(){
|
|
$(this).selectpicker('val',$(this).find('option:first').val());
|
|
$(this).find("option").attr("selected",false);
|
|
$(this).find("option:first").attr("selected",true);
|
|
});
|
|
$(".Wdate").attr("value",'');
|
|
$("#searchForm")[0].reset();
|
|
});
|
|
|
|
setInterval(function(){
|
|
actionTransAjax($("#searchAction").val(),starth,new Date().Format("yyyy-MM-dd HH:mm:00"));
|
|
},500000);// 五分钟调用一次
|
|
});
|
|
function searchList(){
|
|
loading();
|
|
var start=$("#beginDate").val();
|
|
var end=$("#endDate").val();
|
|
if(start==''||end==''||end==null||start==null){
|
|
window.location.reload();
|
|
}else{
|
|
actionTransAjax($("#searchAction").val(),start,end);
|
|
}
|
|
}
|
|
// 局点信息
|
|
function showActionTransChart(rs){
|
|
var data=new Array();
|
|
var xData=new Array();
|
|
xData=rs[0].statTime;
|
|
var series=new Array();
|
|
$(rs).each(function(i, d) {
|
|
var entrance="";
|
|
if(d!=null&&d.entranceId==1){
|
|
entrance="Astana";
|
|
}
|
|
if(d!=null&&d.entranceId==2){
|
|
entrance="Alamty";
|
|
}
|
|
series.push({
|
|
name: entrance,
|
|
data: d.count
|
|
});
|
|
})
|
|
var chart = Highcharts.chart('chart', {
|
|
chart:{
|
|
// type: 'area',
|
|
zoomType: 'x'
|
|
},
|
|
exporting: {
|
|
filename:'Action-Trans',
|
|
scale:1,
|
|
sourceWidth: 1280,
|
|
sourceHeight: 500,
|
|
buttons: {
|
|
contextButton: {
|
|
menuItems: [
|
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印
|
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg
|
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel
|
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs
|
|
]
|
|
}
|
|
}
|
|
},
|
|
title: {
|
|
text: null
|
|
},
|
|
xAxis: {
|
|
type:'category',
|
|
categories: xData,
|
|
title: {
|
|
text: 'time',
|
|
align:'high',
|
|
},
|
|
labels: {
|
|
rotation: -45, //倾斜的角度
|
|
},
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: null
|
|
}
|
|
},
|
|
credits:{//是否有highcharts水印
|
|
enabled:false
|
|
},
|
|
plotOptions: {
|
|
series: {
|
|
marker: {
|
|
radius: 2,
|
|
hover: {
|
|
enabled: true,
|
|
radius: 7,
|
|
radiusPlus: 5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// legend: {
|
|
// layout: 'vertical',
|
|
// align: 'right',
|
|
// verticalAlign: 'middle'
|
|
// },
|
|
series: series,
|
|
});
|
|
}
|
|
// 动作一小时,间隔五分钟统计数据
|
|
function actionTransAjax(searchAction,beginDate,endDate){
|
|
loading();
|
|
$.ajax({
|
|
url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction+"&beginDate="+beginDate+"&endDate="+endDate,
|
|
type : "get" ,
|
|
dataType:"json",
|
|
cache:false,
|
|
async:true,
|
|
success:function (rs) {
|
|
showActionTransChart(rs);
|
|
closeTip();
|
|
},
|
|
error: function(data, textStatus, errorThrown){
|
|
closeTip();
|
|
},
|
|
complete:function(XMLHttpRequest,status){//超时设置
|
|
closeTip();
|
|
}
|
|
});
|
|
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |