软测单独项目
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.
 
 
 
 
 
 

203 lines
7.8 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" />
<style>
html, body {
height: 100%;
width: 100%;
overflow: hidden;
}
.header {
width: 100%;
height: 10%;
}
.content {
width: 100%;
height: 90%;
}
</style>
</head>
<body style="border: 1px solid #0c6f89;
background: rgba(12, 70, 100, 0.8);
padding: 20px;
box-sizing: border-box;
">
<div style="margin:0 auto;text-align: center;">
<form class="layui-form" style="width: 100%">
<span id="orgName" style="line-height: 40px;font-size: 22px;font-weight: bold;text-indent : 20px;letter-spacing: 3px; "></span>
<div class="layui-input-inline">
<input type="text" class="layui-input" id="searchTime">
</div>
<div class="layui-input-inline">
<span id="span_1" style="float: left;line-height: 40px;font-size: 22px;font-weight: bold;">车辆出入统计</span>
</div>
<div class="layui-input-inline">
<input type="checkbox" id="is_content" name='is_content' lay-filter="is_content" value="1" title="包含下级所属单位">
</div>
</form>
</div>
<div class="content" id="echartid"></div>
<script type="text/javascript" src="../../js/jquery-2.1.3.min.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;
//获取当前日期
var myDate = new Date();
var nowY = myDate.getFullYear();
var nowM = myDate.getMonth() + 1;
var lastY = nowY;
var lastM = nowM + 1;
if (nowM == "12") {
lastY = nowY + 1;
lastM = "1";
}
laydate.render({
elem: '#searchTime',
type: 'month',
value: nowY + '-01 - ' + lastY + '-' + (lastM < 10 ? "0" + lastM : lastM),
isInitValue: true,
range: true,
done: function (value) {
if (value.indexOf(" - ") != -1) {
var startDate = value.split(" - ")[0]
var endDate = value.split(" - ")[1];
carAccessSta(startDate, endDate);
}
}
});
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
var OrgName = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgName;
$("#orgName").html(OrgName);
var myChart = echarts.init(document.getElementById('echartid'));
option = {
color: ["#4ad054", "#ffc322"],
title: {
text: '车辆出入统计',
left: 150,
textStyle: {
color:'#FFFFFF'
}
},
legend: {
data: ['进', '出'], textStyle: { color:'#FFFFFF'}},
tooltip: {},
toolbox: {
feature: {
saveAsImage: {}
}
, right: 50
},
dataset: {
dimensions: ['product', '进', '出'],
source: [
{ product: '公务车', '进': 0, '出': 0 },
{ product: '执勤车', '进': 0, '出': 0 },
{ product: '地方车', '进': 0, '出': 0 }
]
},
xAxis: {
type: 'category',
axisLine: {
lineStyle: {
color: '#FFFFFF'
}
}
},
yAxis: {
minInterval: 1, type: 'value', name: '次数', axisLine: {
lineStyle: {
color: '#FFFFFF'
}
} },
series: [
{ name: '进', type: 'bar', barWidth: '15%' },
{ name: '出', type: 'bar', barWidth: '15%' }
]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
//监听包含下级复选框
form.on('checkbox(is_content)', function (data) {
carAccessSta();
});
function carAccessSta(startDate, endDate) {
if (startDate == null || startDate == "" || endDate == null || endDate == "") {
startDate = nowY + '-01';
endDate = lastY + '-' + (lastM < 10 ? "0" + lastM : lastM)
}
var is_content = "";
$("input:checkbox[name='is_content']:checked").each(function (i) {
is_content = $(this).val();
});
$.post("../../ashx/CarHandler.ashx", {
Action: "carAccessSta2",
Org_Id: OrgId,
S_Time: startDate,
E_Time: endDate,
is_content: is_content,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
var num = res.data;
num.forEach(function (value, index, arr) {
if (value.CLASS == "0" && value.INOROUT == "0") {
option.dataset.source[0]. = value.NUM;
}
else if (value.CLASS == "0" && value.INOROUT == "1") {
option.dataset.source[0]. = value.NUM;
}
else if (value.CLASS == "1" && value.INOROUT == "0") {
option.dataset.source[1]. = value.NUM;
}
else if (value.CLASS == "1" && value.INOROUT == "1") {
option.dataset.source[1]. = value.NUM;
}
else if (value.CLASS == "2" && value.INOROUT == "0") {
option.dataset.source[2]. = value.NUM;
}
else if (value.CLASS == "2" && value.INOROUT == "1") {
option.dataset.source[2]. = value.NUM;
}
});
myChart.setOption(option);
} else {
}
}, "JSON");
}
carAccessSta();
})
</script>
<link rel="stylesheet" href="../../css/right-list.css" media="all" />
<link rel="stylesheet" href="../../css/bulletframebg.css" media="all" />
</body>
</html>