toll_station_statistics.js 23 KB

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