| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275 |
- var year = new Date().getFullYear();
- var month = new Date().getMonth();
- var date = new Date().getDate();
- var year_assess;
- var score_rank;
- var points_assess;
- var check_type;
- var select_road = $(".div-roadManage select").val();
- var array_year_score = new Array();
- var array_points = new Array();
- var array_points2 = new Array();
- var array_allStation = new Array();
- var array_allStation_score = new Array();
- var array_check_type = new Array();
- var map_per_data = new HashMap();
- var map_month_data = new HashMap();
- var array_all_name = new Array()
- var array_all_deptname = 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_last = new Array();
- var array_get_score = new Array();
- var array_score_pie = new Array();
- var year_assess;
- var score_rank;
- var points_assess;
- var check_type;
- var people_points;
- var rank_pre;
- var rank_suf;
- var min_year;
- var min_station;
- var min_pre
- var min_suff;
- var flag = false;
- $(function() {
- setVisit();
- // 公用方法,根据当前年月动态将13个月push数组
- month_method();
- // 公用方法,月份下拉框
- // select_option();
- // 回显当前年月份
- // $(".div-month select").val(initDate);
- $.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(".div-roadManage select", road_manager);
- //加载数据
- refresh(true);
- $(".div-button button").click(function() {
- // var select_month = $("#month_date").val();
- // console.log("fffffff"+select_month);
- // var select_road = $(".div-roadManage select").val();
- // 加载图配置
- // echart();
- refresh(flag);
- // if(flag ==true){
- // init_company_year_assess("statistics/score/year/info",select_road);
- // }
- flag = false;
- });
- // 如果道管中心下拉框改变,点击时加载图一
- $(".div-roadManage").change(function() {
- flag = true;
- });
- // 加载图配置
- // echart();
- function refresh(flag) {
- echart(flag);
- var select_month = $("#month_date").val();
- var select_road = $(".div-roadManage select").val();
- console.log(select_road);
- if (flag == true) {
- init_company_year_assess("statistics/score/year/info", select_road);
- }
- // 查询图二
- // init_company_points_assess("statistics/lost/score/rate",select_month+'',select_road);
- init_company_points_assess("statistics/score/info", select_month.split('/')[1] + '');
- // 查询图三
- init_stationAll_rank("statistics/score/manage/tollgate/info", select_month + '', select_road);
- // 查询图四
- //init_people_rank_pre("statistics/stuff/score/info",select_month+'',select_road);
- // 查询图五
- init_people_rank_suf("statistics/stuff/score/info", select_month + '', select_road);
- // 查询图六
- init_server_check_type("statistics/lost/itemscore/rate", select_month + "", select_road);
- // 查询图七
- init_each_people_points("statistics/lost/twice/itemscore/rate", select_month + "", select_road);
- }
- /**
- * 初始化图一
- */
- function init_company_year_assess(url, select_road) {
- var param = {
- "start_date": (year - 1) + "-" + new Date().getMonth() + "-25" + " 23:00:00",
- "end_date": year + "-" + (new Date().getMonth() + 1) + "-25" + " 23:00:00",
- "dept_id": select_road,
- "queryType": 1
- }
- initRqueset(url, param, 1);
- }
- /**
- * 初始化图二
- */
- function init_company_points_assess(url, mon, select_road) {
- // var param = {
- // "mth":mon,
- // "dept_id":select_road,
- // "queryType":1
- // }
- // initRqueset(url,param,2);
- var param = {
- "start_date": year + '-' + (mon - 1) + '-25 23:00:00',
- "end_date": year + '-' + mon + '-25 23:00:00'
- }
- initRqueset(url, param, 2);
- }
- /**
- * 初始化图三
- */
- function init_stationAll_rank(url, mon, select_road) {
- var param = {
- "mth": mon,
- "dept_id": select_road
- };
- initRqueset(url, param, 3);
- }
- /**
- * 初始化图四
- */
- function init_people_rank_pre(url, mon, select_road) {
- var param = {
- mth: mon,
- "dept_id": select_road,
- "queryType": 1,
- "order_type": 0
- }
- initRqueset(url, param, 4);
- }
- /**
- * 初始化图五
- */
- function init_people_rank_suf(url, mon, select_road) {
- var param = {
- mth: mon,
- "dept_id": select_road,
- "queryType": 1,
- "order_type": 1
- }
- initRqueset(url, param, 5);
- }
- /**
- * 初始化图六
- */
- function init_server_check_type(url, mon, select_road) {
- var param = {
- "mth": mon,
- "dept_id": select_road,
- "queryType": 1
- };
- initRqueset(url, param, 6);
- }
- /**
- * 初始化图七
- */
- function init_each_people_points(url, mon, select_road) {
- 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,
- "prev_mth": prev_mth,
- "dept_id": select_road,
- "queryType": 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(roadManager_year_assess());
- } else if (type == 2) {
- // 画图
- points_assess.setOption(roadManager_points_assess());
- } else if (type == 3) {
- // 画图
- score_rank.setOption(tollStation_score_rank());
- } else if (type == 4) {
- // 画图
- rank_pre.setOption(people_rank_pre());
- } else if (type == 5) {
- // 画图
- rank_suf.setOption(people_rank_suf());
- } else if (type == 6) {
- // 画图
- check_type.setOption(server_check_type());
- } else if (type == 7) {
- // 画图
- people_points.setOption(each_people_points());
- }
- }, function(error) {
- return "";
- });
- }
- function push_data(data, names, propertyname, center_id, color_t) {
- for (var i = 0; i < data.list.length; i++) {
- if (i < 7 && center_id == 30) {
- var p = i - 7;
- var color = new $.zui.Color(color_t.r + p * 10, color_t.g, color_t.b);
- if (data.list[i][propertyname] != 0)
- array_points2.push({
- "value": (data.list[i][propertyname]),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- } else if (i > 6 && i < 13 && center_id == 31) {
- var p = i - 6;
- var color = new $.zui.Color(color_t.r + p * 10, color_t.g - p * 10, color_t.b - p * 10);
- if (data.list[i][propertyname] != 0)
- array_points2.push({
- "value": (data.list[i][propertyname]),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- } else if (i > 12 && i < 21 && center_id == 32) {
- var p = i - 12;
- var color = new $.zui.Color(color_t.r + p * 10, color_t.g - p * 10, color_t.b - p * 10);
- if (data.list[i][propertyname] != 0)
- array_points2.push({
- "value": (data.list[i][propertyname]),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- }
- }
- }
- /**
- * 数组数据
- * @param {*} data
- * @param {*} type
- */
- function data_array(data, type) {
- if (type == 1) {
- array_year_score.length = 0;
- if (data != null && data.length != 0) {
- if (data.length < 14) {
- for (var i = 0; i < 14 - data.length; i++) {
- // 不足月份补0
- array_year_score.push(0);
- }
- }
- for (var i = 0; i < data.length; i++) {
- if (months.indexOf(data[i].mth.substr(2))) {
- // 指定位置插入值
- array_year_score.splice(months.indexOf(data[i].mth.substr(2)), 0,
- (1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, data[i].people_num, 0))));
- }
- }
- } else {
- array_year_score.length = 0;
- months.length = 0;
- }
- 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;
- } else if (type == 2) {
- array_points = [];
- array_points2 = [];
- if (data != null) {
- var temp = [0, 0, 0, 0];
- // array_points.push({"value": (data.people_num-(data.score_fifteen+data.score_fifty+data.score_over_fifty)),"name":'满分'});
- // array_points.push({"value": data.score_fifteen,"name":'0-15分'});
- // array_points.push({"value": data.score_fifty,"name":'15-50分'});
- // array_points.push({"value": data.score_over_fifty,"name":'50分以上'});
- // 过滤出道管的数据
- var center_id = $(".div-roadManage select").val();
- for (var i = 0; i < data.list.length; i++) {
- if (i < 7 && center_id == 30) {
- temp[0] += data.list[i].checked_people_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
- temp[1] += data.list[i].score_fifteen;
- temp[2] += data.list[i].score_fifty;
- temp[3] += data.list[i].score_over_fifty;
- } else if (i > 6 && i < 13 && center_id == 31) {
- temp[0] += data.list[i].checked_people_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
- temp[1] += data.list[i].score_fifteen;
- temp[2] += data.list[i].score_fifty;
- temp[3] += data.list[i].score_over_fifty;
- } else if (i > 12 && i < 21 && center_id == 32) {
- temp[0] += data.list[i].checked_people_num - data.list[i].score_fifteen - data.list[i].score_fifty - data.list[i].score_over_fifty;
- temp[1] += data.list[i].score_fifteen;
- temp[2] += data.list[i].score_fifty;
- temp[3] += data.list[i].score_over_fifty;
- }
- }
- var color1 = new $.zui.Color('#48CCCD');
- var color2 = new $.zui.Color('#38ACEC');
- var color3 = new $.zui.Color('#FFD801');
- var color4 = new $.zui.Color('#7F38EC');
- array_points.push({ "value": (temp[0]), "name": '满分', "itemStyle": { "normal": { "color": color1.hexStr() } } });
- array_points.push({ "value": temp[1], "name": '0-15分', "itemStyle": { "normal": { "color": color2.hexStr() } } });
- array_points.push({ "value": temp[2], "name": '15-50分', "itemStyle": { "normal": { "color": color3.hexStr() } } });
- array_points.push({ "value": temp[3], "name": '50分以上', "itemStyle": { "normal": { "color": color4.hexStr() } } });
- for (var i = 0; i < data.list.length; i++) {
- if (i < 7 && center_id == 30) {
- var p = i;
- var color = new $.zui.Color(color1.r - p * 10, color1.g - p * 10, color1.b - p * 10);
- array_points2.push({
- "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
- data.list[i].score_fifty - data.list[i].score_over_fifty),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- } else if (i > 6 && i < 13 && center_id == 31) {
- var p = i - 6;
- var color = new $.zui.Color(color1.r - p * 10, color1.g - p * 10, color1.b - p * 10);
- array_points2.push({
- "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
- data.list[i].score_fifty - data.list[i].score_over_fifty),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- } else if (i > 12 && i < 21 && center_id == 32) {
- var p = i - 12;
- var color = new $.zui.Color(color1.r - p * 10, color1.g - p * 10, color1.b - p * 10);
- array_points2.push({
- "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
- data.list[i].score_fifty - data.list[i].score_over_fifty),
- "name": data.list[i].name,
- "itemStyle": { "normal": { "color": color.hexStr() } }
- });
- }
- }
- push_data(data, '0-15分', "score_fifteen", center_id, color2);
- push_data(data, '15-50分', "score_fifty", center_id, color3);
- push_data(data, '50分以上', "score_over_fifty", center_id, color4);
- } else {
- array_points = [];
- }
- } else if (type == 3) {
- array_allStation_score.length = 0;
- array_allStation.length = 0;
- if (data != null && data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_allStation_score.push((1000 - (filter_handler(data[i].all_check_score, data[i].checked_num, data[i].people_num, 0))));
- }
- } else {
- array_allStation_score.length = 0;
- array_allStation.length = 0;
- }
- if (eval("Math.min(" + array_allStation_score.toString() + ")") == 0)
- min_station = 0;
- else
- min_station = eval("Math.min(" + array_allStation_score.toString() + ")").toFixed(0) - 10;
- // 给道管下的收费站排名次
- var rank = new Array();
- rank[0] = 1;
- for (var i = 1; i < array_allStation_score.length; i++) {
- if (array_allStation_score[i - 1] == array_allStation_score[i]) {
- rank[i] = rank[i - 1];
- } else {
- rank[i] = i + 1;
- }
- }
- for (var i = 0; i < array_allStation_score.length; i++) {
- array_allStation.push(data[i].feeStationName.substr(0, data[i].feeStationName.length - 3) + "\n" + (rank[i]));
- }
- } else if (type == 4) {
- array_score_order.length = 0;
- array_score_data.length = 0;
- if (data != null && data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_score_order.push(data[i].user.truename + "\n" + "(" + data[i].user.fee_station_name.substr(0, data[i].user.fee_station_name.length - 3) + ")");
- array_score_data.push((1000 - filter(data[i].all_check_score, data[i].checked_num, 0)));
- }
- } else {
- array_score_order.length = 0;
- array_score_data.length = 0;
- }
- if (eval("Math.min(" + array_score_data.toString() + ")") == 0)
- min_pre = 0;
- else
- min_pre = eval("Math.min(" + array_score_data.toString() + ")").toFixed(0) - 10;
- } else if (type == 5) {
- array_score_last.length = 0;
- array_get_score.length = 0;
- // 已有收费站数组 和 对象
- var feeStationTemp = [];
- var feeStationTempObj = {};
- if (data != '' && data.length != 0) {
- for (var i = 0; i < data.length; i++) {
- array_get_score.push((1000 - filter(data[i].all_check_score, data[i].checked_num, 0)));
- // 处理data
- if (feeStationTempObj[data[i].user.fee_station_name] != null) {
- feeStationTempObj[data[i].user.fee_station_name] += 1;
- } else {
- feeStationTempObj[data[i].user.fee_station_name] = 1;
- feeStationTemp.push(data[i].user.fee_station_name);
- }
- }
- array_score_pie = [];
- for (var x = 0; x < feeStationTemp.length; x++) {
- array_score_pie.push({ 'name': feeStationTemp[x], 'value': feeStationTempObj[feeStationTemp[x]] });
- }
- // console.log(feeStationTemp);
- // console.log(feeStationTempObj);
- } else {
- array_score_last.length = 0;
- array_get_score.length = 0;
- }
- if (eval("Math.min(" + array_get_score.toString() + ")") == 0)
- min_suff = 0;
- else
- min_suff = eval("Math.min(" + array_get_score.toString() + ")").toFixed(0) - 10;
- // 给道管中心人员考核得分后20名
- var rank = new Array();
- rank[0] = 1;
- for (var i = 1; i < array_get_score.length; i++) {
- if (array_get_score[i - 1] == array_get_score[i]) {
- rank[i] = rank[i - 1];
- } else {
- rank[i] = i + 1;
- }
- }
- for (var i = 0; i < array_get_score.length; i++) {
- array_score_last.push(data[i].user.truename + "\n" + "(" + data[i].user.fee_station_name.substr(
- 0, data[i].user.fee_station_name.length - 3) + ")" + "\n" + (rank[i]));
- }
- } else if (type == 6) {
- array_check_type = [];
- if (data.length != 0) {
- var map = new HashMap();
- for (var i = 0; i < data.length; i++) {
- if (map.get(data[i].name) == null) {
- map.set(data[i].name, data[i].all_check_score)
- } else {
- map.set(data[i].name, data[i].all_check_score + map.get(data[i].name))
- }
- }
- map.forEach(function(value, key) {
- array_check_type.push({ "value": value, "name": key });
- });
- } else {
- array_check_type.length = 0;
- }
- } else if (type == 7) {
- // array_points_name.length = 0;
- // array_points_pre.length = 0;
- // arrar_points_month.length = 0;
- if ((data != null && data.Pmth.length != 0) || (data != null && 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;
- }
- }
- }
- function data_each_people_points(data) {
- var flag = false;
- var name = ['环境卫生', '仪容仪表着装', '表情', '动作', '文明用语', '工作纪律及行为举止', '便民服务', '安全管理']
- array_all_name = name;
- // array_all_deptname = ["连云港道管", "盐城道管", "南通道管"];
- 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 < name.length; i++) {
- // var temp_map_m = new HashMap();
- // var temp_map_p = new HashMap();
- for (var j = 0; j < Tmth.length; j++) {
- flag = false;
- if (array_all_deptname.length > 0) {
- for (var p = 0; p < array_all_deptname.length; p++) {
- if (array_all_deptname[p] == Tmth[j].feeStationName) {
- flag = true;
- break;
- }
- }
- }
- if (!flag) {
- array_all_deptname.push(Tmth[j].feeStationName);
- }
- if (name[i] == Tmth[j].name) {
- if (map_month_data.get(Tmth[j].feeStationName) != null) {
- var map = map_month_data.get(Tmth[j].feeStationName)
- if (map.get(name[i]) != null) {
- map.set(name[i], map.get(name[i]) + Tmth[j].all_check_score);
- } else {
- map.set(name[i], Tmth[j].all_check_score);
- }
- map_month_data.set(Tmth[j].feeStationName, map);
- } else {
- var map = new HashMap();
- map.set(name[i], Tmth[j].all_check_score);
- map_month_data.set(Tmth[j].feeStationName, map);
- }
- }
- }
- for (var j = 0; j < Pmth.length; j++) {
- flag = false;
- if (array_all_deptname.length > 0) {
- for (var p = 0; p < array_all_deptname.length; p++) {
- if (array_all_deptname[p] == Pmth[j].feeStationName) {
- flag = true;
- break;
- }
- }
- }
- if (!flag) {
- array_all_deptname.push(Pmth[j].feeStationName);
- }
- if (name[i] == Pmth[j].name) {
- if (map_per_data.get(Pmth[j].feeStationName) != null) {
- var map = map_per_data.get(Pmth[j].feeStationName)
- if (map.get(name[i]) != null) {
- map.set(name[i], map.get(name[i]) + Pmth[j].all_check_score);
- } else {
- map.set(name[i], Pmth[j].all_check_score);
- }
- map_per_data.set(Pmth[j].feeStationName, map);
- } else {
- var map = new HashMap();
- map.set(name[i], Pmth[j].all_check_score);
- map_per_data.set(Pmth[j].feeStationName, map);
- }
- }
- }
- // map_month_data.set(name[i], temp_map_m)
- // map_pre_data.set(name[i], temp_map_p)
- }
- }
- /**
- * 除数为0处理
- * @param {*} num
- * @param {*} num1
- * @param {*} num2
- * @param {*} num4
- */
- function filter_handler(num, num1, num2, num4) {
- if (num1 == 0 || num2 == 0) {
- return num4;
- } 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) {
- // 路径配置
- 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) {
- // 基于准备好的dom,初始化echarts图表
- if (flag) {
- year_assess = ec.init(document.getElementById('roadManager-year-assess'), theme);
- }
- points_assess = ec.init(document.getElementById('roadManager-points-assess'), theme);
- score_rank = ec.init(document.getElementById('tollStation-score-rank'));
- rank_pre = ec.init(document.getElementById('people-rank-pre'));
- rank_suf = ec.init(document.getElementById('people-rank-suf'), theme);
- check_type = ec.init(document.getElementById('server-check-type'), theme);
- people_points = ec.init(document.getElementById('each-people-points'));
- }
- );
- }
- /**
- * 图一
- */
- function roadManager_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: months
- }],
- yAxis: [{
- type: 'value',
- min: min_year,
- max: 1000,
- 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 roadManager_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}
- // }
- // }
- // }
- // ]
- // };
- option = {
- tooltip: {
- trigger: 'item',
- formatter: "道管中心考核扣分占比 <br/>{b} : {c}人 ({d}%)"
- },
- toolbox: {
- show: true,
- },
- calculable: false,
- series: [{
- name: '访问来源',
- type: 'pie',
- selectedMode: 'single',
- radius: [0, 80],
- // for funnel
- x: '20%',
- width: '40%',
- funnelAlign: 'right',
- max: 1548,
- itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b}:\n{c}人({d}%)',
- textStyle: {
- alias: 'center',
- fontSize: 10,
- color: '#888'
- }
- },
- labelLine: {
- show: true,
- length: 80,
- lineStyle: {
- color: '#888'
- }
- }
- }
- },
- data: array_points
- },
- {
- name: '访问来源',
- type: 'pie',
- radius: [100, 125],
- // for funnel
- x: '60%',
- width: '35%',
- funnelAlign: 'left',
- max: 1048,
- itemStyle: {
- normal: {
- label: {
- show: false,
- formatter: '{b}:{c}人({d}%)'
- },
- labelLine: {
- show: false
- }
- }
- },
- data: array_points2
- }
- ]
- };
- return option;
- }
- /**
- * 图三
- */
- function tollStation_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: "75%",
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- axisLabel: {
- interval: 0 // 显示x轴所有信息,不隐藏部分
- },
- data: array_allStation
- }],
- yAxis: [{
- type: 'value',
- min: min_station,
- max: 1000
- }],
- series: [{
- type: 'bar',
- data: array_allStation_score,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- markLine: {
- data: [
- { type: 'average', name: '平均值' }
- ]
- }
- }]
- };
- return option;
- }
- /**
- * 图四
- */
- function people_rank_pre() {
- 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',
- axisLabel: {
- interval: 0 // 显示x轴所有信息,不隐藏部分
- },
- data: array_score_order
- }],
- yAxis: [{
- type: 'value',
- min: min_pre,
- max: 1000
- }],
- series: [{
- name: '平均分',
- type: 'bar',
- data: array_score_data,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- markPoint: {
- data: [
- { type: 'max', name: '最大值' },
- { type: 'min', name: '最小值' }
- ]
- },
- markLine: {
- data: [
- { type: 'average', name: '平均值' }
- ]
- }
- }]
- };
- return option;
- }
- /**
- * 图五
- */
- function people_rank_suf() {
- option = {
- tooltip: {
- trigger: 'axis'
- },
- toolbox: {
- show: true,
- y: 'bottom',
- },
- calculable: true,
- grid: {
- width: "88%",
- },
- xAxis: [{
- type: 'category',
- axisLabel: {
- interval: 0 // 显示x轴所有信息,不隐藏部分
- },
- splitLine: { show: false },
- data: array_score_last
- }],
- yAxis: [{
- type: 'value',
- min: min_suff,
- max: 1000
- }],
- series: [{
- name: '平均分',
- type: 'bar',
- data: array_get_score,
- itemStyle: {
- normal: {
- color: '#00ced1',
- label: {
- show: true,
- position: 'insideTop'
- }
- }
- },
- markPoint: {
- data: [
- { type: 'max', name: '最大值' },
- { type: 'min', name: '最小值' }
- ]
- },
- },
- {
- name: '搜索引擎细分',
- type: 'pie',
- tooltip: {
- trigger: 'item',
- formatter: '{b} : {c} ({d}%)'
- },
- center: ['80%', '20%'],
- radius: [0, 40],
- itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b} :\n{c}人 ({d}%)'
- },
- labelLine: {
- length: 20
- }
- }
- },
- data: array_score_pie
- }
- ]
- };
- 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() {
- var sdata = new Array();
- for (var j = 0; j < array_all_deptname.length; j++) {
- var dept = array_all_deptname[j]
- if (map_per_data.get(dept) != null) {
- var data_a = new Array();
- var d_t = map_per_data.get(dept);
- for (var i = 0; i < array_all_name.length; i++) {
- var name = array_all_name[i];
- data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
- }
- var d_tt = {
- name: dept,
- type: 'bar',
- stack: '上月',
- data: data_a
- }
- sdata.push(d_tt);
- } else {
- var data_a = new Array();
- for (var i = 0; i < array_all_name.length; i++) {
- var name = array_all_name[i];
- data_a.push(0);
- }
- var d_tt = {
- name: dept,
- type: 'bar',
- stack: '上月',
- data: data_a
- }
- sdata.push(d_tt);
- }
- if (map_month_data.get(dept) != null) {
- var data_a = new Array();
- var d_t = map_month_data.get(dept);
- for (var i = 0; i < array_all_name.length; i++) {
- var name = array_all_name[i];
- data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
- }
- var d_tt = {
- name: dept,
- type: 'bar',
- stack: '本月',
- data: data_a
- }
- sdata.push(d_tt);
- } else {
- var data_a = new Array();
- for (var i = 0; i < array_all_name.length; i++) {
- var name = array_all_name[i];
- data_a.push(0);
- }
- var d_tt = {
- name: dept,
- type: 'bar',
- stack: '本月',
- data: data_a
- }
- sdata.push(d_tt);
- }
- }
- var namelist = new Array();
- for (var i = 0; i < array_all_name.length; i++) {
- var name = array_all_name[i];
- if (name == '仪容仪表着装') {
- name = '仪表';
- }
- if (name == '工作纪律及行为举止') {
- name = '行为';
- }
- namelist.push(name);
- }
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter: function(params, ticket, callback) {
- var name = "";
- var content = "";
- if (params.length > 0) {
- for (var i = 0; i < params.length; i++) {
- var p = params[i];
- name = p.name;
- if (p.series.stack == "本月") {
- content += "<br>本月 " + p.seriesName.replace("收费站", "") + ":" + p.value + "分"
- } else {
- content += "<br>上月 " + p.seriesName.replace("收费站", "") + ":" + p.value + "分"
- }
- }
- }
- return name + content;
- }
- },
- noDataLoadingOption: {
- text: '暂无数据',
- effect: 'bubble',
- effectOption: {
- effect: {
- n: 0 //气泡个数为0
- }
- },
- textStyle: {
- fontSize: 20,
- fontFamily: 'cursive',
- fontWeight: 'bold'
- }
- },
- grid: {
- width: "80%",
- },
- legend: {
- data: array_all_deptname
- },
- calculable: true,
- xAxis: [{
- type: 'category',
- data: namelist
- }],
- yAxis: [{
- type: 'value'
- }],
- series: sdata
- };
- return option;
- }
- });
- function setVisit() {
- if (roleContains("ROAD_MANAGER") || roleContains("STATION")) {
- $(".div-roadManage select").attr("disabled", "disabled");
- }
- }
|