123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323 |
- var self;
- var type, level, area, title,sort=1,banerIndex;
- var roleLevel, userRole;
- var startDate = null;//近3月的开始时间
- var endDate = null;//近3月的结束时间
- var customHeight = 63;//自定义折线图、柱状图混合表中各项的高度
- var scroller1 = null;
- var old_back = mui.back;
- var curLeveArr = null;//当前级别需要请求的url参数集合
- var taskNum = 0;//任务量
- var dateData = {};//趋势图数据
- var isInit = true;
- var CITY_CODE = "350200";//默认厦门市
- var TD_PAGE_SIZE = 20;//所有团队数据分页条数
- var current_team_index = 0;//所有团队显示的索引值
- var team_data_list = null;//所有团队数据(签约量)
- var team_name_list = null;//所有团队数据(名称)
- var team_top_list = null;//所有团队数据(排名数据)
- var team_scroller = null;
- //定义年份
- var chooseYear;
- var now = new Date();
- if(now.getMonth() >= 6){
- chooseYear = now.getFullYear();
- }else{
- chooseYear = now.getFullYear() - 1;
- }
- mui.plusReady(function() {
- self = plus.webview.currentWebview();
- type = self.type;
- startDate = getStartDate();//近3月的开始时间
- // endDate = getDateBefore(0);//近3月的结束时间
- endDate = getEndDate(); //获得结束时间
- initData();//数据初始化
- initScroller();//scroll初始化
- shaixuanInit(self);
- bindEvents();//事件绑定
-
- });
- /*****************************************************************************/
- /***** 页面初始化处理 **********/
- /*****************************************************************************/
- var initData = function(){
- // userRole = plus!=null ?JSON.parse(plus.storage.getItem("userRole"))[0]:{} ;
- userRole = plus!=null ? JSON.parse(plus.storage.getItem("selectedRole")) : {};
- roleLevel = userRole.code == CITY_CODE ? 4 : userRole.code.length==6 ? 3 : 2;
- level = roleLevel;
- area = userRole.code;
- title = userRole.name;
- plus.storage.setItem("userLevel",level+"");
- plus.storage.setItem("userArea",area);
- //初始默认选中的时间和类型
- $(".choose-label").text(chooseYear+"年(按任务)");
-
- //搜集页面请求的参数
- var paramsArr = [],resultArr = [];
- var index = 13;
- var lowCode = $("#Dtitle").attr("data-lowCode") || "";
- if(lowCode){
- index = 17;
- }
- if(level==4){//市管
- paramsArr.push({tags:["各区","社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/sign_info",params:{endDate:endDate,area:area,level:level,lowCode:lowCode, year: chooseYear}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:index,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowLevel:2,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowLevel:1,lowCode:lowCode}});
- }else if(level==3){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/sign_info",params:{endDate:endDate,area:area,level:level,lowCode:lowCode, year: chooseYear}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:index,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowLevel:1,lowCode:lowCode}});
- }else if(level==2){//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/sign_info",params:{endDate:endDate,area:area,level:level,lowCode:lowCode, year: chooseYear}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:index,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowCode:lowCode}});
- }
- resultArr.push(paramsArr);
- plus.storage.setItem("levelParamsArr",JSON.stringify(resultArr));
- curLeveArr = paramsArr;
- loadAllData(paramsArr);
- },
- loadAllData = function(arr){
- plus.nativeUI.showWaiting();
- //1-1:加载数据截止时间
- sendPost("/statistics/time",null,function(res){
- },function(res){
- if(res.status=="200"){
- var date = (res.data && res.data.substring(11,16)) || "";
- $(".jiezhi-time").html(date)
- }
- });
-
- //1-2: 显示title
- title = arr[0].curTitle;
- if(arr[0].level==4){
- title = title.substring(0,3);
- }
- $("#title").html(title);
-
- //1-3 :加载tab
- var tagsArr = arr[0].tags;
- var tagStr = "";
- for(var i=0;i<tagsArr.length;i++){
- var classz = i==0?"hit":"";
- var dataClick = i==0?"true":"false";//是否已点击过
- tagStr += '<li class="'+classz+'" data-click="'+dataClick+'"><a href="#" class="c-f16">'+tagsArr[i]+'</a></li>';
- }
- $(".c-lab-mor").html(tagStr);
- $(".div-data-list").hide();
- $(".div-data-list.div-list0").show();
- if($(".c-lab-mor li.hit a").html()=="团队" || tagsArr.length==1){
- $(".div-right-danwei").html("人");
- }else{
- $(".div-right-danwei").html("千人");
- }
-
- var index = 13;
- var lowCode = $("#Dtitle").attr("data-lowCode") || "";
- if(lowCode){
- index = 17;
- }
- //1-4 :加载签约率、完成率
- arr[1].params.index = index;
- arr[1].params.lowCode = lowCode;
- arr[1].params.year = chooseYear;
- arr[1].params.endDate = endDate;
- sendPost(arr[1].reqUrl, arr[1].params, null, countHandle);
-
- //1-5:趋势图表
- var interval = parseInt(arr[2].params.interval)-1 || 0;
- $('.div-btn-group .div-btn').removeClass("active");
- $('.div-btn-group .div-btn').eq(interval).addClass("active");
- arr[2].params.index = index;
- arr[2].params.lowCode = lowCode;
- arr[2].params.startDate = startDate;
- arr[2].params.endDate = endDate;
- sendPost(arr[2].reqUrl, arr[2].params, null, dateLineHandle);
-
- //1-6:加载【第一个】tab标签数据
- arr[3].params.index = index;
- arr[3].params.lowCode = lowCode;
- arr[3].params.date = endDate;
- sendPost(arr[3].reqUrl, arr[3].params, null, listHandle);
-
- },
- initScroller = function(){
- window.scroller1 = $("#wrapper1").initScroll(
- {
- pullDownAction: function(){
- current_team_index = 0;
- $(".pullDown").show();
- plus.nativeUI.showWaiting();
- loadAllData(curLeveArr);
- },pullUpAction: function() {
- $(".pullUp").hide();
- if($(".c-lab-mor li.hit a").html()=="团队"){//团队tab页才做分页
- if(current_team_index==(Object.keys(team_data_list).length-1)){
- mui.toast("没有更多数据了...");
- $(".pullUp").hide();
- plus.nativeUI.closeWaiting();
- return false;
- }
- $(".pullUp").show();
- plus.nativeUI.showWaiting();
- current_team_index++;
- loadTeamData(team_data_list[current_team_index],team_top_list[current_team_index],true);
- }
- return false;
- }
- }
- );
- // scroller1.on('beforeScrollStart',function() {
- // console.log(scroller1.pointX);
- // });
-
- },
- /**
- * 初始化筛选事件
- */
- shaixuanInit = function(main){
- var shaixuan = plus.webview.getWebviewById('shaixuan2.html');
- if(!shaixuan){
- shaixuan = mui.createWindow({
- id: 'shaixuan2.html',
- url: 'shaixuan2.html',
- styles: {
- top: 0,
- bottom: 0,
- left: '20%',
- width: '80%',
- scorllIndicator: "none"
- },
- show:{
- aniShow: "slide-in-right",
- duration: "400"
- },
- extras:{
- showType: 1
- }
- });
- }
- window.addEventListener("hideShaiXuan",function(){
- console.log("hideShaiXuan");
- main.setStyle({mask:"none"});
- shaixuan.hide();
- }, false);
-
- window.addEventListener("showShaiXuan", function() {
- shaixuan.show();
- main.setStyle({mask:"rgba(0,0,0,0.5)"});
- main.addEventListener("maskClick",function(){
- main.setStyle({mask:"none"});
- shaixuan.hide();
- }, false);
- });
- },
- bindEvents = function(){
- //标签切换
- $(".c-lab-mor").on("tap","li",function(){
- var liIndex = $(this).index();
- var tabid = $(this).attr("id");
- var top = $(this).offset().top;
- $(".c-lab-mor li").removeClass("hit");
- $(this).addClass("hit");
- //1-6:加载tab标签数据
- if($(this).attr("data-click")=="false"){//tab数据未加载
- plus.nativeUI.showWaiting();
- var index = 13;
- var lowCode = $("#Dtitle").attr("data-lowCode") || "";
- if(lowCode){
- index = 17;
- }
- if(liIndex==1){//社区数据
- curLeveArr[4].params.index = index;
- curLeveArr[4].params.lowCode = lowCode;
- curLeveArr[4].params.date = endDate;
- sendPost(curLeveArr[4].reqUrl, curLeveArr[4].params, null, listHandle);
- }else if(liIndex==2){//团队数据
- curLeveArr[5].params.index = index;
- curLeveArr[5].params.lowCode = lowCode;
- curLeveArr[5].params.date = endDate;
- sendPost(curLeveArr[5].reqUrl, curLeveArr[5].params, null, listHandle);
- }
- $(this).attr("data-click","true");
- }
- $(".div-data-list").hide();
- $(".div-list"+liIndex).show();
- $(".div-list1 li .div-name,.div-list1 li .div-amount,.div-list2 li .div-name,.div-list2 li .div-amount").each(function(){
- if($(this).height()==21){
- $(this).addClass("mt20")
- }else if($(this).height()==42){
- $(this).addClass("mt10")
- }
- })
- if($(".c-lab-mor li.hit a").html()=="团队"){
- $(".div-right-danwei").html("人");
- }else{
- $(".div-right-danwei").html("千人");
- }
- scroller1.refresh();
- window.onscroll = function () {
- var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
- if(top!=-1 && top>0){
- window.scrollTo(0,top);
- top = -1;
- }
- }
- });
-
- //日、周、月按钮切换
- $(".div-btn-group").on("click",".div-btn",function(){
- var dataId = $(this).attr("data-id");
- $(".div-btn-group .div-btn").removeClass("active");
- $(this).addClass("active");
- //1-5:趋势图表
- curLeveArr[2].params.interval = dataId;
- sendPost(curLeveArr[2].reqUrl, curLeveArr[2].params, null, dateLineHandle);
- });
-
- $(".scroll-wrapper").on("tap",".div-data-list .list-ul .div-name",function(event){
- if($(".c-lab-mor li.hit a").html()=="团队") {
- sendGet("/doctor/admin-teams/teams/info",{teamId:$(this).closest("li").attr("data-code")},function(res){
-
- },function(res){
- if(res.status==200){
- var team = res.data.team;
- var members = res.data.members;
- $(".span-name").html(team.name || "");
- $(".span-hospitalName").html(team.hospitalName || "");
- $(".span-leaderName").html(team.leaderName || "");
- $(".span-team-count").html(members.length.toString());
- var membersName = "";
- for(var i=0;i<members.length;i++){
- if(i==20) break;
- membersName+=members[i].name+"、";
- }
- if(members.length>20){
- membersName = membersName!=""?membersName.substring(0,membersName.length-1)+"等":membersName;
- }else{
- membersName = membersName!=""?membersName.substring(0,membersName.length-1):membersName;
- }
- $(".span-members").html(membersName);
- $(".modal-overlay").addClass("modal-overlay-visible");
- setTimeout(function(){
- $(".modal-content").show();
- },50)
-
- }else{
- mui.toast("暂无相关团队详情!");
- }
-
- });
-
- return false;
- }
- level = curLeveArr[0].level;
- level--;
- area = $(this).closest("li").attr("data-code");
- var name = $(this).closest("li").attr("data-name");
- title = name;
- $("#title").html(title);
- var paramsArr = [];
- var index = 13;
- var lowCode = $("#Dtitle").attr("data-lowCode") || "";
- if(lowCode){
- index = 17;
- }
- if(level==3 && $(".c-lab-mor li.hit a").html()=="各区"){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/sign_info",params:{endDate:endDate,area:area,level:level,lowCode:lowCode, year: chooseYear}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index:index,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:level,index:index,area:area,lowLevel:1,lowCode:lowCode}});
- }else{//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:2},
- {reqUrl:"/statistics/sign_info",params:{endDate:endDate,area:area,level:2,lowCode:lowCode, year: chooseYear}},
- {reqUrl:"/statistics/interval_total",params:{level: 2, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index:index,lowCode:lowCode}},
- {reqUrl:"/statistics/lowlevel_all",params:{sort:1,date:endDate,level:2,index:index,area:area,lowCode:lowCode}});
- }
- var existArr = JSON.parse(plus.storage.getItem("levelParamsArr"));
- existArr.push(paramsArr);
- plus.storage.setItem("levelParamsArr",JSON.stringify(existArr));
- curLeveArr = paramsArr;
- current_team_index = 0;
- loadAllData(paramsArr);
- event.preventDefault();
- return false;
- });
-
- /*
- $(".demo-comtop").on("click","h1",function(){
- $(".lin-mask").show();
- $(".lin-sel-group").show();
- });
-
- $(".lin-mask").on("click",function(){
- $(".lin-mask").hide();
- $(".lin-sel-group").hide();
- });
-
- $(".lin-sel-group").on("click","li",function(){
- var lowCode = $(this).attr("data-lowCode") || "";
- var dataID = $(this).attr("data-id");
- if(dataID=="2"){//整体签约(按人口)
- $(".span-amount1").html("人口数");
- $(".span-amount2").html("目标量").show();
- $(".span-amount-color").show();
- }else{
- $(".span-amount1").html("目标量");
- $(".span-amount2").html("超出量").hide();
- $(".color-block.span-amount-color").css("display","none");
- }
- $(".lin-sel-group li").removeClass("checked");
- $(this).addClass("checked");
- $(".lin-mask").trigger("click");
- $("#Dtitle").attr("data-lowCode",lowCode).attr("data-id",dataID);
- //重新加载数据
- current_team_index = 0;
- plus.nativeUI.showWaiting();
- loadAllData(curLeveArr);
- });
- */
- //弹出遮罩
- $(".icon-remark").on("click", function(e) {
- $(".modal-overlay").addClass("modal-overlay-visible");
- setTimeout(function(){
- $(".modal-content").show();
- },50)
- });
-
- $(".div-close,.modal-overlay").on("click",function(){
- $(".modal-overlay").removeClass("modal-overlay-visible");
- $(".modal-content").hide();
- });
-
- //左滑筛选区域的数据
- $('.header-link').on("tap", function(){
- var self = plus.webview.currentWebview();
- mui.fire(self, "showShaiXuan");
- });
-
- //添加页面监听
- window.addEventListener("refresh", function(e){
- var lowCode = e.detail.lowCode || "";
- var dataID = e.detail.id;
- var year = e.detail.year;
- var name = e.detail.name;
- chooseYear = year;
- if(dataID=="2"){//整体签约(按人口)
- $(".span-amount1").html("人口数");
- $(".span-amount2").html("目标量").show();
- $(".span-amount-color").show();
- }else{
- $(".span-amount1").html("目标量");
- $(".span-amount2").html("超出量").hide();
- $(".color-block.span-amount-color").css("display","none");
- }
- $(".choose-label").text(year+"年("+name+")");
- $("#Dtitle").attr("data-lowCode",lowCode).attr("data-id",dataID);
- //重新加载数据
- current_team_index = 0;
- plus.nativeUI.showWaiting();
- startDate = getStartDate();
- endDate = getEndDate();
- //更新选择的时间
- curLeveArr[1].params.year = year;
- curLeveArr[1].params.endDate = endDate;
- curLeveArr[2].params.startDate = startDate;
- curLeveArr[2].params.endDate = endDate;
- if(curLeveArr[3]){
- curLeveArr[3].params.date = endDate;
- }
- if(curLeveArr[4]){
- curLeveArr[4].params.date = endDate;
- }
- if(curLeveArr[5]){
- curLeveArr[5].params.date = endDate;
- }
-
- //更新选择的lowCode
- curLeveArr[1].params.lowCode = lowCode;
- curLeveArr[2].params.lowCode = lowCode;
- if(curLeveArr[3]){
- curLeveArr[3].params.lowCode = lowCode;
- }
- if(curLeveArr[4]){
- curLeveArr[4].params.lowCode = lowCode;
- }
- if(curLeveArr[5]){
- curLeveArr[5].params.lowCode = lowCode;
- }
- //更新dataId
- // curLeveArr[2].params.interval = dataId;
- // $('.div-btn-group .div-btn').attr("data-id",dataId);
-
- loadAllData(curLeveArr);
- });
-
- //说明信息相关事件
- $("#closeBtn").on("tap", function(){
- $(".information").hide();
- scroller1.refresh();
- });
-
- $(".info-icon").on("tap", function(){
- $(".information").show();
- scroller1.refresh();
- });
- };
- /*****************************************************************************/
- /***** 数据返回处理函数 **********/
- /*****************************************************************************/
- var countHandle = function(res){
- if(res.status == 200) {
- res = res.data;
- console.log(JSON.stringify(res))
- $('#qieyuelv').waterbubble({
- txt: res.signRate.rate.substring(0,res.signRate.rate.length-2) + "%",
- data: res.signRate.rate/100,
- waterColor: '#12B7F5',
- lineWidth:0,
- radius: 75,
- textColor: 'rgba(0, 0, 0, 0.8)',
- font: 'bold 25px arial'
- });
-
- $(".p-qianyuelv").html("<span class='c-17b3ec'>"+res.signRate.sign+"</span>/"+res.signRate.people);
-
- $('#dabiaolv').waterbubble({
- txt: res.signTaskRate.rate.substring(0,res.signTaskRate.rate.length-2) + "%",
- data: res.signTaskRate.rate/100,
- waterColor: '#4ECD70',
- lineWidth:0,
- radius: 75,
- textColor: 'rgba(0, 0, 0, 0.8)',
- font: 'bold 25px arial'
- });
- $(".p-dachenglv").html("<span class='c-4ECD70'>"+res.signTaskRate.sign+"</span>/"+res.signTaskRate.people);
- } else {
- mui.toast(res.msg);
- }
- },
- dateLineHandle = function(res){
- if(res.status==200){
- for(var p in res.data){
- taskNum = res.data[p].taskNum;
- dateData[p] = formatDateData(res.data[p].data);
- if(dateData[p].amountArr && dateData[p].amountArr.length>0){
- $('#l-jmfx').toggle(p == "index_13" );
- $(".l-zxt-con").hide();
- mui.later(function(){
- $(".l-zxt-con").show();
- }, 100);
- $("#echarts_wushuju").hide();
- } else{
- $(".l-zxt-con").hide();
- $("#echarts_wushuju").show();
- }
- drawChart(dateData[p]);//初始化折线图
- }
- } else {
- mui.toast(res.msg);
- }
- plus.nativeUI.closeWaiting();
- },
- listHandle = function(res){
- if(res.status == 200) {
- res = res.data;
- for(var k in res){
- var list = res[k];
- var topArr = soreRank(amountArr(list));
- var liIndex = $(".c-lab-mor li.hit").index();
- if($(".c-lab-mor li.hit a").html()=="团队"){//社区看团队数据
- teamFenYeFun(list,topArr);
- }else{
- var resultStr = "";
- var topClass = "";
- var qylResultStr = "";
- var qylClass = "c-a0dc28";
- if($(".c-lab-mor li.hit a").html()=="团队"){
- qylClass = "c-17b8ec";
- }
- for(var j in list){
- switch (topArr[j]){
- case 1:
- topClass="cb-EA5B3A";
- break;
- case 2:
- topClass="cb-FF8746";
- break;
- case 3:
- topClass="cb-69CA2E";
- break;
- default:
- topClass="cb-3DA9CE";
- break;
- }
-
-
- resultStr+='<li data-name="'+list[j].name+'" data-code="'+list[j].code+'">'+
- '<div class="div-top '+topClass+' c-f10">'+topArr[j]+'</div>'+
- '<div class="div-name f-fs14">'+list[j].name+'</div>'+
- '</li>';
-
- qylResultStr+='<li>'+'<div class="div-amount c-f10 mr10 '+qylClass+'">'+(parseFloat(list[j].amount)/1000).toFixed(2)+'</div>'+'</li>';
-
- }
-
- $(".div-list"+liIndex).show();
- $(".div-list"+liIndex+" .list-ul").html(resultStr);
- $(".div-list"+liIndex+" .div-right-data-content .list-ul").html(qylResultStr);
- $(".div-list"+liIndex+" li .div-name,"+".div-list"+liIndex+" li .div-amount").each(function(){
- if($(this).height()==21){
- $(this).addClass("mt20")
- }else if($(this).height()==42){
- $(this).addClass("mt10")
- }
- })
- if(list.length==0){
- scroller1.refresh();
- plus.nativeUI.closeWaiting();
- return false;
- }
-
- //加载图表数据
- var amountArrS = amountArr(list).reverse();//签约量
- var nameArrs = nameArr(list).reverse();//名称
- $("#chart-main"+liIndex).height(list.length*customHeight+100);
- $(".div-list"+liIndex+" .div-right-content").show();
- $(".div-list"+liIndex+" .div-right-team-content").hide();
- var rateArrS = rateArr(list).reverse();//签约率
- var personArrS = personArr(list).reverse();//人口数
- var taskArrS = taskArr(list).reverse();//任务量
- var amountArrResult = arr_dive(personArrS,amountArrS);
- var mblValue = parseFloat(list[0].signTaskNum).toFixed(2); //目标率
- if($("#Dtitle").attr("data-id")=="2"){//整体签约(按人口)
- $(".div-rks-title").html("人口数");
- $(".div-mbl-title").html("目标量");
- echartsFun("chart-main"+liIndex,amountArrS,amountArrResult,taskArrS,rateArrS,nameArrs,mblValue);//区进展、社区进展的图表
- }else{
- $(".div-rks-title").html("目标量");
- $(".div-mbl-title").html("超出量");
- var qylAmountArr = arr_dive_qyl(amountArrS,taskArrS);//签约量
- var mblAmountArr = arr_dive_mbl(amountArrS,taskArrS);//目标量
- var cclAmountArr = arr_dive_ccl(amountArrS,taskArrS);//超出量(目标量-签约量)
- echartsCCFun("chart-main"+liIndex,qylAmountArr,mblAmountArr,cclAmountArr,rateArrS,nameArrs,mblValue);
- }
-
- }
-
- scroller1.refresh();
- plus.nativeUI.closeWaiting();
- }
-
- } else {
- mui.toast(res.msg);
- }
- },
- teamFenYeFun = function(recordList,topArr){
- if(recordList){
- team_top_list = _.groupBy(topArr,function(item,i){return Math.floor(i/TD_PAGE_SIZE)});
- team_data_list = _.groupBy(recordList,function(item,i){return Math.floor(i/TD_PAGE_SIZE)});
- if(team_data_list){
- loadTeamData(team_data_list[current_team_index],team_top_list[current_team_index],false);
- }
- }
-
- },
- loadTeamData = function(list,topArr,isPullUp){
- var resultStr = "";
- var topClass = "";
- var qylResultStr = "";
- var qylClass = "c-17b8ec";
- var liIndex = $(".c-lab-mor li.hit").index();
- if(isPullUp){
- var newLiIndex = $(".div-data-list").length;
- var chartMainId = "chart-main"+newLiIndex;
- var divListClassz = "div-list"+newLiIndex;
- var addDivList = '<div class="div-data-list '+divListClassz+' f-dn" style="position: relative;">'+
- '<div class="div-left-content" style="top: 0px;">'+
- '<ul class="list-ul"></ul>'+
- '</div>'+
- '<div class="div-right-data-content" style="top: 0px;">'+
- '<ul class="list-ul f-fr"></ul>'+
- '</div>'+
- '<div id="'+chartMainId+'" style="width: 100%; margin: 0px 0px 0px 35px;"></div>'+
- '</div>';
- $(".div-data-list:last").after(addDivList);
- liIndex = newLiIndex;
- }
- setTimeout(function(){
- var amountArrS = amountArr(list,true);//签约量
- var nameArrs = nameArr(list);//名称
- for(var j in list){
- switch (topArr[j]){
- case 1:
- topClass="cb-EA5B3A";
- break;
- case 2:
- topClass="cb-FF8746";
- break;
- case 3:
- topClass="cb-69CA2E";
- break;
- default:
- topClass="cb-3DA9CE";
- break;
- }
- var redClass = list[j].amount>1500?"c-EA5B3A":"";
- resultStr+='<li data-name="'+list[j].name+'" data-code="'+list[j].code+'">'+
- '<div class="div-top '+topClass+' c-f10">'+topArr[j]+'</div>'+
- '<div class="div-name f-fs14 '+redClass+'">'+(list[j].name || "未知")+'</div>'+
- '</li>';
-
- qylResultStr+='<li>'+'<div class="div-amount mr10 '+qylClass+'">'+list[j].amount+'</div>'+'</li>';
-
- }
-
- $(".div-list"+liIndex).show();
- $(".div-list"+liIndex+" .list-ul").html(resultStr);
- $(".div-list"+liIndex+" .div-right-data-content .list-ul").html(qylResultStr);
-
- $(".div-list"+liIndex+" li .div-name,"+".div-list"+liIndex+" li .div-amount").each(function(){
- if($(this).height()==21){
- $(this).addClass("mt20")
- }else if($(this).height()==42){
- $(this).addClass("mt10")
- }
- })
- if(!list){
- scroller1.refresh();
- plus.nativeUI.closeWaiting();
- return false;
- }
-
- $(".div-list"+liIndex+" .div-right-content").hide();
- if(!list){
- $(".div-right-danwei").hide();
- $(".div-list"+liIndex+" .div-right-team-content").hide();
- $("#chart-main"+liIndex).hide();
- }else{
- if(chooseYear == 2016){
- $(".tk-span").hide();
- }
- $(".div-right-danwei").show();
- $(".div-list"+liIndex+" .div-right-team-content").show();
- $("#chart-main"+liIndex).show();
- var heightM = current_team_index==0?list.length*customHeight+30:list.length*customHeight;
- $("#chart-main"+liIndex).height(heightM);
- //增加调控量的数据显示
- var regulationAmount = list[0].signRegulationNum;
- echartsTDFun("chart-main"+liIndex,amountArrS.reverse(),nameArrs.reverse(), regulationAmount);//团队进展图表
- }
- scroller1.refresh();
- plus.nativeUI.closeWaiting();
- },200)
-
- },
- drawChart = function(dateData){//初始化折线图
- $(".div-switch").show();
- var recordCount = 10;//一页显示几条数据
- var allRecordData = dateData.amountArr.reverse();
- var dateArr = dateData.dateArr.reverse();
- var resultData = _.groupBy(allRecordData,function(item,i){return Math.floor(i/recordCount)});
- var dateArrData = _.groupBy(dateArr,function(item,i){return Math.floor(i/recordCount)});
- //以下为折线图处理
- var gnum = Math.ceil(allRecordData.length / recordCount);
- var HandStartX,HandStartY,HandEndX,HandEndY,CountX,CountY,startPos,isScrolling,number=allRecordData.length,times=allRecordData.length%recordCount;
- var canvasStr = '<div class="div-layer"></div>';
- for(var x in resultData){
- canvasStr ='<canvas id="wcMotion'+x+'" class="canvas-wc animated" style="display:block"></canvas>'+canvasStr;
- }
- $(".l-zxt-inner").html(canvasStr);
- var dateType = $(".div-btn-group .div-btn.active").attr("data-id");
- window.setTimeout(function() {
- for(var x in resultData){
- var startDay = new Date(getDateBefore(times-1));
- var resultDateArr = dateArrData[x].reverse();
- var yAxis = taskNum;//maxData(resultData[x]);//求数据的最大值
- $('#wcMotion'+x).wcChart({
- height: 200, // width and height must be set if change
- yAxis:yAxis,
- day: startDay,
- points: [],
- dateArr:resultDateArr,
- dateType:dateType,
- data: resultData[x].reverse(),
- fill: {gradient: [["#17B3EC",.1], ["#17B3EC",.5]], gradientAngle: Math.PI * -45/180},
- animation: null // 修复bug#3298 【医生端】总体分析排版优化。(vivo手机)
- });
- if(x==0){
- $('#wcMotion'+x).show();
- }
- times+=recordCount;
-
- //折线图画布添加左滑和右滑效果
- var wcMotion = document.getElementById('wcMotion'+x);
- wcMotion.addEventListener('touchstart', function(event) {
- HandStartX=event.touches[0].clientX;
- HandStartY=event.touches[0].clientY;
- //touches数组对象获得屏幕上所有的touch,取第一个touch
- var touch = event.targetTouches[0];
- //取第一个touch的坐标值
- startPos = {x:touch.pageX,y:touch.pageY,time:+new Date};
- //这个参数判断是垂直滚动还是水平滚动
- isScrolling = 0;
- }, false);
-
- wcMotion.addEventListener('touchend', function(event) {
- HandEndX=event.changedTouches[0].clientX;
- HandEndY=event.changedTouches[0].clientY;
- CountX=HandEndX-HandStartX;
- CountY=HandEndY-HandStartY;
- if((Math.abs(CountX)>Math.abs(CountY))&& Math.abs(CountX)>50){
- var targetMotion = $(event.target);
- if(CountX<0){
- if(targetMotion.next().length>0 && !targetMotion.next().hasClass("div-layer")){
- targetMotion.addClass("fadeOutLeft");
- targetMotion.next().removeClass("fadeOutRight").removeClass("fadeOutLeft").removeClass("fadeInLeft").addClass("fadeInRight").show();
- }
- console.log("左滑");
- }else{
- if(targetMotion.prev().length>0 && !targetMotion.prev().hasClass("div-layer")){
- targetMotion.addClass("fadeOutRight");
- targetMotion.prev().removeClass("fadeOutRight").removeClass("fadeOutLeft").removeClass("fadeInRight").addClass("fadeInLeft").show();
- }
- console.log("右滑");
- }
- }
-
- }, false);
-
- wcMotion.addEventListener('touchmove', function(event) {
- //当屏幕有多个touch或者页面被缩放过,就不执行move操作
- if(event.targetTouches.length > 1 || event.scale && event.scale !== 1) return;
- var touch = event.targetTouches[0];
- endPos = {x:touch.pageX - startPos.x,y:touch.pageY - startPos.y};
- //isScrolling为1时,表示纵向滑动,0为横向滑动
- isScrolling = Math.abs(endPos.x) < Math.abs(endPos.y) ? 1:0;
- if(isScrolling === 0){
- //阻止触摸事件的默认行为,即阻止滚屏
- event.preventDefault();
- }
- }, false);
-
- }
- }, 500);
- },
- formatDateData = function(data){//折线图数据格式转化
- var dateArr = [];
- var amountArr = [];
- for(var k in data){
- dateArr.push(data[k].range.substring(5));
- amountArr.push(data[k].amount);
- }
- return {dateArr: dateArr, amountArr: amountArr};
- },
- soreRank = function(arr){//排名方法
- var temp = [];
- var lis = [];
- for(var i=0;i<arr.length;i++)
- lis.push(arr[i])
- lis = _.uniq(lis);
- // lis.sort();
- // lis.reverse();
- for(var i=0;i<arr.length;i++)
- temp[i] = lis.indexOf(arr[i])+1;
-
- return temp;
- },
- nameArr = function(list){//名称数据集合
- var nameArr = [];
- for(var k in list){
- nameArr.push(list[k].name || "");
- }
- return nameArr;
- },
- amountArr = function(list,isTD){//签约量数据集合
- var amountArr = [];
- if(isTD){//如果是团队的话,单位为人
- for(var k in list){
- amountArr.push(list[k].amount);
- }
- }else{//其他单位为千人
- for(var k in list){
- amountArr.push(list[k].amount/1000);
- }
- }
-
- return amountArr;
- },
- rateArr = function(list){//签约率数据
- var rateArr = [];
- for(var k in list){
- var rate = list[k].rate?list[k].rate.substring(0,4):"0.00";
- rateArr.push(rate);
- }
- return rateArr;
- },
- personArr = function(list){//人口数数据
- var personArr = [];
- for(var k in list){
- personArr.push(list[k].num/1000 || 0);
- }
- return personArr;
- },
- taskArr = function(list){//任务量数据
- var taskArr = [];
- for(var k in list){
- taskArr.push(list[k].task/1000||0);
- }
- return taskArr;
- },
- arr_dive = function(personArr,amountArr){//柱状图叠层 (人口数-签约量=人口数)
- var resultArr = [];
- for(var k in personArr){
- resultArr.push(personArr[k]-amountArr[k]);
- }
- return resultArr;
- },
- arr_dive_ccl = function(amountArr,taskArr){//柱状图叠层 (签约量-目标量=超出量)
- var resultArr = [];
- var chaochuValue = 0;
- for(var k in taskArr){
- chaochuValue = amountArr[k]-taskArr[k]<0?0:amountArr[k]-taskArr[k];
- resultArr.push(chaochuValue);
- }
- return resultArr;
- },
- arr_dive_qyl = function(amountArr,taskArr){//柱状图叠层 (签约量)
- var resultArr = [];
- for(var k in taskArr){
- if(taskArr[k]-amountArr[k]>0){//目标量-签约量>0
- resultArr.push(amountArr[k]);
- }else{//目标量-签约量<0
- resultArr.push(0);
- }
- }
- return resultArr;
- },
- arr_dive_mbl = function(amountArr,taskArr){//柱状图叠层 (目标量)
- var resultArr = [];
- for(var k in taskArr){
- if(taskArr[k]-amountArr[k]>0){//目标量-签约量>0
- resultArr.push(taskArr[k]-amountArr[k]);
- }else{//目标量-签约量<0
- resultArr.push(taskArr[k]);
- }
- }
- return resultArr;
- },
- maxData = function(data){
- var maxData = Math.max.apply(Math,data);
- var yAxis = maxData<10?10:maxData;
- return yAxis;
- },
- getStartDate = function(){//獲取當前日期往前推三個月(當前日期減去三個月),返回日期格式:比如:2014-08-11(當前月為:2014-11-11)
- /* 按年度来计算的时候,开始时间是该年度7月1号还是到下一个年的6月30号结束
- var newDate = new Date();
- var startY = newDate.getFullYear();
- var startM = newDate.getMonth() - 3;
- var startD = newDate.getDate();
-
- // 日期賦值
- var mydate = new Date(startY, startM, startD);
- var strYear = mydate.getFullYear();
- //顯示的月份要加一,因為月份是從0開始的
- var strMonth = mydate.getMonth() + 1;
- var strDate = mydate.getDate();
- if (strMonth.toString().length == 1)
- strMonth = "0" + strMonth;
- if (strDate.toString().length == 1)
- strDate = "0" + strDate;
- var strStartDate = strYear + "-" + strMonth + "-" + strDate;
- return strStartDate;
- */
- return chooseYear+'-07-01';
- },
- //获取结束时间
- getEndDate = function(){
- var nowdate = new Date();
- var year = nowdate.getFullYear();
- var month = nowdate.getMonth() + 1;
- var day = nowdate.getDate();
- var endDate = new Date((parseInt(chooseYear)+1) + '-06-30');
- var now = new Date();
- // var endDate = new Date((chooseYear+1) + '-06-30'),
- // now = new Date();
- if(now <= endDate){
- return now.getFullYear()+"-"+((now.getMonth()+1)>=10?(now.getMonth()+1):("0"+(now.getMonth()+1)))+"-"+(now.getDate()>=10?now.getDate():("0"+now.getDate()));
- }else{
- return (parseInt(chooseYear)+1) + '-06-30';
- }
- },
- getDateBefore = function(days){//获取多少天前的日期
- var now = new Date();
- var date = new Date(now.getTime() - days * 24 * 3600 * 1000);
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var day = date.getDate();
- var hour = date.getHours();
- var minute = date.getMinutes();
- var second = date.getSeconds();
- return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
- };
- /*****************************************************************************/
- /***** echarts图标处理 **********/
- /*****************************************************************************/
- var echartsFun = function(elementId,amountArrS,amountArrResult,taskArrS,rateArrS,nameArr,mblValue){//区进展、社区进展的图表
- var myChart = echarts.init(document.getElementById(elementId));
- var height = amountArrS.length*customHeight;
- var option = {
- grid: {x:60,y: 30,height:height,borderWidth:0},
- yAxis : [
- {
- type : 'category',
- data : nameArr,
- axisLine: {show:false},
- axisTick: {show:false},
- splitArea: {show:false},
- splitLine: {show:false},
- axisLabel: {show:false}
- }
- ],
- xAxis : [
- {
- type : 'value',
- axisLine: {show:true,lineStyle:{color:'#cccccc'}},
- axisTick: {show:true,lineStyle:{color:'#cccccc'}},
- axisLabel:{formatter:'{value}%',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false}
- },
- {
- type : 'value',
- axisLine: {show:true,lineStyle:{color:'#cccccc'}},
- axisTick: {show:true,lineStyle:{color:'#cccccc'}},
- axisLabel:{formatter:'{value}',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false}
- }
- ],
- series : [
- {
- name:'任务量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '目标量',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#17b3ec', label:{show:false, position: 'insideRight'}}},
- data:taskArrS,
- },
- {
- name:'签约量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#a0dc28', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:amountArrS
- },
- {
- name:'人口数',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#ffc149', label:{show:false, position: 'insideRight'}}},
- data:amountArrResult
- },
- {
- name:'签约率',
- type:'line',
- itemStyle: {normal: {color:'red', label:{show:true,formatter:function(p){return p.value +"%";},textStyle:{color:'red'},position:'bottom'}}},
- data:rateArrS,
- markLine:{
- itemStyle:{
- normal:{lineStyle:{type:'solid',color:'#925cfe'},label:{show:true,formatter:function(p){return p.value +"%";},textStyle:{color:'#925cfe'},position:'bottom'}}
- },
- large:true,
- effect:{
- show: false,
- loop: true,
- period: 0,
- scaleSize : 2,
- color : null,
- shadowColor : null,
- shadowBlur : null
- },
- data:[
- [
- {name: '标线1起点', value: mblValue,xAxis:-1, xAxis: mblValue}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: mblValue}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
-
- }
-
- ]
- };
-
- myChart.setOption(option);
- },
- echartsCCFun = function(elementId,qylAmountArr,mblAmountArr,cclAmountArr,rateArrS,nameArr,mblValue){//区进展、社区进展的图表
- // var mblValue = $("#Dtitle").attr("data-id")=="1"?"15":"30";
- var myChart = echarts.init(document.getElementById(elementId));
- var height = qylAmountArr.length*customHeight;
- var option = {
- grid: {x:60,y: 30,height:height,borderWidth:0},
- yAxis : [
- {
- type : 'category',
- data : nameArr,
- axisLine: {show:false},
- axisTick: {show:false},
- splitArea: {show:false},
- splitLine: {show:false},
- axisLabel: {show:false}
- }
- ],
- xAxis : [
- {
- type : 'value',
- axisLine: {show:true,lineStyle:{color:'#cccccc'}},
- axisTick: {show:true,lineStyle:{color:'#cccccc'}},
- axisLabel:{formatter:'{value}%',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false}
- },
- {
- type : 'value',
- axisLine: {show:true,lineStyle:{color:'#cccccc'}},
- axisTick: {show:true,lineStyle:{color:'#cccccc'}},
- axisLabel:{formatter:'{value}',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false}
- }
- ],
- series : [
- {
- name:'签约量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#A0DC28', label:{show:false, position: 'insideRight'}}},
- data:qylAmountArr,
- },
- {
- name:'目标量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#ffc149', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:mblAmountArr
- },
- {
- name:'超出量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#A0DC28', label:{show:false, position: 'insideRight'}}},
- data:cclAmountArr
- },
- {
- name:'签约率',
- type:'line',
- itemStyle: {normal: {color:'red', label:{show:true,formatter:function(p){return p.value +"%";},textStyle:{color:'red'},position:'bottom'}}},
- data:rateArrS,
- markLine:{
- itemStyle:{
- normal:{lineStyle:{type:'solid',color:'#925cfe'},label:{show:true,formatter:function(p){return p.value +"%";},textStyle:{color:'#925cfe'},position:'bottom'}}
- },
- large:true,
- effect:{
- show: false,
- loop: true,
- period: 0,
- scaleSize : 2,
- color : null,
- shadowColor : null,
- shadowBlur : null
- },
- data:[
- [
- {name: '标线1起点', value: mblValue,xAxis:-1, xAxis: mblValue}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: mblValue}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
-
- }
-
- ]
- };
-
- myChart.setOption(option);
- },
- echartsTDFun = function(elementId,amountArrS,nameArr, regulationAmount){//团队进展图表
- var myChart = echarts.init(document.getElementById(elementId));
- var height = amountArrS.length*customHeight;
- var xAxis = null;
- if(current_team_index==0){
- xAxis = [
- {
- type : 'value',
- axisLine: {show:false},
- axisTick: {show:false},
- axisLabel: {show:false},
- splitArea: {show:false},
- splitLine: {show:false}
- },
- {
- type : 'value',
- axisLine: {show:true,lineStyle:{color:'#cccccc'}},
- axisTick: {show:true,lineStyle:{color:'#cccccc'}},
- axisLabel:{show:true,formatter:'{value}',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false},
- }
- ];
- }else{
- xAxis = [
- {
- type : 'value',
- max:team_data_list[0][0].amount,
- axisLine: {show:false},
- axisTick: {show:false},
- axisLabel: {show:false},
- splitArea: {show:false},
- splitLine: {show:false}
- },
- {
- type : 'value',
- max:team_data_list[0][0].amount,
- axisLine: {show:false,lineStyle:{color:'#cccccc'}},
- axisTick: {show:false,lineStyle:{color:'#cccccc'}},
- axisLabel:{show:false,formatter:'{value}',textStyle:{color:'#cccccc'}},
- splitArea: {show:false},
- splitLine: {show:false},
- }
- ];
- }
- var gridY = current_team_index==0?30:0;
-
- //调控量的配置信息
- var markLine = {
- itemStyle:{
- normal:{
- lineStyle:{
- type:'solid',
- color:'#925cfe'
- },
- label:{
- show:true,
- formatter:function(p){
- return p.value +"人";
- },
- textStyle:{
- color:'#925cfe'
- },
- position:'bottom'
- }
- }
- },
- large:true,
- effect:{
- show: false,
- loop: true,
- period: 0,
- scaleSize : 2,
- color : null,
- shadowColor : null,
- shadowBlur : null
- },
- data:[
- [
- {name: '标线1起点', value: regulationAmount,xAxis:-1, xAxis: regulationAmount}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: regulationAmount}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
- if(chooseYear == 2016){
- markLine.data = [];
- $(".tk-span").hide();
- }
- var option = {
- calculable : true,
- grid: {x:60,y: gridY,height:height,borderWidth:0},
- yAxis : [
- {
- type : 'category',
- // boundaryGap : false,
- data : nameArr,
- axisLine: {show:false},
- axisTick: {show:false},
- splitArea: {show:false},
- splitLine: {show:false},
- axisLabel: {show:false}
- }
- ],
- xAxis : xAxis,
- series : [
- {
- name:'签约量',
- type:'bar',
- barWidth : 20,//柱图宽度
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#17b8ec', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:amountArrS,
- markLine: markLine
- }
- ]
- };
- myChart.setOption(option);
- };
- /*****************************************************************************/
- /***** 返回事件处理 **********/
- /*****************************************************************************/
- mui.back = function(){
- console.log("back");
- var arr = JSON.parse(plus.storage.getItem("levelParamsArr"));
- if(arr==null || arr.length==1){//返回到管理员首页,并刷新数据
- plus.storage.removeItem("userLevel");
- plus.storage.removeItem("userArea");
- var mainPage =plus.webview.getWebviewById("admin.html");
- mui.fire(mainPage, "refreshData");
- plus.storage.removeItem("levelParamsArr");
- //关闭筛选页面
- var shaixuan = plus.webview.getWebviewById("shaixuan2.html");
- if(shaixuan){
- shaixuan.close();
- }
- setTimeout(function(){
- self.close();
- },500)
- }else{ //加载当前级别数据
- current_team_index = 0;
- arr.pop();
- curLeveArr = arr[arr.length-1];
- plus.storage.setItem("levelParamsArr",arr.length==0?plus.storage.removeItem("levelParamsArr"):JSON.stringify(arr));
- loadAllData(curLeveArr);
- }
- }
- document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
|