软测单独项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

152 lines
5.1 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>出入统计</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
<link rel="stylesheet" href="../../css/public.css" media="all" />
<style>
html, body {
height: 100%;
width: 100%;
overflow: hidden;
}
.header {
width: 100%;
height: 10%;
}
.content {
width: 100%;
height: 90%;
}
</style>
</head>
<body>
<div class="header">
<blockquote class="layui-elem-quote quoteBox">
<form class="layui-form">
<div class="layui-inline">
<div class="layui-input-inline">
<input type="text" class="layui-input" id="searchTime" placeholder="开始 到 结束">
</div>
<a class="layui-btn search_btn" data-type="reload">搜索</a>
</div>
</form>
</blockquote>
</div>
<div class="content" id="echartid">
</div>
<script src="../../js/jquery-2.1.3.min.js"></script>
<script src="../../js/jq_extend.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script src="../../js/echarts.min.js"></script>
<script type="text/javascript">
layui.use(['form', 'layer', 'table', 'laydate'], function () {
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : top.layer,
table = layui.table,
laydate = layui.laydate;
laydate.render({
elem: '#searchTime'
, range: '到'
, format: 'yyyy-M-d'
});
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
var myChart = echarts.init(document.getElementById('echartid'));
option = {
title: {
text: '人员出入统计',
left: 150
},
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
saveAsImage: {}
}
, right: 50
},
legend: {
data: ['人员出入统计']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
},
yAxis: {
name: "次数",
type: 'value',
minInterval: 1
},
series: [
{
name: '人员出入统计',
type: 'line',
stack: '总量',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}
]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
function pAlarmSta() {
var time = $("#searchTime").val();
var times = ["", ""];
if (time) {
times = time.split('到');
}
var xdata = [], data = [];
$.post("../../ashx/PersonAccessHandler.ashx", {
Action: "personAccessSta",
Org_Id: OrgId,
S_Time: times[0],
E_Time: times[1],
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
var num = res.data;
num.forEach(function (value, index, arr) {
xdata.push(value.RIQI);
data.push(value.NUM);
});
option.xAxis.data = xdata;
option.series[0].data = data;
myChart.setOption(option);
} else {
}
},"JSON");
}
$(".search_btn").click(function () {
pAlarmSta();
});
pAlarmSta();
})
</script>
</body>
</html>