<%@page import="org.activiti.engine.repository.ProcessDefinition" %>
<%@page import="org.activiti.engine.impl.persistence.entity.*" %>
<%@page import="org.activiti.engine.repository.Deployment" %>
<%@page import="com.blueland.bpm.engine.config.model.*" %>
<%@page import="com.blueland.bpm.common.page.*" %>
<%@page import="com.blueland.bpm.common.util.*"%>
<%@page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/commons/meta.jsp" %>
<base href="<%=basePath%>">
<title>人员分析</title>
<script type="text/javascript" src="${ctx }/resource/js/jquery-1.8.3.min.js"></script>
	<%-- <script src="${ctx}/resource/js/plugins/highcharts/highstock.js"></script> --%>
	<script src="${ctx}/resource/js/plugins/highcharts/highcharts.js"></script>
     <script src="${ctx}/resource/js/plugins/highcharts/modules/exporting.js"></script>
     <script src="${ctx}/resource/js/common/processReport.js"></script>
     <script type="text/javascript">
	     $(document).ready(function() {
	    	 getAnalysisData();
	     });
	     function getAnalysisData(){
	    	 //流程统计
	 		$.ajax({
	 			url:"${ctx}/flow/monitor/staffAnalysisDetail.do",
	 			type:"GET",
	 			dataType:"json",
	 			success:function(data){
	 				for (var i = 0; i < eval(data).length; i++) {
	  					getDatas(eval(data)[i]);
					}
	 			},
	 			  
	 		});
	     }
	     function getDatas(item){
	    	 if(item.id =="params"){
    	 		$("#staffTop").text(item.staffTop);
    	 		return;
    	 	}
	    	 var colors = ['#2194ff'];
	    		 //['#2194ff', '#face1d', '#37c461'];
	          Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
	              return {
	                  radialGradient: { cx: 0, cy: -0.8, r: 2.3 },
	                  stops: [[0, color], [2, Highcharts.Color(color).get('rgb')] // darken 
	                  ]
	              };
	          });
	    	 $('#'+item.id).highcharts({
	    		 chart: {
	    				type: 'bar',
	    			},
	    			/* rangeSelector: {
	    				selected: 1
	    			}, */
	    			credits: {  
	    	            enabled: false     //不显示LOGO 
	    	        },  
	    	        exporting: { enabled:false },//导出图表去掉
	    			title: {
	    				text: ''
	    			},
	    			subtitle: {
	    				text: ''
	    			},
	    			scrollbar: {
    					enabled: true
    				},
    				/* xAxis: {
    			        categories: eval(item.list), 			   
    			        min: 25 //3.设置显示个数
    			    }, */
    			    xAxis: {
	    				type: 'category',
	    				labels: {
	    					rotation: 0 // 设置轴标签旋转角度
	    				}
	    			},
	    			yAxis: {
	    				min: 0,
	    				title: {
	    					text: ''
	    				},
	    				/* scrollbar: {
	    					enabled: true,
	    					showFull: false
	    				} */
	    			},
	    			legend: {
	    				enabled: false
	    			},
	    			tooltip: {
	    				pointFormat: '<b>待处理流程最多的员工：{point.y}(个)</b>',
	    				style: {
								"fontSize": "10px",
	        					"color":"#999",							
						}
	    			},
	    			plotOptions: {
	    				series: {
	    					stacking: 'normal',
	    					cursor: 'pointer',
    		                events: {
    		                    click: function(event) {
    		                    	window.location.href="${ctx}/flow/monitor/staffPage.do?appId="+event.point.id;		                    	
    		                    }
    		                }
	    				}
	    			},
	    			series: eval(item.datas)
	    	 });
	     }
     </script>
     <style type="text/css">
    	
     </style>
     
</head>

<body>

<div class="page-content">				                  						

			<div class="row process_monitor">
				<div class="col-sm-12">
					<div class="process_tabs">
						<a class="tabs_link" href="flow/monitor/processAnalysis.do">流程分析</a>
						<a class="tabs_link" href="flow/monitor/actAnalysis.do">节点分析</a>
						<a class="tabs_link active" href="flow/monitor/staffAnalysis.do">人员分析</a>
					</div><!--process_tabs 顶部页签-->
					
					<div class="process_list">
						<div class="list">
							<div class="list-table">
								<div class="cell-img"><img src="${ctx }/resource/css/images/lcjk-icon-9.png" /></div>
								<div class="cell-text"><p class="title">待处理流程最多的员工</p><p class="text" id="staffTop"></p></div>
							</div>
						</div><!--list-->
					</div><!--process_list 图标列表-->
					
					<div class="row">
						<div class="col-sm-12">
							<div class="widget-box ace-box-1">
							  <div class="widget-header widget-header-flat widget-header-small">
								  <h5 class="widget-title">待处理流程最多的员工</h5>	
								  
							  </div>
							  <div class="widget-body">
								  <div class="widget-main algin-center">
									<div id="staffTopTotal" style="min-width:500px;min-height:550px;"></div>
								  </div><!--widget-main -->
							  </div><!--widget-body -->
						  </div>
						</div><!--col-sm-6-->
					</div><!--row-->
					
				</div><!--col-sm-12-->
			</div><!--row process_monitor 流程监控-->
			
		</div><!-- /.page-content -->
	</div><!--main-content-inner-->
</div><!-- /.main-content -->

</body>
</html>