toll_station_statistics.js 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. var year = new Date().getFullYear();
  2. var month = new Date().getMonth();
  3. var date = new Date().getDate();
  4. var select_road = $(".div-roadManage select").val();
  5. var select_station = $("#second").val();
  6. var array_year_score = new Array();
  7. var array_points = new Array();
  8. var array_check_type = new Array();
  9. var array_points_name = new Array();
  10. var array_points_pre = new Array();
  11. var arrar_points_month = new Array();
  12. var array_score_order = new Array();
  13. var array_score_data = new Array();
  14. var array_five_name = new Array();
  15. var array_five_score = new Array();
  16. var array_five_name_back = new Array();
  17. var array_five_score_back = new Array();
  18. var year_assess;
  19. var points_assess;
  20. var check_type;
  21. var people_points;
  22. var score_rank;
  23. var rank_assess;
  24. var rank_assess_back;
  25. var min_year;
  26. var min_five;
  27. var min_five_back;
  28. var min_score;
  29. var flag = false;
  30. var change_echart = 2;
  31. $(function(){
  32. setVisit();
  33. // 公用方法,根据当前年月动态将13个月push数组
  34. month_method();
  35. // 公用方法,月份下拉框
  36. // select_option();
  37. $.jeDate("#month_date",{
  38. isinitVal:true,
  39. format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
  40. });
  41. var road_manager;
  42. if(roleContains("STATION")){
  43. road_manager = getCurrentUser().road_manager_id;
  44. }
  45. setRoadManagerSelect("#first",road_manager);
  46. // 回显当前年月份
  47. // $(".div-month select").val(initDate);
  48. setSecond();
  49. refresh(true);
  50. $(".div-button button").click(function(){
  51. refresh(flag);
  52. flag = false ;
  53. });
  54. // 加载图配置
  55. // echart();
  56. // 如果道管中心下拉框改变,点击时加载图一
  57. $(".div-station select").change(function(){
  58. flag = true;
  59. });
  60. function refresh(flag){
  61. var select_month = $("#month_date").val();
  62. var select_station = $(".div-station select").val();
  63. // 加载图配置
  64. echart(flag);
  65. echart_change();
  66. echart_change2();
  67. if(flag ==true ){
  68. init_tollStation_year_assess("statistics/score/year/info",select_station);
  69. }
  70. // flag = false;
  71. top5_change(select_month,select_station);
  72. // 查询图二
  73. init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
  74. // 查询图四
  75. init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
  76. // 查询图五
  77. // console.log(select_month+","+select_station);
  78. init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
  79. // 查询图六
  80. init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
  81. }
  82. /**
  83. * 初始化图一
  84. */
  85. function init_tollStation_year_assess(url,select_station){
  86. var param = {
  87. "start_date":(year-1)+"-"+new Date().getMonth()+"-25"+" 23:00:00",
  88. "end_date":year+"-"+(new Date().getMonth()+1)+"-25"+" 23:00:00",
  89. "dept_id":select_station,
  90. "queryType":2
  91. }
  92. // console.log(param);
  93. initRqueset(url,param,1);
  94. }
  95. /**
  96. * 初始化图二
  97. */
  98. function init_company_points_assess(url,mon,select_station){
  99. var param = {
  100. mth:mon,
  101. "dept_id":select_station,
  102. "queryType":2
  103. }
  104. initRqueset(url,param,2);
  105. }
  106. /**
  107. * 初始化图三 前5名
  108. */
  109. function init_progress_rank_assess(url,mon,select_station){
  110. var prev_mth;
  111. // 判断当前年月是否为一月
  112. if(parseInt((mon+'').substr(5)) == 1){
  113. prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
  114. }else{
  115. if((parseInt((mon+'').substr(5))+'').length == 1){
  116. prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
  117. }else{
  118. prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
  119. }
  120. }
  121. var param = {
  122. "mth": mon,
  123. "dept_id":select_station,
  124. "prev_mth": prev_mth,
  125. "order_type":0
  126. };
  127. initRqueset(url,param,3);
  128. }
  129. /**
  130. * 初始化图四
  131. */
  132. function init_people_score_rank(url,mon,select_station){
  133. var param = {
  134. "mth":mon,
  135. "dept_id":select_station,
  136. "queryType":2,
  137. "order_type":1
  138. }
  139. initRqueset(url,param,4);
  140. }
  141. /**
  142. * 初始化图五
  143. */
  144. function init_server_check_type(url,mon,select_station){
  145. var param = {
  146. "mth":mon,
  147. "dept_id":select_station,
  148. "queryType":2
  149. };
  150. initRqueset(url,param,5);
  151. }
  152. /**
  153. * 初始化图六
  154. */
  155. function init_each_people_points(url,mon,select_station){
  156. var prev_mth;
  157. // 判断当前年月是否为一月
  158. if(parseInt((mon+'').substr(5)) == 1){
  159. prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
  160. }else{
  161. if((parseInt((mon+'').substr(5))+'').length == 1){
  162. prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
  163. }else{
  164. prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
  165. }
  166. }
  167. var param = {
  168. "mth":mon,
  169. "prev_mth": prev_mth,
  170. "dept_id":select_station,
  171. "queryType":2
  172. };
  173. initRqueset(url,param,6);
  174. }
  175. /**
  176. * 图切换后5名
  177. */
  178. function init_backward_rank_assess(url,mon,select_station){
  179. var prev_mth;
  180. // 判断当前年月是否为一月
  181. if(parseInt((mon+'').substr(5)) == 1){
  182. prev_mth = ((parseInt((mon+'').substr(0,4)))-1)+"/12";
  183. }else{
  184. if((parseInt((mon+'').substr(5))+'').length == 1){
  185. prev_mth = (mon+'').substr(0,4) + '/0'+ (parseInt((mon+'').substr(5))-1);
  186. }else{
  187. prev_mth = (mon+'').substr(0,4) + '/'+ (parseInt((mon+'').substr(5))-1);
  188. }
  189. }
  190. var param = {
  191. "mth":mon,
  192. "dept_id":select_station,
  193. "prev_mth": prev_mth,
  194. "order_type":1
  195. };
  196. initRqueset(url,param,7);
  197. }
  198. /**
  199. * 请求
  200. * @param {*} url
  201. * @param {*} param
  202. * @param {*} type
  203. */
  204. function initRqueset(url,param,type){
  205. post_common_service(url,param,function(data){
  206. data_array(data,type);
  207. if(type == 1){
  208. // 画图
  209. year_assess.setOption(tollStation_year_assess());
  210. }else if(type == 2){
  211. // 画图
  212. points_assess.setOption(tollStation_points_assess());
  213. }else if(type == 3){
  214. // 画图
  215. rank_assess.setOption(progress_rank_assess());
  216. }else if(type == 4){
  217. // 画图
  218. score_rank.setOption(people_score_rank());
  219. }else if(type == 5){
  220. // 画图
  221. check_type.setOption(server_check_type());
  222. }else if(type == 6){
  223. // 画图
  224. people_points.setOption(each_people_points());
  225. }else if(type == 7){
  226. // 画图
  227. rank_assess_back.setOption(backward_rank_assess());
  228. }
  229. },function(error){
  230. return "" ;
  231. });
  232. }
  233. /**
  234. * 数组数据
  235. * @param {*} data
  236. * @param {*} type
  237. */
  238. function data_array(data,type){
  239. if(type == 1){
  240. array_year_score.length = 0;
  241. if(data!='' && data.length!=0){
  242. if(data.length<14){
  243. for(var i=0;i<14-data.length;i++){
  244. // 不足月份补0
  245. array_year_score.push(0);
  246. }
  247. }
  248. for(var i=0;i<data.length;i++){
  249. if(months.indexOf(data[i].mth.substr(2))){
  250. // 指定位置插入值
  251. array_year_score.splice(months.indexOf(data[i].mth.substr(2)),0,
  252. (1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
  253. }
  254. }
  255. }else{
  256. array_year_score.length = 0;
  257. months.length = 0;
  258. }
  259. if(eval("Math.min(" + array_year_score.toString() + ")")==0)
  260. min_year = 0;
  261. else
  262. min_year = eval("Math.min(" + array_year_score.toString() + ")").toFixed(0)-10;
  263. }else if(type == 2){
  264. array_points.length=0;
  265. if(data!=''){
  266. array_points.push({"value": (data.people_num-(data.score_fifteen+data.score_fifty+data.score_over_fifty)),"name":'满分'});
  267. array_points.push({"value": data.score_fifteen,"name":'0-15分'});
  268. array_points.push({"value": data.score_fifty,"name":'15-50分'});
  269. array_points.push({"value": data.score_over_fifty,"name":'50分以上'});
  270. }else{
  271. array_points.length=0;
  272. }
  273. }else if(type == 3){
  274. array_five_name.length=0;
  275. array_five_score.length=0;
  276. if(data!='' && data.length!=0){
  277. for(var i=0;i<data.length;i++){
  278. array_five_score.push(data[i].ranking_change);
  279. }
  280. }else{
  281. array_five_name.length=0;
  282. array_five_score.length=0;
  283. }
  284. if(eval("Math.min(" + array_five_score.toString() + ")")==0)
  285. min_five = 0;
  286. else
  287. min_five = eval("Math.min(" + array_five_score.toString() + ")").toFixed(0)-1;
  288. // 给考核进步top5排名次
  289. var rank = new Array();
  290. rank[0] = 1 ;
  291. for(var i=1; i<array_five_score.length; i++){
  292. if(array_five_score[i-1] == array_five_score[i] ){
  293. rank[i] = rank[i-1];
  294. }else{
  295. rank[i] = i + 1;
  296. }
  297. }
  298. for(var i=0;i<array_five_score.length;i++){
  299. array_five_name.push(data[i].user.truename+"\n"+ (rank[i]));
  300. }
  301. }else if(type == 4){
  302. array_score_order.length=0;
  303. array_score_data.length=0;
  304. var m = 1;
  305. if(data!='' && data.length!=0){
  306. for(var i=0;i<data.length;i++){
  307. array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
  308. }
  309. }else{
  310. array_score_order.length=0;
  311. array_score_data.length=0;
  312. }
  313. if(eval("Math.min(" + array_score_data.toString() + ")")==0)
  314. min_score = 0;
  315. else
  316. min_score = eval("Math.min(" + array_score_data.toString() + ")").toFixed(0)-10;
  317. // 给得分人员排名次
  318. var rank = new Array();
  319. rank[0] = 1 ;
  320. for(var i=1; i<array_score_data.length; i++){
  321. if(array_score_data[i-1] == array_score_data[i] ){
  322. rank[i] = rank[i-1];
  323. }else{
  324. rank[i] = i +1;
  325. }
  326. }
  327. for(var i=0;i<array_score_data.length;i++){
  328. array_score_order.push(data[i].user.truename +"\n"+ (rank[i]));
  329. }
  330. }else if(type == 5){
  331. array_check_type.length=0;
  332. if(data.length != 0){
  333. for(var i=0;i<data.length;i++){
  334. array_check_type.push({"value": data[i].all_check_score,"name":data[i].name});
  335. }
  336. }else{
  337. array_check_type.length=0;
  338. }
  339. }else if(type == 6){
  340. array_points_name.length=0;
  341. array_points_pre.length=0;
  342. arrar_points_month.length=0;
  343. if(data!='' && data.Pmth.length!=0 || data.Tmth.length!=0){
  344. data_each_people_points(data);
  345. }else{
  346. array_points_name.length=0;
  347. array_points_pre.length=0;
  348. arrar_points_month.length=0;
  349. }
  350. }else if(type == 7){
  351. array_five_name_back.length=0;
  352. array_five_score_back.length=0;
  353. if(data!=''){
  354. for(var i=0;i<data.length;i++){
  355. if(data[i].ranking_change<0){
  356. array_five_score_back.push((data[i].ranking_change+'').substr(1));
  357. }else{
  358. array_five_score_back.push((data[i].ranking_change+''));
  359. }
  360. }
  361. }else{
  362. array_five_name_back.length=0;
  363. array_five_score_back.length=0;
  364. }
  365. if(eval("Math.min(" + array_five_score_back.toString() + ")")==0){
  366. min_five_back = 0;
  367. }else{
  368. min_five_back = eval("Math.min(" + array_five_score_back.toString() + ")").toFixed(0)-1;
  369. }
  370. // 退步top5排名次
  371. var rank = new Array();
  372. rank[0] = 1 ;
  373. for(var i=1; i<array_five_score_back.length; i++){
  374. if(array_five_score_back[i-1] == array_five_score_back[i] ){
  375. rank[i] = rank[i-1];
  376. }else{
  377. rank[i] = i + 1;
  378. }
  379. }
  380. for(var i=0;i<array_five_score_back.length;i++){
  381. array_five_name_back.push(data[i].user.truename+"\n"+ (rank[i]));
  382. }
  383. }
  384. }
  385. function data_each_people_points(data){
  386. var flag = true;
  387. var name = ['环境卫生','仪容仪表着装','表情','动作','文明用语','工作纪律及行为举止','便民服务','安全管理']
  388. var Tmth = data.Tmth;
  389. var Pmth = data.Pmth;
  390. var Ntemp = new Array();
  391. var Ptemp = new Array();
  392. var Ttemp = new Array();
  393. for(var i= 0; i < name.length;i++){
  394. flag = true;
  395. if(Tmth.length > 0){
  396. for(var j= 0; j< Tmth.length;j++){
  397. if(name[i] == Tmth[j].name && Tmth[j].all_check_score != null){
  398. // Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
  399. Ttemp[i] =Tmth[j].all_check_score;
  400. break;
  401. }else{
  402. Ttemp[i] = 0;
  403. }
  404. }
  405. }else{
  406. Ttemp[i] = 0;
  407. }
  408. if(Pmth.length > 0){
  409. for(var m= 0; m< Pmth.length;m++){
  410. if(name[i] == Pmth[m].name && Pmth[m].all_check_score != null){
  411. // Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
  412. Ptemp[i] =Pmth[m].all_check_score;
  413. break;
  414. }else{
  415. Ptemp[i] = 0;
  416. }
  417. }
  418. }else{
  419. Ptemp[i] = 0;
  420. }
  421. if(Ttemp[i]== 0 && Ptemp[i] == 0){
  422. name[i] = "";
  423. flag = null;
  424. }
  425. if(name[i] != ""){
  426. if(name[i]=='仪容仪表着装'){
  427. name[i]='仪表';
  428. }
  429. if(name[i]=='工作纪律及行为举止'){
  430. name[i]='行为';
  431. }
  432. array_points_name.push(name[i]);
  433. }
  434. if(flag){
  435. array_points_pre.push(Ptemp[i]);
  436. arrar_points_month.push(Ttemp[i]);
  437. }
  438. }
  439. }
  440. /**
  441. * 根据道管中心获取收费站列表(下拉框)
  442. */
  443. $(".div-roadManage select").change(function(){
  444. setSecond();
  445. flag = true ;
  446. });
  447. function setSecond(){
  448. var select_road = $(".div-roadManage select").val();
  449. var feeList = $.zui.store.get("cache_fee_station_list");
  450. if(select_road) feeList = cache_road_manager_fee_list_map.get(select_road);
  451. var dept;
  452. if(roleContains("STATION")){
  453. dept = getCurrentUser().organid;
  454. }
  455. refreshFee(feeList,dept);
  456. // var param = {
  457. // "parentid":select_road
  458. // }
  459. // post_common_service("dept/getDeptInfosByDeptId",param,function(data){
  460. // },function(error){
  461. // return "" ;
  462. // });
  463. }
  464. function refreshFee(data,selectId){
  465. var sec = document.getElementById('second');
  466. var tempStr = ''
  467. if(data.length!=0){
  468. for(var i=0;i<data.length;i++){
  469. // if(select_road==30){
  470. // tempStr += "<option value="+data[i].id+">"+data[i].organname+"</option>";
  471. // }else if(select_road==31){
  472. // tempStr += "<option value="+data[i].id+">"+data[i].organname+"</option>";
  473. // }else{
  474. if(data[i].deptid==selectId)
  475. tempStr += "<option value="+data[i].deptid+" selected>"+data[i].name+"</option>";
  476. else
  477. tempStr += "<option value="+data[i].deptid+">"+data[i].name+"</option>";
  478. // }
  479. sec.innerHTML=tempStr;
  480. }
  481. }else{
  482. sec.innerHTML='';
  483. }
  484. // // 页面初始化
  485. // var select_month = $("#month_date").val();
  486. // var select_station = $("#second").val();
  487. // echart();
  488. // // 进退步top5
  489. // top5_change(select_month,select_station);
  490. // init_tollStation_year_assess("statistics/score/year/info",select_station);
  491. // init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
  492. // init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
  493. // init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
  494. // init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
  495. // flag = false;
  496. }
  497. /**
  498. * 进步前5名后退步前五名切换
  499. */
  500. $(".view_change").click(function(){
  501. var select_month = $("#month_date").val();
  502. var select_station = $("#second").val();
  503. // 进退步top5
  504. top5_change(select_month,select_station);
  505. });
  506. /**
  507. * 进退步top5
  508. * @param {*} select_month
  509. * @param {*} select_station
  510. */
  511. function top5_change(select_month,select_station){
  512. if(change_echart==1){
  513. $("#progress span").text("考核退步Top5排行榜");
  514. $("#progress-rank-assess").css("display","none");
  515. $("#backward-rank-assess").css("display","block");
  516. echart_change();
  517. init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station);
  518. change_echart = 2
  519. }else if(change_echart==2){
  520. $("#progress span").text("考核进步Top5排行榜");
  521. $("#progress-rank-assess").css("display","block");
  522. $("#backward-rank-assess").css("display","none");
  523. echart_change2();
  524. init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station);
  525. change_echart = 1
  526. }
  527. }
  528. /**
  529. * 除数为0处理
  530. * @param {*} num
  531. * @param {*} num1
  532. * @param {*} num2
  533. * @param {*} num4
  534. */
  535. function filter_handler(num,num1,num2,num3){
  536. if(num1 == 0 || num2 == 0){
  537. return num3;
  538. }else{
  539. return ((num/num1)/num2).toFixed(2);
  540. }
  541. }
  542. function filter(num,num1,num2){
  543. if(num1 == 0){
  544. return num2;
  545. }else{
  546. return (num/num1).toFixed(2);
  547. }
  548. }
  549. /**
  550. * 其它图配置
  551. */
  552. function echart(flag){
  553. echart_config(1,flag);
  554. }
  555. /**
  556. * 进步top5图配置
  557. */
  558. function echart_change2(){
  559. echart_config(2,false);
  560. }
  561. /**
  562. * 退步top5图配置
  563. */
  564. function echart_change(){
  565. echart_config(3,false);
  566. }
  567. /**
  568. * 图配置
  569. */
  570. function echart_config(type,flag){
  571. require.config({
  572. paths: {
  573. echarts: '/js/lib/echarts/build/dist'
  574. }
  575. });
  576. require(
  577. [
  578. 'echarts',
  579. 'echarts/theme/macarons',
  580. 'echarts/chart/line',
  581. 'echarts/chart/bar',
  582. 'echarts/chart/pie'
  583. ],
  584. function (ec,theme) {
  585. if(type == 2){
  586. rank_assess = ec.init(document.getElementById('progress-rank-assess'));
  587. }else if(type ==3 ){
  588. rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
  589. }else{
  590. if(flag){
  591. year_assess = ec.init(document.getElementById('tollStation-year-assess'),theme);
  592. }
  593. points_assess = ec.init(document.getElementById('tollStation-points-assess'),theme);
  594. score_rank = ec.init(document.getElementById('people-score-rank'));
  595. check_type = ec.init(document.getElementById('server-check-type'),theme);
  596. people_points = ec.init(document.getElementById('each-people-points'));
  597. rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
  598. }
  599. }
  600. );
  601. }
  602. /**
  603. * 图一
  604. */
  605. function tollStation_year_assess(){
  606. option = {
  607. color : [ '#00ced1' ],
  608. tooltip : {
  609. trigger: 'axis'
  610. },
  611. noDataLoadingOption :{
  612. text: '暂无数据',
  613. effect:'bubble',
  614. effectOption : {
  615. effect: {
  616. n: 0 //气泡个数为0
  617. }
  618. },
  619. textStyle: {
  620. fontSize: 20,
  621. fontFamily:'cursive',
  622. fontWeight: 'bold'
  623. }
  624. },
  625. legend: {
  626. data:['收费站得分']
  627. },
  628. toolbox: {
  629. show : true,
  630. },
  631. calculable : true,
  632. xAxis : [
  633. {
  634. type : 'category',
  635. boundaryGap : false,
  636. data : months
  637. }
  638. ],
  639. yAxis : [
  640. {
  641. type : 'value',
  642. min : min_year ,
  643. max : 1000,
  644. axisLabel : {
  645. formatter: '{value}'
  646. }
  647. }
  648. ],
  649. series : [
  650. {
  651. name:'收费站得分',
  652. type:'line',
  653. data:array_year_score,
  654. markPoint : {
  655. data : [
  656. {type : 'max', name: '最大值'},
  657. {type : 'min', name: '最小值'}
  658. ]
  659. },
  660. markLine : {
  661. data : [
  662. {type : 'average', name: '平均值'}
  663. ]
  664. }
  665. },
  666. ]
  667. };
  668. return option;
  669. }
  670. /**
  671. * 图二
  672. */
  673. function tollStation_points_assess(){
  674. option = {
  675. tooltip : {
  676. trigger: 'item',
  677. formatter: "收费站考核扣分占比 <br/>{b} : {c}人 ({d}%)"
  678. },
  679. noDataLoadingOption :{
  680. text: '暂无数据',
  681. effect:'bubble',
  682. effectOption : {
  683. effect: {
  684. n: 0 //气泡个数为0
  685. }
  686. },
  687. textStyle: {
  688. fontSize: 20,
  689. fontFamily:'cursive',
  690. fontWeight: 'bold'
  691. }
  692. },
  693. toolbox: {
  694. show : true,
  695. feature : {
  696. magicType : {
  697. type: ['pie', 'funnel'],
  698. option: {
  699. funnel: {
  700. x: '25%',
  701. width: '50%',
  702. funnelAlign: 'left',
  703. max: 1548
  704. }
  705. }
  706. },
  707. }
  708. },
  709. calculable : true,
  710. series : [
  711. {
  712. name:'访问来源',
  713. type:'pie',
  714. radius : '55%',
  715. center: ['50%', '50%'],
  716. data:array_points,
  717. itemStyle:{
  718. normal:{
  719. label:{
  720. show: true,
  721. formatter: '{b} :\n{c}人 ({d}%)'
  722. },
  723. labelLine :{show:true}
  724. }
  725. }
  726. }
  727. ]
  728. };
  729. return option;
  730. }
  731. /**
  732. * 图三 前5名
  733. */
  734. function progress_rank_assess(){
  735. option = {
  736. color : [ '#00ced1' ],// 条形图颜色
  737. tooltip : {
  738. trigger: 'axis'
  739. },
  740. noDataLoadingOption :{
  741. text: '暂无数据',
  742. effect:'bubble',
  743. effectOption : {
  744. effect: {
  745. n: 0 //气泡个数为0
  746. }
  747. },
  748. textStyle: {
  749. fontSize: 20,
  750. fontFamily:'cursive',
  751. fontWeight: 'bold'
  752. }
  753. },
  754. grid:{
  755. width:"80%"
  756. },
  757. legend: {
  758. data:['进步名次']
  759. },
  760. calculable : true,
  761. xAxis : [
  762. {
  763. type : 'category',
  764. data : array_five_name
  765. }
  766. ],
  767. yAxis : [
  768. {
  769. type : 'value',
  770. min : min_five
  771. }
  772. ],
  773. series : [
  774. {
  775. name:'进步名次',
  776. type:'bar',
  777. data: array_five_score,
  778. itemStyle: {
  779. normal: {
  780. label: {
  781. show: true,
  782. position: 'insideTop'
  783. }
  784. }
  785. },
  786. }
  787. ]
  788. };
  789. return option;
  790. }
  791. /**
  792. * 图三 后5名
  793. */
  794. function backward_rank_assess(){
  795. option = {
  796. color : [ '#00ced1' ],// 条形图颜色
  797. tooltip : {
  798. trigger: 'axis'
  799. },
  800. noDataLoadingOption :{
  801. text: '暂无数据',
  802. effect:'bubble',
  803. effectOption : {
  804. effect: {
  805. n: 0 //气泡个数为0
  806. }
  807. },
  808. textStyle: {
  809. fontSize: 20,
  810. fontFamily:'cursive',
  811. fontWeight: 'bold'
  812. }
  813. },
  814. grid:{
  815. width:"80%"
  816. },
  817. legend: {
  818. data:['退步名次']
  819. },
  820. calculable : true,
  821. xAxis : [
  822. {
  823. type : 'category',
  824. data : array_five_name_back
  825. }
  826. ],
  827. yAxis : [
  828. {
  829. type : 'value',
  830. min : min_five_back
  831. }
  832. ],
  833. series : [
  834. {
  835. name:'退步名次',
  836. type:'bar',
  837. data: array_five_score_back,
  838. itemStyle: {
  839. normal: {
  840. label: {
  841. show: true,
  842. position: 'insideTop'
  843. }
  844. }
  845. },
  846. }
  847. ]
  848. };
  849. return option;
  850. }
  851. /**
  852. * 图四
  853. */
  854. function people_score_rank(){
  855. option = {
  856. color : [ '#00ced1' ],// 条形图颜色
  857. tooltip : {
  858. trigger: 'axis'
  859. },
  860. noDataLoadingOption :{
  861. text: '暂无数据',
  862. effect:'bubble',
  863. effectOption : {
  864. effect: {
  865. n: 0 //气泡个数为0
  866. }
  867. },
  868. textStyle: {
  869. fontSize: 20,
  870. fontFamily:'cursive',
  871. fontWeight: 'bold'
  872. }
  873. },
  874. grid:{
  875. width:"88%"
  876. },
  877. legend: {
  878. data:['人员考核得分']
  879. },
  880. calculable : true,
  881. xAxis : [
  882. {
  883. axisLabel: {
  884. interval:0
  885. } ,
  886. type : 'category',
  887. data : array_score_order
  888. }
  889. ],
  890. yAxis : [
  891. {
  892. type : 'value',
  893. min : min_score ,
  894. max : 1000
  895. }
  896. ],
  897. series : [
  898. {
  899. name:'人员考核得分',
  900. type:'bar',
  901. data: array_score_data,
  902. itemStyle: {
  903. normal: {
  904. label: {
  905. show: true,
  906. position: 'insideTop'
  907. }
  908. }
  909. },
  910. markLine : {
  911. data : [
  912. {type : 'average', name: '平均值'}
  913. ]
  914. }
  915. }
  916. ]
  917. };
  918. return option;
  919. }
  920. /**
  921. * 图五
  922. */
  923. function server_check_type(){
  924. option = {
  925. tooltip : {
  926. trigger: 'item',
  927. formatter: "温馨服务检查占比 <br/>{b} : {c}分 ({d}%)"
  928. },
  929. noDataLoadingOption :{
  930. text: '暂无数据',
  931. effect:'bubble',
  932. effectOption : {
  933. effect: {
  934. n: 0 //气泡个数为0
  935. }
  936. },
  937. textStyle: {
  938. fontSize: 20,
  939. fontFamily:'cursive',
  940. fontWeight: 'bold'
  941. }
  942. },
  943. toolbox: {
  944. show : true,
  945. feature : {
  946. magicType : {
  947. type: ['pie', 'funnel'],
  948. option: {
  949. funnel: {
  950. x: '25%',
  951. width: '50%',
  952. funnelAlign: 'left',
  953. max: 1548
  954. }
  955. }
  956. },
  957. }
  958. },
  959. calculable : true,
  960. series : [
  961. {
  962. name:'访问来源',
  963. type:'pie',
  964. radius : '55%',
  965. center: ['50%', '50%'],
  966. data:array_check_type,
  967. itemStyle:{
  968. normal:{
  969. label:{
  970. show: true,
  971. formatter: '{b} :\n{c}分 ({d}%)'
  972. },
  973. labelLine :{show:true}
  974. }
  975. }
  976. }
  977. ]
  978. };
  979. return option;
  980. }
  981. /**
  982. * 图六
  983. */
  984. function each_people_points(){
  985. option = {
  986. tooltip : {
  987. trigger: 'axis'
  988. },
  989. noDataLoadingOption :{
  990. text: '暂无数据',
  991. effect:'bubble',
  992. effectOption : {
  993. effect: {
  994. n: 0 //气泡个数为0
  995. }
  996. },
  997. textStyle: {
  998. fontSize: 20,
  999. fontFamily:'cursive',
  1000. fontWeight: 'bold'
  1001. }
  1002. },
  1003. grid:{
  1004. width:"80%"
  1005. },
  1006. legend: {
  1007. data:['上月','本月']
  1008. },
  1009. calculable : true,
  1010. xAxis : [
  1011. {
  1012. type : 'category',
  1013. data : array_points_name
  1014. }
  1015. ],
  1016. yAxis : [
  1017. {
  1018. type : 'value'
  1019. }
  1020. ],
  1021. series : [
  1022. {
  1023. name:'上月',
  1024. type:'bar',
  1025. data:array_points_pre,
  1026. itemStyle: {
  1027. normal: {
  1028. color:'#7bc0f2',
  1029. label: {
  1030. show: true,
  1031. textStyle: {
  1032. color:'black'
  1033. }
  1034. }
  1035. }
  1036. },
  1037. },
  1038. {
  1039. name:'本月',
  1040. type:'bar',
  1041. data:arrar_points_month,
  1042. itemStyle: {
  1043. normal: {
  1044. color:'#ea644a',
  1045. label: {
  1046. show: true,
  1047. textStyle: {
  1048. color:'black'
  1049. }
  1050. }
  1051. }
  1052. },
  1053. }
  1054. ]
  1055. };
  1056. return option;
  1057. }
  1058. });
  1059. function setVisit(){
  1060. if(roleContains("STATION")){
  1061. $("#first").attr("disabled","disabled");
  1062. $("#second").attr("disabled","disabled");
  1063. }
  1064. if(roleContains("ROAD_MANAGER")){
  1065. $("#first").attr("disabled","disabled");
  1066. }
  1067. }