| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166 |
- 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 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 + names,
- "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 + names,
- "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 + names,
- "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.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 == 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 = true;
- var 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 < name.length; i++) {
- flag = true;
- if (Tmth.length > 0) {
- for (var j = 0; j < Tmth.length; j++) {
- if (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 (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 (name[i] != "") {
- if (name[i] == '仪容仪表着装') {
- name[i] = '仪表';
- }
- if (name[i] == '工作纪律及行为举止') {
- name[i] = '行为';
- }
- array_points_name.push(name[i]);
- }
- if (flag) {
- array_points_pre.push(Ptemp[i]);
- arrar_points_month.push(Ttemp[i]);
- }
- }
- }
- /**
- * 除数为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, 50],
- // for funnel
- x: '20%',
- width: '40%',
- funnelAlign: 'right',
- max: 1548,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'inner',
- formatter: function(params, ticket, callback) {
- var res = params.name;
- if (params.percent < 10) {
- return "";
- }
- return res;
- }
- },
- labelLine: {
- show: false
- }
- }
- },
- data: array_points
- },
- {
- name: '访问来源',
- type: 'pie',
- radius: [60, 100],
- // for funnel
- x: '60%',
- width: '35%',
- funnelAlign: 'left',
- max: 1048,
- itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b} :\n{c}人 ({d}%)'
- },
- labelLine: {
- show: true
- }
- }
- },
- 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() {
- 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_points_name
- }],
- 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("ROAD_MANAGER") || roleContains("STATION")) {
- $(".div-roadManage select").attr("disabled", "disabled");
- }
- }
|