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

294 lines
12 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>
</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 OrgId="fbbb44bb458c4336a84e009df74c8598";
var myChart = echarts.init(document.getElementById('echartid'));
option = {
title: {
text: '车辆实力统计',
left: 'center',
textStyle: {
color: '#ffffff'
}
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
type: 'scroll',
orient: 'vertical',
right: 10,
top: 20,
bottom: 20,
data: ["公务车", "执勤车", "地方车"],
textStyle: {
color: '#ffffff'
}
},
series: [
{
name: '车辆实力',
type: 'pie',
radius: '55%',
center: ['40%', '50%'],
itemStyle: {
normal: {
label: {
formatter: function (params) {
console.log(params);
if (params.name !== "") {
return params.name + ":" + params.value;
} else {
return "";
}
}
}
}
},
data: [
{
value: 0, name: '公务车', itemStyle: {
normal: {
color: '#5cbff2',
shadowBlur: 15,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '执勤车', itemStyle: {
normal: {
color: '#ff9f7f',
shadowBlur: 15,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
},
{
value: 0, name: '地方车', itemStyle: {
normal: {
color: '#ffdb5c',
shadowBlur: 15,
shadowColor: 'rgba(0, 0, 0, 0.4)'
}
}
}],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart.setOption(option);
window.onresize = function () {
myChart.resize();
};
myChart.off("dblclick")
myChart.on('dblclick', function (params) {
goItemCar(params.dataIndex)
})
var goItemCar = function (type) {
var is_content = "";
$("input:checkbox[name='is_content']:checked").each(function (i) {
is_content = $(this).val();
});
var clientWidth = parseInt(document.body.clientWidth * 0.72) + 'px';
var clientHeight = parseInt(document.body.clientHeight * 0.8) + 'px';
layui.layer.open({
title: "车辆列表",
type: 2,
area: [clientWidth, clientHeight],
maxmin: false,
content: "carStrengthStaItem.html?oid=" + OrgId + "&type=" + type + "&isContent=" + is_content
});
}
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;
personStrengthSta();
}
}
};
//初始化树
$.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 personStrengthSta() {
var is_content = "";
$("input:checkbox[name='is_content']:checked").each(function (i) {
is_content = $(this).val();
});
$.post("../../ashx/CarHandler.ashx", {
Action: "homeCarSta2",
Org_Id: OrgId,
is_content: is_content,
random: new Date().getTime()//随机参数
}, function (res) {
if (res.code == 1) {
var num = res.data[0];
option.series[0].data[0].value = num.GW;
option.series[0].data[1].value = num.ZQ;
option.series[0].data[2].value = num.SJ;
myChart.setOption(option);
} else {
}
}, "JSON");
}
personStrengthSta();
//搜索【此功能需要后台配合,所以暂时没有动态效果演示】
$(".search_btn").on("click", function () {
personStrengthSta();
})
})
</script>
<link rel="stylesheet" href="/css/right-list.css" media="all" />
<link rel="stylesheet" href="/css/bulletframebg.css" media="all" />
</body>
</html>