wangjianguo 8 tahun lalu
induk
melakukan
c19825dd0b
1 mengubah file dengan 140 tambahan dan 44 penghapusan
  1. 140 44
      VisualInspection/js/statistics/road_manage_statistics.js

+ 140 - 44
VisualInspection/js/statistics/road_manage_statistics.js

@@ -18,6 +18,7 @@ var array_score_order = new Array();
 var array_score_data = new Array();
 var array_score_last = new Array();
 var array_get_score = new Array();
+var array_score_pie = new Array();
 var year_assess ;
 var score_rank;
 var points_assess;
@@ -239,7 +240,7 @@ $(function(){
 	function data_array(data,type){
 		if(type == 1){
 			array_year_score.length = 0;
-		    if(data!='' && data.length!=0){
+		    if(data!=null && data.length!=0){
 				if(data.length<14){
 					for(var i=0;i<14-data.length;i++){
 						// 不足月份补0
@@ -263,7 +264,7 @@ $(function(){
 			min_year = 	eval("Math.min(" + array_year_score.toString() + ")").toFixed(0)-10;	
 		}else if(type == 2){
 			array_points.length=0;
-				if(data!=''){
+				if(data!=null){
 						array_points.push({"value": (data.people_num-(data.score_fifteen+data.score_fifty+data.score_over_fifty)),"name":'满分'});
 						array_points.push({"value": data.score_fifteen,"name":'0-15分'});
 						array_points.push({"value": data.score_fifty,"name":'15-50分'});
@@ -275,7 +276,7 @@ $(function(){
 		}else if(type == 3){
 			array_allStation_score.length=0;
 			array_allStation.length=0;
-			if(data!='' && data.length!=0){
+			if(data!=null && data.length!=0){
 				for(var i=0;i<data.length;i++){
 					array_allStation_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
 				}
@@ -304,7 +305,7 @@ $(function(){
 		}else if(type == 4){
 			array_score_order.length=0;
 			array_score_data.length=0;
-				if(data!='' && data.length!=0){
+				if(data!=null && data.length!=0){
 					for(var i=0;i<data.length;i++){
 						array_score_order.push(data[i].user.truename+"\n"+"("+data[i].user.fee_station_name.substr(0,data[i].user.fee_station_name.length-3)+")");
 						array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
@@ -320,10 +321,27 @@ $(function(){
 	    }else if(type == 5){
 			array_score_last.length=0;
 			array_get_score.length=0;
+
+			// 已有收费站数组 和 对象
+			var feeStationTemp = [] ;
+			var feeStationTempObj = {} ;
+
 				if(data!='' && data.length!=0){
 					for(var i=0;i<data.length;i++){
 						array_get_score.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
+						// 处理data
+						if ( feeStationTempObj[data[i].user.fee_station_name] != null){
+							feeStationTempObj[data[i].user.fee_station_name] += 1 ;
+						}else{
+							feeStationTempObj[data[i].user.fee_station_name] = 1 ;
+							feeStationTemp.push(data[i].user.fee_station_name);
+						}
 				    }
+					for(var x=0; x<feeStationTemp.length; x++){
+						array_score_pie.push({'name':feeStationTemp[x] ,'value':feeStationTempObj[feeStationTemp[x]] });
+					}
+					console.log(feeStationTemp);
+					console.log(feeStationTempObj);
 				 }else{
 					array_score_last.length=0;
 			        array_get_score.length=0;	
@@ -343,9 +361,12 @@ $(function(){
 						rank[i] = i +1;
 					}				
 				}
+
+
 				for(var i=0;i<array_get_score.length;i++){
 					array_score_last.push(data[i].user.truename+"\n"+"("+data[i].user.fee_station_name.substr(
 						0,data[i].user.fee_station_name.length-3)+")"+"\n"+ (rank[i]));
+				
 				}
 	    }else if(type == 6){
 			array_check_type.length=0;
@@ -360,7 +381,7 @@ $(function(){
 			array_points_name.length=0;
 			array_points_pre.length=0;
 			arrar_points_month.length=0;
-			if(data!='' && data.Pmth.length!=0 || data.Tmth.length!=0){
+			if(data!=null && data.Pmth.length!=0 || data.Tmth.length!=0){
 			   data_each_people_points(data);
 			}else{
 				array_points_name.length=0;
@@ -475,7 +496,7 @@ $(function(){
 			points_assess = ec.init(document.getElementById('roadManager-points-assess'),theme);
 		    score_rank = ec.init(document.getElementById('tollStation-score-rank'));
 			rank_pre = ec.init(document.getElementById('people-rank-pre'));
-            rank_suf = ec.init(document.getElementById('people-rank-suf'));
+            rank_suf = ec.init(document.getElementById('people-rank-suf'),theme);
 			check_type = ec.init(document.getElementById('server-check-type'),theme);
 			people_points = ec.init(document.getElementById('each-people-points'));
 			}
@@ -769,73 +790,148 @@ $(function(){
 		 * 图五
 		 */
 		function people_rank_suf(){
-					option = {
-				color : [ '#00ced1' ],// 条形图颜色
+			// 		option = {
+			// 	color : [ '#00ced1' ],// 条形图颜色
+			// 	tooltip : {
+			// 		trigger: 'axis'
+			// 	},
+			// 	noDataLoadingOption :{
+            //         text: '暂无数据',
+            //         effect:'bubble',
+            //         effectOption : {
+            //             effect: {
+            //                 n: 0 //气泡个数为0 
+            //             }
+            //         },
+            //         textStyle: {
+            //             fontSize: 20,
+			// 			fontFamily:'cursive',
+            //             fontWeight: 'bold'
+            //         }
+            //     },
+			// 	grid:{
+            //         width:"88%",	
+            //     },
+			// 	legend: {
+			// 		data:['人员考核得分']
+			// 	},
+			// 	calculable : true,
+			// 	xAxis : [
+			// 		{
+			// 			type : 'category',
+			// 			axisLabel :{  
+            //                interval:0  // 显示x轴所有信息,不隐藏部分  
+            //             },
+			// 			data : array_score_last
+			// 		}
+			// 	],
+			// 	yAxis : [
+			// 		{
+			// 			type : 'value',
+			// 			min : min_suff ,
+			// 			max : 1000
+			// 		}
+			// 	],
+			// 	series : [
+			// 		{
+			// 			name:'人员考核得分',
+			// 			type:'bar',
+			// 			data: array_get_score,
+			// 		    itemStyle: {
+			// 			normal: {
+			// 				label: {
+			// 					show: true,
+			// 					position: 'insideTop'
+			// 				}
+			// 			}
+			// 		},
+            //             markPoint : {
+            //                     data : [
+            //                     {type : 'max', name: '最大值'},
+            //                     {type : 'min', name: '最小值'}
+            //                     ]
+            //                     },
+			// 			markLine : {
+			// 				data : [
+			// 					{type : 'average', name: '平均值'}
+			// 				]
+			// 			}
+			// 		}   
+			// 	]
+			// };
+			option = {
 				tooltip : {
 					trigger: 'axis'
 				},
-				noDataLoadingOption :{
-                    text: '暂无数据',
-                    effect:'bubble',
-                    effectOption : {
-                        effect: {
-                            n: 0 //气泡个数为0 
-                        }
-                    },
-                    textStyle: {
-                        fontSize: 20,
-						fontFamily:'cursive',
-                        fontWeight: 'bold'
-                    }
-                },
-				grid:{
-                    width:"88%",	
-                },
-				legend: {
-					data:['人员考核得分']
+				toolbox: {
+					show : true,
+					y: 'bottom',
+				
 				},
 				calculable : true,
+				grid:{
+                     width:"88%",	
+                },
 				xAxis : [
 					{
 						type : 'category',
-						axisLabel :{  
-                           interval:0  // 显示x轴所有信息,不隐藏部分  
-                        },
+							axisLabel :{  
+								interval:0  // 显示x轴所有信息,不隐藏部分  
+							},
+						splitLine : {show : false},
 						data : array_score_last
 					}
 				],
 				yAxis : [
 					{
 						type : 'value',
-						min : min_suff ,
-						max : 1000
+			 			min : min_suff ,
+			 			max : 1000
 					}
 				],
 				series : [
 					{
-						name:'人员考核得分',
+						name:'平均分',
 						type:'bar',
-						data: array_get_score,
-					    itemStyle: {
+						data:array_get_score,
+						itemStyle: {
 						normal: {
+							color:'#00ced1',
 							label: {
 								show: true,
 								position: 'insideTop'
 							}
 						}
 					},
-                        markPoint : {
-                                data : [
-                                {type : 'max', name: '最大值'},
-                                {type : 'min', name: '最小值'}
-                                ]
-                                },
-						markLine : {
+						markPoint : {
 							data : [
-								{type : 'average', name: '平均值'}
+								{type : 'max', name: '最大值'},
+								{type : 'min', name: '最小值'}
 							]
+						},
+					},
+					{ 
+					name:'搜索引擎细分',
+					type:'pie',
+					tooltip : {
+						trigger: 'item',
+						formatter: '{a} <br/>{b} : {c} ({d}%)'
+					},
+					center: [910,90],
+					radius : [0, 40],
+					itemStyle : {
+						normal : {
+							label:{ 
+								show: true, 
+								formatter: '{b} :\n{c}人 ({d}%)' 
+							}, 
+							labelLine : {
+								length : 20
+							}
 						}
-					}   
+					},
+					data:array_score_pie
+				}
 				]
 			};