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

283 lines
11 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%;
}
</style>
</head>
<body>
<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>
<ul id="ztree" class="ztree"></ul>
</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-inline">
<div class="layui-input-inline">
<input type="checkbox" checked="" id="is_content" lay-filter="bellow" name='is_content' value="1" title="包含下级所属单位">
</div>
<a class="layui-btn search_btn" data-type="reload">搜索</a>
</div>
</form>
</blockquote>
</div>
<div class="content" id="echartid">
</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(['ztree', 'form', 'layer', 'table'], function () {
var form = layui.form,
layer = parent.layer === undefined ? layui.layer : top.layer,
table = layui.table;
var OrgId = JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
var myChart = echarts.init(document.getElementById('echartid'));
option = {
title: {
text: '人员在岗统计',
left: 150,
textStyle: {
color: '#ffffff'
}
},
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
toolbox: {
feature: {
saveAsImage: {}
}
, right: 50
},
legend: {
data: ['人员在岗统计'],
textStyle: {
color: '#ffffff'
}
},
xAxis: {
type: 'category',
data: ['在岗', '借用', '休假', '请假', '学习', '培训', '帮工', '住院', '出差', '出国', '滞留部队', '其他'],
axisLine: {
lineStyle: {
color: '#ffffff'
}
}
},
yAxis: {
name: "人数",
type: 'value',
minInterval: 1,
splitLine: {
lineStyle: {
color: 'rgba(255,255,255,.2)'
}
},
axisLine: {
lineStyle: {
color: '#ffffff'
}
}
},
series: [{
name: '人员在岗统计',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
type: 'bar',
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#1fa1f3'
}, {
offset: 1,
color: '#7eccfd'
}]),
shadowColor: 'rgba(0, 0, 0, 0.1)',
shadowBlur: 10,
barBorderRadius: [50, 50, 0, 0],
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#1fa1f3',
fontSize: 24
}
}
}
}
}]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
var $zTree, OrgList = [];
var setting = {
view: {
selectedMulti: false
},
check: {
enable: true
},
data: {
key: {
name: "NAME"
},
simpleData: {
enable: true,
type: "TYPE",
idKey: "ID",
pIdKey: "PID"
}
},
edit: {
enable: false
},
callback: {
onClick: function (e, treeId, treeNode) {
OrgId = treeNode.ID;
personSta();
}
}
};
//初始化树
$.ajax({
type: "post",
url: "../../ashx/SysEmpHandler.ashx",
data: { Action: "OrgDeptTree", OrgId: OrgId },
dataType: "json",
success: function (result) {
var data = result.data;
var zNodes = [];
if (data.length > 0) {
for (var i in data) {
if (data[i].TYPE == "org") {
OrgList.push(data[i].ID);
zNodes.push(data[i]);
}
}
}
$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);
}
}
});
//延迟展开根节点
setTimeout(function () {
var nodes = $zTree.getNodes();
for (var i = 0; i < nodes.length; i++) {
$zTree.expandNode($zTree.getNodes()[i], true, false, false);
}
}, 500);
//每次加载节点触发的方法
function onAsyncSuccess(event, treeId, treeNode, msg) {
//递归展开子节点
if (treeNode != undefined) {
expandNodes(treeNode.children, "ztree");
}
}
//递归展开子节点
function expandNodes(nodes, treeId) {
if (!nodes) return;
var zTree = $.fn.zTree.getZTreeObj(treeId);
for (var i = 0, l = nodes.length; i < l; i++) {
zTree.expandNode(nodes[i], true, false, false);
if (nodes[i].isParent && nodes[i].zAsync) {
expandNodes(nodes[i].children, treeId);
}
}
}
function personSta() {
var data = [];
var is_content = "";
$("input:checkbox[name='is_content']:checked").each(function (i) {
is_content = $(this).val();
});
$.post("../../ashx/SysEmpHandler.ashx", {
Action: "personSta",
Org_Id: OrgId,
is_content: is_content,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
var num = res.data[0];
var QT = num.JY + num.XJ + num.XX + num.PX + num.BG + num.ZY + num.CG + num.ZLBD + num.QT
data.push(num.ZG);
data.push(num.JY);
data.push(num.XJ);
data.push(num.QJ);
data.push(num.XX);
data.push(num.PX);
data.push(num.BG);
data.push(num.ZY);
data.push(num.CC);
data.push(num.CG);
data.push(num.ZLBD);
data.push(QT);
option.series[0].data = data;
myChart.setOption(option);
} else {
}
}, "JSON");
}
personSta();
//搜索【此功能需要后台配合,所以暂时没有动态效果演示】
$(".search_btn").on("click", function () {
personSta();
})
})
</script>
<link rel="stylesheet" href="/css/right-list.css" media="all" />
<link rel="stylesheet" href="/css/bulletframebg.css" media="all" />
</body>
</html>