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

469 lines
17 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" />
<link rel="stylesheet" href="../../css/ztree/metro/ztree.css">
<style>
html, body {
height: 100%;
width: 100%;
overflow: hidden;
}
.header {
width: 100%;
height: 10%;
}
.content {
width: 100%;
height: 90%;
}
.content_left {
width: 50%;
height: 100%;
float: left;
}
.content_right {
width: 50%;
height: 100%;
float: left;
}
.content_left_top {
width: 100%;
height: 50%;
}
.content_left_bottom {
width: 100%;
height: 50%;
}
</style>
</head>
<body style="border: 1px solid #0c6f89;
background: rgba(12, 70, 100, 0.8);
padding: 20px;
box-sizing: border-box;
">
<div style="
position: absolute;
top: 0;
bottom: 0px;
left: 0;
width: 270px;
min-height: 500px;
border: 1px solid #0c6f89;
background: rgba(12, 70, 100, 0.8);
border-radius:4px;
">
<blockquote class="layui-elem-quote title">机构目录</blockquote>
<div style="width: 100%;height: calc(100% - 52px);overflow: auto">
<ul id="ztree" class="ztree"></ul>
</div>
</div>
<div class="layui-col-lg10 layui-col-md10 layui-col-xs10" style="
position: absolute;
left: 290px;
right: 0;
top: 0;
bottom: 0;
z-index: 998;
width: auto;
overflow: hidden;
overflow-y: auto;
box-sizing: border-box;
border: 1px solid #0c6f89;
background: rgba(12, 70, 100, 0.8);
border-radius: 4px;
padding: 20px;
">
<div class="header">
<blockquote class="layui-elem-quote quoteBox" style="padding-left:0; padding-top:0;">
<form class="layui-form">
<div class="layui-input-inline">
<input type="checkbox" id="is_content" name='is_content' lay-filter="is_content" value="1" title="包含下级所属单位" />
</div>
<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">
<div class="content_left">
<div class="content_left_top" id="echartid_1">
</div>
<div class="content_left_bottom" id="echartid_2">
</div>
</div>
<div class="content_right">
<table lay-filter="demo">
<thead>
<tr>
<th lay-data="{field:'name', width:110}">巡更任务</th>
<th lay-data="{field:'EMP_NAME', width:95}">巡更人员</th>
<th lay-data="{field:'state', width:87}">完成情况</th>
<th lay-data="{field:'all', width:87}">总巡查点</th>
<th lay-data="{field:'wxc', width:87}">未巡查点</th>
<th lay-data="{field:'yxc', width:87}">已巡查点</th>
<th lay-data="{field:'yxcw', width:100}">巡查隐患点</th>
</tr>
</thead>
<tbody id="listHtml">
</tbody>
</table>
</div>
</div>
</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.config({
base: '../../js/'
}).use(['form', 'layer', 'table', 'laydate', 'ztree'], function () {
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : top.layer,
table = layui.table,
laydate = layui.laydate;
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
//var OrgId = "fbbb44bb458c4336a84e009df74c8598";
//转换静态表格
//table.init('demo', {
// height: 315 //设置高度
// , limit: 10 //注意:请务必确保 limit 参数(默认:10)是与你服务端限定的数据条数一致
// //支持所有基础参数
//});
var selTreeID = "";
var $zTree, OrgList = [];
var setting = {
view: {
selectedMulti: false
},
data: {
key: {
name: "NAME"
},
simpleData: {
enable: true,
type: "TYPE",
idKey: "ID",
pIdKey: "PID"
}
},
edit: {
enable: false
},
callback: {
onClick: function (e, treeId, treeNode) {
selTreeID = treeNode.ID;
OrgId = treeNode.ID;
alarmSta();
}
}
};
//初始化树
$(function () {
$.ajax({
type: "post",
url: "/ashx/SysEmpHandler.ashx",
data: { Action: "getOrgOnlyTree", OrgId: OrgId },
dataType: "json",
success: function (result) {
var zNodes = result.data;
if (zNodes.length > 0) {
for (var i in zNodes) {
OrgList.push(zNodes[i].ID);
}
}
$zTree = $.fn.zTree.init($("#ztree"), setting, zNodes);
var nodes = $zTree.getNodes();
for (var i = 0; i < nodes.length; i++) {
$zTree.expandNode($zTree.getNodes()[i], true, false, false);
}
}
});
});
//今天的时间
var day2 = new Date();
day2.setTime(day2.getTime());
var s2 = day2.getFullYear() + "-" + (day2.getMonth() + 1) + "-" + day2.getDate();
laydate.render({
elem: '#searchTime'
, format: 'yyyy-M-d'
, value: s2
});
//任务完成饼状图
var myChart1 = echarts.init(document.getElementById('echartid_1'));
option1 = {
title: {
text: '巡更任务统计',
left: 80,
top: 10,
textStyle: {
color: '#ffffff'
}
},
legend: {
// 控制水平还是竖直
orient: 'horizontal',
// 控制左右距离
x: 'center',
// 控制上下距离
y: '3%',
data: ['巡查中', '已完成', '未完成'],
textStyle: {
color: '#ffffff'
}
},
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
saveAsImage: {}
}
, right: 50
},
grid: { top: '55%' },
series: [
{
type: 'pie',
radius: '50%',
center: ['50%', '50%'],
label: {
formatter: '{b}: {c} ({d}%)'
},
data: [
{
value: 0, name: '巡查中', itemStyle: {
normal: {
color: '#5cbff2',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '已完成', itemStyle: {
normal: {
color: '#65d75c',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '未完成', itemStyle: {
normal: {
color: '#f07d7d',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
}
],
}
]
};
myChart1.setOption(option1);
window.onresize = function () {
myChart1.resize();
};
var myChart2 = echarts.init(document.getElementById('echartid_2'));
option2 = {
title: {
text: '巡更点统计',
left: 80,
top: 10,
textStyle: {
color: '#ffffff'
}
},
legend: {
// 控制水平还是竖直
orient: 'horizontal',
// 控制左右距离
x: 'center',
// 控制上下距离
y: '3%',
data: ['未巡查', '无隐患', "有隐患"],
textStyle: {
color: '#ffffff'
}
},
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
saveAsImage: {}
}
, right: 50
},
grid: { top: '55%' },
series: [
{
type: 'pie',
radius: '50%',
center: ['50%', '50%'],
label: {
formatter: '{b}: {c} ({d}%)'
},
data: [
{
value: 0, name: '未巡查', itemStyle: {
normal: {
color: '#a5a3a3',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '无隐患', itemStyle: {
normal: {
color: '#65d75c',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '有隐患', itemStyle: {
normal: {
color: '#f07d7d',
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
}
],
}
]
};
myChart2.setOption(option2);
window.onresize = function () {
myChart2.resize();
};
function alarmSta() {
var is_content = "";
$("input:checkbox[name='is_content']:checked").each(function (i) {
is_content = $(this).val();
});
var time = $("#searchTime").val();
var bardata = [], piedata = [];
$.post("../../ashx/OaPatrolTaskHandler.ashx", {
Action: "patrolSta",
Org_Id: OrgId,
s_time: time,
random: new Date().getTime(),//随机参数
is_content: is_content
}, function (res) {
if (res.code == 1) {
var xunchazhong = 0, yiwancheng = 0, weiwancheng = 0;
var wxc = 0, yxc = 0, yxcw = 0;
var varlisthtml = "";
for (var index in res.data) {
obj = res.data[index];
var statehtml = "";
if (obj.STATE == '0') {
xunchazhong++;
statehtml = "巡检中";
}
else if (obj.STATE == '1') {
yiwancheng++;
statehtml = "已完成";
}
else if (obj.STATE == '2') {
weiwancheng++;
statehtml = "未完成";
}
wxc += obj.WXC;
yxc += obj.YXC;
yxcw += obj.YXCW;
varlisthtml += "<tr>";
varlisthtml += " <td>" + obj.NAME + "</td>";
varlisthtml += " <td>" + obj.EMP_NAME + "</td>";
varlisthtml += " <td>" + statehtml + "</td>";
varlisthtml += " <td>" + (obj.WXC + obj.YXC + obj.YXCW) + "</td>";
varlisthtml += " <td>" + obj.WXC + "</td>";
varlisthtml += " <td>" + obj.YXC + "</td>";
varlisthtml += " <td>" + obj.YXCW + "</td>";
varlisthtml += "</tr>";
}
option1.series[0].data[0].value = xunchazhong;
option1.series[0].data[1].value = yiwancheng;
option1.series[0].data[2].value = weiwancheng;
myChart1.setOption(option1);
option2.series[0].data[0].value = wxc;
option2.series[0].data[1].value = yxc;
option2.series[0].data[2].value = yxcw;
myChart2.setOption(option2);
$("#listHtml").html(varlisthtml);
//转换静态表格
table.init('demo', {
height: 615 //设置高度
, limit: res.data.length //注意:请务必确保 limit 参数(默认:10)是与你服务端限定的数据条数一致
});
} else {
//转换静态表格
table.init('demo', {
height: 615 //设置高度
, limit: 0 //注意:请务必确保 limit 参数(默认:10)是与你服务端限定的数据条数一致
});
}
}, "JSON");
}
$(".search_btn").click(function () {
alarmSta();
});
alarmSta();
})
</script>
<link rel="stylesheet" href="../../css/right-list.css" media="all" />
<link rel="stylesheet" href="../../css/bulletframebg.css" media="all" />
</body>
</html>