| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- var year = new Date().getFullYear();
- var month = new Date().getMonth();
- var x_m_array = new Array();
- var x_m_array_temp = new Array();
- var date = new Date().getDate();
- var select_road = $(".div-roadManage select").val();
- var select_station = $("#second").val();
- var array_year_score = new Array();
- var array_points = new Array();
- var array_check_type = new Array();
- var array_points_name = new Array();
- var array_points_pre = new Array();
- var arrar_points_month = new Array();
- var array_score_order = new Array();
- var array_score_data = new Array();
- var array_score_data_temp = new Array();
- var array_five_name = new Array();
- var array_five_score = new Array();
- var array_five_score_temp = new Array();
- var array_five_name_back = new Array();
- var array_five_score_back = new Array();
- var array_five_score_back_temp = new Array();
- var year_assess;
- var points_assess;
- var check_type;
- var people_points;
- var score_rank;
- var rank_assess;
- var rank_assess_back;
- var min_year;
- var min_five;
- var min_five_back;
- var min_score;
- var flag = false;
- var change_echart = 2;
- $(function() {
- setVisit();
- // 公用方法,根据当前年月动态将13个月push数组
- month_method();
- // 公用方法,月份下拉框
- // select_option();
- $.jeDate("#month_date", {
- isinitVal: true,
- format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
- });
- var road_manager;
- if (roleContains("STATION")) {
- road_manager = getCurrentUser().road_manager_id;
- }
- if (roleContains("ROAD_MANAGER")) {
- road_manager = getCurrentUser().organid;
- }
- // setRoadManagerSelect("#first", road_manager);
- setSecond();
- var temp_time = $.zui.store.get('page_data_param_temp_time');
- var road_p = $.zui.store.get('page_data_param_road_p');
- var station_p = $.zui.store.get('page_data_param_station_p');
- if (temp_time) {
- $("#month_date").val(temp_time);
- setRoadManagerSelect_1(".div-roadManage select", road_p);
- setSecond_1(station_p);
- $.zui.store.set('page_data_param_temp_time', null);
- $.zui.store.set('page_data_param_road_p', null);
- $.zui.store.set('page_data_param_station_p', null);
- }
- var p = $.zui.store.get('store_param_' + current_url);
- $.zui.store.set('store_param_' + current_url, null)
- if (p) {
- $("#month_date").val(p.time)
- setRoadManagerSelect(".div-roadManage select", p.road_p);
- setSecond_2(p.station_p);
- }
- // 回显当前年月份
- // $(".div-month select").val(initDate);
- refresh(true);
- $(".div-button button").click(function() {
- refresh(flag);
- flag = false;
- });
- // 加载图配置
- // echart();
- // 如果道管中心下拉框改变,点击时加载图一
- $(".div-station select").change(function() {
- flag = true;
- });
- function refresh(flag) {
- var select_month = $("#month_date").val();
- var select_station = $(".div-station select").val();
- // 加载图配置
- echart(flag);
- echart_change();
- echart_change2();
- init_tollStation_year_assess("statistics/score/year/info", select_station, select_month.split('/')[0], select_month.split('/')[1]);
- // flag = false;
- top5_change(select_month, select_station);
- // 查询图二
- init_company_points_assess("statistics/lost/score/rate", select_month + '', select_station);
- // 查询图四
- init_people_score_rank("statistics/stuff/score/info", select_month + '', select_station);
- // 查询图五
- // console.log(select_month+","+select_station);
- init_server_check_type("statistics/lost/itemscore/rate", select_month + "", select_station);
- // 查询图六
- init_each_people_points("statistics/lost/twice/itemscore/rate", select_month + "", select_station);
- }
- /**
- * 初始化图一
- */
- function init_tollStation_year_assess(url, select_station, y, m) {
- x_m_array = new Array();
- for (var i = 1; i <= 12; i++) {
- var month = parseInt(m) + i;
- var starty = parseInt(y) - 1
- if (month > 12) {
- month = month - 12;
- starty = y;
- }
- x_m_array.push(starty + "/" + (month >= 10 ? month : ("0" + month)));
- }
- if(m != 12){
- var start_date = (parseInt(y) - 1) + "-" + (parseInt(m)+1) + "-1" + " 00:00:00";
- var end_date = y + "-" + (parseInt(m)+1) + "-1" + " 00:00:00";
- }else{
- var start_date = (parseInt(y)) + "-" + '1' + "-1" + " 00:00:00";
- var end_date = (parseInt(y)+1) + "-" + '1' + "-1" + " 00:00:00";
- }
- var param = {
- "start_date": start_date,
- "end_date": end_date,
- "dept_id": select_station,
- "queryType": 2
- }
- initRqueset(url, param, 1);
- }
- /**
- * 初始化图二
- */
- function init_company_points_assess(url, mon, select_station) {
- var param = {
- mth: mon,
- "dept_id": select_station,
- "queryType": 2
- }
- initRqueset(url, param, 2);
- }
- /**
- * 初始化图三 前5名
- */
- function init_progress_rank_assess(url, mon, select_station) {
- var prev_mth;
- // 判断当前年月是否为一月
- if (parseInt((mon + '').substr(5)) == 1) {
- prev_mth = ((parseInt((mon + '').substr(0, 4))) - 1) + "/12";
- } else {
- if ((parseInt((mon + '').substr(5)) + '').length == 1) {
- prev_mth = (mon + '').substr(0, 4) + '/0' + (parseInt((mon + '').substr(5)) - 1);
- } else {
- prev_mth = (mon + '').substr(0, 4) + '/' + (parseInt((mon + '').substr(5)) - 1);
- }
- }
- var param = {
- "mth": mon,
- "dept_id": select_station,
- "prev_mth": prev_mth,
- "order_type": 0
- };
- initRqueset(url, param, 3);
- }
- /**
- * 初始化图四
- */
- function init_people_score_rank(url, mon, select_station) {
- var param = {
- "mth": mon,
- "dept_id": select_station,
- "queryType": 2,
- "order_type": 1
- }
- initRqueset(url, param, 4);
- }
- /**
- * 初始化图五
- */
- function init_server_check_type(url, mon, select_station) {
- var param = {
- "mth": mon,
- "dept_id": select_station,
- "queryType": 2
- };
- initRqueset(url, param, 5);
- }
- /**
- * 初始化图六
- */
- function init_each_people_points(url, mon, select_station) {
- var prev_mth;
- // 判断当前年月是否为一月
- if (parseInt((mon + '').substr(5)) == 1) {
- prev_mth = ((parseInt((mon + '').substr(0, 4))) - 1) + "/12";
- } else {
- var m = (parseInt((mon + '').substr(5)) - 1);
- if ((parseInt((mon + '').substr(5)) + '').length == 1) {
- prev_mth = (mon + '').substr(0, 4) + '/' + (m > 9 ? m : "0" + m);
- } else {
- prev_mth = (mon + '').substr(0, 4) + '/' + (m > 9 ? m : "0" + m);
- }
- }
- var param = {
- "mth": mon,
- "prev_mth": prev_mth,
- "dept_id": select_station,
- "queryType": 2
- };
- initRqueset(url, param, 6);
- }
- /**
- * 图切换后5名
- */
- function init_backward_rank_assess(url, mon, select_station) {
- var prev_mth;
- // 判断当前年月是否为一月
- if (parseInt((mon + '').substr(5)) == 1) {
- prev_mth = ((parseInt((mon + '').substr(0, 4))) - 1) + "/12";
- } else {
- if ((parseInt((mon + '').substr(5)) + '').length == 1) {
- prev_mth = (mon + '').substr(0, 4) + '/0' + (parseInt((mon + '').substr(5)) - 1);
- } else {
- prev_mth = (mon + '').substr(0, 4) + '/' + (parseInt((mon + '').substr(5)) - 1);
- }
- }
- var param = {
- "mth": mon,
- "dept_id": select_station,
- "prev_mth": prev_mth,
- "order_type": 1
- };
- initRqueset(url, param, 7);
- }
- /**
- * 请求
- * @param {*} url
- * @param {*} param
- * @param {*} type
- */
- function initRqueset(url, param, type) {
- post_common_service(url, param, function(data) {
- data_array(data, type);
- if (type == 1) {
- // 画图
- year_assess.setOption(tollStation_year_assess());
- } else if (type == 2) {
- // 画图
- points_assess.setOption(tollStation_points_assess());
- } else if (type == 3) {
- // 画图
- rank_assess.setOption(progress_rank_assess());
- } else if (type == 4) {
- // 画图
- score_rank.setOption(people_score_rank());
- } else if (type == 5) {
- // 画图
- check_type.setOption(server_check_type());
- } else if (type == 6) {
- // 画图
- people_points.setOption(each_people_points());
- } else if (type == 7) {
- // 画图
- rank_assess_back.setOption(backward_rank_assess());
- }
- }, function(error) {
- return "";
- });
- }
- /**
- * 数组数据
- * @param {*} data
- * @param {*} type
- */
- function data_array(data, type) {
- if (type == 1) {
- console.log(data);
- array_year_score.length = 0;
- if (data != '' && data.length != 0) {
- x_m_array_temp = new Array();
- x_m_array_temp=x_m_array;
- for (var i = 0; i < x_m_array.length; i++) {
- var index = -1;
- var score = 0;
- for (var j = 0; j < data.length; j++) {
- if (x_m_array[i] == data[j].mth) {
- index = j;
- score = data[index].all_check_score;
- break;
- }
- }
- array_year_score.push(
- (100 - score));
- // if (index < 0) {} else {
- // x_m_array_temp.push(x_m_array[i]);
- // array_year_score.push(
- // (100 - data[index].all_check_score));
- // }
- }
- } else {
- array_year_score.length = 0;
- x_m_array = new Array();
- x_m_array_temp = new Array();
- }
- if (eval("Math.min(" + array_year_score.toString() + ")") == 0)
- min_year = 0;
- else
- min_year = eval("Math.min(" + array_year_score.toString() + ")").toFixed(0) - 10;
- console.log(array_year_score);
- } else if (type == 2) {
- array_points.length = 0;
- if (data != '') {
- 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-5分' });
- array_points.push({ "value": data.score_fifty, "name": '5-10分' });
- array_points.push({ "value": data.score_over_fifty, "name": '10分以上' });
- } else {
- array_points.length = 0;
- }
- } else if (type == 3) {
- array_five_name.length = 0;
- array_five_score.length = 0;
- if (data != '' && data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_five_score.push(data[i].ranking_change);
- }
- } else {
- array_five_name.length = 0;
- array_five_score.length = 0;
- }
- if (eval("Math.min(" + array_five_score.toString() + ")") == 0)
- min_five = 0;
- else
- min_five = eval("Math.min(" + array_five_score.toString() + ")").toFixed(0) - 1;
- // 给考核进步top5排名次
- var rank = new Array();
- rank[0] = 1;
- for (var i = 1; i < array_five_score.length; i++) {
- if (array_five_score[i - 1] == array_five_score[i]) {
- rank[i] = rank[i - 1];
- } else {
- rank[i] = i + 1;
- }
- }
- array_five_score_temp = new Array();
- for (var i = 0; i < array_five_score.length; i++) {
- array_five_name.push(data[i].user.truename + "\n" + (rank[i]));
- array_five_score_temp.push({ value: array_five_score[i], name: data[i].user.id + "_" + data[i].user.organid })
- }
- } else if (type == 4) {
- array_score_order.length = 0;
- array_score_data.length = 0;
- var m = 1;
- if (data != '' && data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_score_data.push((100 - data[i].all_check_score));
- }
- } else {
- array_score_order.length = 0;
- array_score_data.length = 0;
- }
- if (eval("Math.min(" + array_score_data.toString() + ")") == 0)
- min_score = 0;
- else
- min_score = eval("Math.min(" + array_score_data.toString() + ")").toFixed(0) - 10;
- // 给得分人员排名次
- var rank = new Array();
- rank[0] = 1;
- for (var i = 1; i < array_score_data.length; i++) {
- if (array_score_data[i - 1] == array_score_data[i]) {
- rank[i] = rank[i - 1];
- } else {
- rank[i] = i + 1;
- }
- }
- array_score_data_temp = new Array();
- for (var i = 0; i < array_score_data.length; i++) {
- array_score_order.push(data[i].user.truename + "(" + (rank[i]) + ")");
- array_score_data_temp.push({ value: array_score_data[i], name: data[i].user.id + "_" + data[i].user.organid })
- }
- } else if (type == 5) {
- array_check_type.length = 0;
- if (data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_check_type.push({ "value": data[i].all_check_score, "name": data[i].name });
- }
- } else {
- array_check_type.length = 0;
- }
- } else if (type == 6) {
- 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) {
- data_each_people_points(data);
- } else {
- array_points_name.length = 0;
- array_points_pre.length = 0;
- arrar_points_month.length = 0;
- }
- } else if (type == 7) {
- array_five_name_back.length = 0;
- array_five_score_back.length = 0;
- if (data != '') {
- for (var i = 0; i < data.length; i++) {
- if (data[i].ranking_change < 0) {
- array_five_score_back.push((data[i].ranking_change + '').substr(1));
- } else {
- array_five_score_back.push((data[i].ranking_change + ''));
- }
- }
- } else {
- array_five_name_back.length = 0;
- array_five_score_back.length = 0;
- }
- if (eval("Math.min(" + array_five_score_back.toString() + ")") == 0) {
- min_five_back = 0;
- } else {
- min_five_back = eval("Math.min(" + array_five_score_back.toString() + ")").toFixed(0) - 1;
- }
- // 退步top5排名次
- var rank = new Array();
- rank[0] = 1;
- for (var i = 1; i < array_five_score_back.length; i++) {
- if (array_five_score_back[i - 1] == array_five_score_back[i]) {
- rank[i] = rank[i - 1];
- } else {
- rank[i] = i + 1;
- }
- }
- array_five_score_back_temp = new Array();
- for (var i = 0; i < array_five_score_back.length; i++) {
- array_five_name_back.push(data[i].user.truename + "\n" + (rank[i]));
- array_five_score_back_temp.push({ value: array_five_score_back[i], name: data[i].user.id + "_" + data[i].user.organid })
- }
- }
- }
- function data_each_people_points(data) {
-
- var flag = true;
- array_all_name=new Array()
- for(var index in data.item[0].itemList){
- var obj = data.item[0].itemList[index];
- //console.log(obj.name);
- array_all_name.push(obj.name);
- }
- // array_all_name = ["安全管理", "系统和设备管理", "票、款、卡管理", "内部解缴", "外部解缴", "环境卫生", "服务形象", "服务规范", "操作流程", "便民服务", "通行质量", "内部管理"];
-
- var Tmth = data.Tmth;
- var Pmth = data.Pmth;
- var Ntemp = new Array();
- var Ptemp = new Array();
- var Ttemp = new Array();
- for (var i = 0; i < array_all_name.length; i++) {
- flag = true;
- if (Tmth.length > 0) {
- for (var j = 0; j < Tmth.length; j++) {
- if (array_all_name[i] == Tmth[j].name && Tmth[j].all_check_score != null) {
- // Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
- Ttemp[i] = Tmth[j].all_check_score;
- break;
- } else {
- Ttemp[i] = 0;
- }
- }
- } else {
- Ttemp[i] = 0;
- }
- if (Pmth.length > 0) {
- for (var m = 0; m < Pmth.length; m++) {
- if (array_all_name[i] == Pmth[m].name && Pmth[m].all_check_score != null) {
- // Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
- Ptemp[i] = Pmth[m].all_check_score;
- break;
- } else {
- Ptemp[i] = 0;
- }
- }
- } else {
- Ptemp[i] = 0;
- }
- if (Ttemp[i] == 0 && Ptemp[i] == 0) {
- name[i] = "";
- flag = null;
- }
- if (flag) {
- array_points_pre.push(Ptemp[i]);
- arrar_points_month.push(Ttemp[i]);
- }
- }
- }
- /**
- * 根据道管中心获取收费站列表(下拉框)
- */
- $(".div-roadManage select").change(function() {
- setSecond();
- flag = true;
- });
- function setSecond_1(name) {
- var select_road = $(".div-roadManage select").val();
- var feeList = $.zui.store.get("cache_fee_station_list");
- if (select_road) feeList = cache_road_manager_fee_list_map.get(select_road);
- refreshFee(feeList, name, true);
- }
- function setSecond_2(name) {
- var select_road = $(".div-roadManage select").val();
- var feeList = $.zui.store.get("cache_fee_station_list");
- if (select_road) feeList = cache_road_manager_fee_list_map.get(select_road);
- refreshFee(feeList, name, false);
- }
- function setSecond() {
- // var select_road = $(".div-roadManage select").val();
- var feeList = $.zui.store.get("cache_fee_station_list");
- if (select_road) feeList = cache_road_manager_fee_list_map.get(select_road);
- var dept;
- if (roleContains("STATION")) {
- dept = getCurrentUser().organid;
- }
- refreshFee(feeList, dept, false);
- // var param = {
- // "parentid":select_road
- // }
- // post_common_service("dept/getDeptInfosByDeptId",param,function(data){
- // },function(error){
- // return "" ;
- // });
- }
- function refreshFee(data, selectId, isname) {
- var sec = document.getElementById('second');
- var tempStr = ''
- if (data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- // if(select_road==30){
- // tempStr += "<option value="+data[i].id+">"+data[i].organname+"</option>";
- // }else if(select_road==31){
- // tempStr += "<option value="+data[i].id+">"+data[i].organname+"</option>";
- // }else{
- if (isname ? data[i].name == selectId : data[i].deptid == selectId)
- tempStr += "<option value=" + data[i].deptid + " selected>" + data[i].name + "</option>";
- else
- tempStr += "<option value=" + data[i].deptid + ">" + data[i].name + "</option>";
- // }
- sec.innerHTML = tempStr;
- }
- } else {
- sec.innerHTML = '';
- }
- // // 页面初始化
- // var select_month = $("#month_date").val();
- // var select_station = $("#second").val();
- // echart();
- // // 进退步top5
- // top5_change(select_month,select_station);
- // init_tollStation_year_assess("statistics/score/year/info",select_station);
- // init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
- // init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
- // init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
- // init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
- // flag = false;
- }
- /**
- * 进步前5名后退步前五名切换
- */
- $(".view_change").click(function() {
- var select_month = $("#month_date").val();
- var select_station = $("#second").val();
- // 进退步top5
- top5_change(select_month, select_station);
- });
- /**
- * 进退步top5
- * @param {*} select_month
- * @param {*} select_station
- */
- function top5_change(select_month, select_station) {
- if (change_echart == 1) {
- $("#progress span").text("考核退步Top5排行榜");
- $("#progress-rank-assess").css("display", "none");
- $("#backward-rank-assess").css("display", "block");
- echart_change();
- init_backward_rank_assess("statistics/fs/up/five", select_month + '', select_station);
- change_echart = 2
- } else if (change_echart == 2) {
- $("#progress span").text("考核进步Top5排行榜");
- $("#progress-rank-assess").css("display", "block");
- $("#backward-rank-assess").css("display", "none");
- echart_change2();
- init_progress_rank_assess("statistics/fs/up/five", select_month + '', select_station);
- change_echart = 1
- }
- }
- /**
- * 除数为0处理
- * @param {*} num
- * @param {*} num1
- * @param {*} num2
- * @param {*} num4
- */
- function filter_handler(num, num1, num2, num3) {
- if (num1 == 0 || num2 == 0) {
- return num3;
- } else {
- return ((num / num1) / num2).toFixed(2);
- }
- }
- function filter(num, num1, num2) {
- if (num1 == 0) {
- return num2;
- } else {
- return (num / num1).toFixed(2);
- }
- }
- /**
- * 其它图配置
- */
- function echart(flag) {
- echart_config(1, flag);
- }
- /**
- * 进步top5图配置
- */
- function echart_change2() {
- echart_config(2, false);
- }
- /**
- * 退步top5图配置
- */
- function echart_change() {
- echart_config(3, false);
- }
- /**
- * 图配置
- */
- function echart_config(type, flag) {
- require.config({
- paths: {
- echarts: '/js/lib/echarts/build/dist'
- }
- });
- require(
- [
- 'echarts',
- 'echarts/theme/macarons',
- 'echarts/chart/line',
- 'echarts/chart/bar',
- 'echarts/chart/pie'
- ],
- function(ec, theme) {
- if (type == 2) {
- rank_assess = ec.init(document.getElementById('progress-rank-assess'));
- rank_assess.on(ecConfig.EVENT.CLICK, station_c)
- } else if (type == 3) {
- rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
- rank_assess_back.on(ecConfig.EVENT.CLICK, station_c)
- } else {
- if (flag) {
- year_assess = ec.init(document.getElementById('tollStation-year-assess'), theme);
- }
- points_assess = ec.init(document.getElementById('tollStation-points-assess'), theme);
- score_rank = ec.init(document.getElementById('people-score-rank'));
- check_type = ec.init(document.getElementById('server-check-type'), theme);
- people_points = ec.init(document.getElementById('each-people-points'));
- rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
- score_rank.on(ecConfig.EVENT.CLICK, station_c)
- rank_assess_back.on(ecConfig.EVENT.CLICK, station_c)
- }
- }
- );
- }
- /**
- * 图一
- */
- function tollStation_year_assess() {
- option = {
- color: ['#00ced1'],
- tooltip: {
- trigger: 'axis'
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- legend: {
- data: ['收费站得分']
- },
- toolbox: {
- show: true,
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- data: x_m_array_temp
- }],
- yAxis: [{
- type: 'value',
- min: min_year,
- max: 100,
- axisLabel: {
- formatter: '{value}'
- }
- }],
- series: [{
- name: '收费站得分',
- type: 'line',
- data: array_year_score,
- markPoint: {
- data: [
- { type: 'max', name: '最大值' },
- { type: 'min', name: '最小值' }
- ]
- },
- markLine: {
- data: [
- { type: 'average', name: '平均值' }
- ]
- }
- },
- ]
- };
- return option;
- }
- /**
- * 图二
- */
- function tollStation_points_assess() {
- option = {
- tooltip: {
- trigger: 'item',
- formatter: "收费站考核扣分占比 <br/>{b} : {c}人 ({d}%)"
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- toolbox: {
- show: true,
- feature: {
- magicType: {
- type: ['pie', 'funnel'],
- option: {
- funnel: {
- x: '25%',
- width: '50%',
- funnelAlign: 'left',
- max: 1548
- }
- }
- },
- }
- },
- calculable: true,
- series: [{
- name: '访问来源',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: array_points,
- itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b} :\n{c}人 ({d}%)'
- },
- labelLine: { show: true }
- }
- }
- }]
- };
- return option;
- }
- /**
- * 图三 前5名
- */
- function progress_rank_assess() {
- option = {
- color: ['#00ced1'], // 条形图颜色
- tooltip: {
- trigger: 'axis'
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- grid: {
- width: "80%"
- },
- legend: {
- data: ['进步名次']
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- data: array_five_name
- }],
- yAxis: [{
- type: 'value',
- min: min_five
- }],
- series: [{
- name: '进步名次',
- type: 'bar',
- data: array_five_score_temp,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- }]
- };
- return option;
- }
- /**
- * 图三 后5名
- */
- function backward_rank_assess() {
- option = {
- color: ['#FF7F27'], // 条形图颜色
- tooltip: {
- trigger: 'axis'
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- grid: {
- width: "80%"
- },
- legend: {
- data: ['退步名次']
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- data: array_five_name_back
- }],
- yAxis: [{
- type: 'value',
- min: min_five_back
- }],
- series: [{
- name: '退步名次',
- type: 'bar',
- data: array_five_score_back_temp,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- }]
- };
- return option;
- }
- /**
- * 图四
- */
- function people_score_rank() {
- 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: [{
- axisLabel: {
- interval: 0,
- rotate: 45,
- textStyle: {
- fontSize: 10
- }
- },
- type: 'category',
- data: array_score_order
- }],
- yAxis: [{
- type: 'value',
- min: min_score,
- max: 100
- }],
- series: [{
- name: '人员考核得分',
- type: 'bar',
- data: array_score_data_temp,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- markLine: {
- data: [
- { type: 'average', name: '平均值' }
- ]
- }
- }]
- };
- return option;
- }
- /**
- * 图五
- */
- function server_check_type() {
- option = {
- tooltip: {
- trigger: 'item',
- formatter: "温馨服务检查占比 <br/>{b} : {c}分 ({d}%)"
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- toolbox: {
- show: true,
- feature: {
- magicType: {
- type: ['pie', 'funnel'],
- option: {
- funnel: {
- x: '25%',
- width: '50%',
- funnelAlign: 'left',
- max: 1548
- }
- }
- },
- }
- },
- calculable: true,
- series: [{
- name: '访问来源',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: array_check_type,
- itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b} :\n{c}分 ({d}%)'
- },
- labelLine: { show: true }
- }
- }
- }]
- };
- return option;
- }
- /**
- * 图六
- */
- function each_people_points() {
- option = {
- tooltip: {
- trigger: 'axis'
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- grid: {
- width: "80%"
- },
- legend: {
- data: ['上月', '本月']
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- data: array_all_name,
- axisLabel: {
- interval:0
- }
- }],
- yAxis: [{
- type: 'value'
- }],
- series: [{
- name: '上月',
- type: 'bar',
- data: array_points_pre,
- itemStyle: {
- normal: {
- color: '#7bc0f2',
- label: {
- show: true,
- textStyle: {
- color: 'black'
- }
- }
- }
- },
- },
- {
- name: '本月',
- type: 'bar',
- data: arrar_points_month,
- itemStyle: {
- normal: {
- color: '#ea644a',
- label: {
- show: true,
- textStyle: {
- color: 'black'
- }
- }
- }
- },
- }
- ]
- };
- return option;
- }
- });
- function setVisit() {
- if (roleContains("STATION")) {
- $("#first").attr("disabled", "disabled");
- $("#second").attr("disabled", "disabled");
- }
- if (roleContains("ROAD_MANAGER")) {
- $("#first").attr("disabled", "disabled");
- }
- }
- var ecConfig = require('echarts/config');
- function station_c(param) {
- if (typeof param.seriesIndex == 'undefined') {
- return;
- }
- if (param.type == 'click') {
- var pdata = {
- time: $("#month_date").val(),
- road_p: $(".div-roadManage select").val(),
- station_p: $("#second").val()
- }
- $.zui.store.set('page_data_param_temp_time', $("#month_date").val());
- //获取站名+用户名
- var namelist = param.data.name.split("_")
- var userid = namelist[0];
- var deptid = namelist[1];
- $.zui.store.set('store_param_' + current_url, pdata);
- isnew = false;
- changePage("/view/statistics/personal_data_statistics.html?userid=" + userid + "&deptid=" + deptid + "&jump=1");
- }
- }
|