toll_station_statistics.js 23 KB

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