12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208 |
- 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 lowCode; //记录选中其他维度的参数
- 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 lineIndexArr = {1: 42, 2: 43, 3: 44, 4: 29}; //折线图中对应的index参数值
- //定义年份
- 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();
- 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("(所有居民)");
- //搜集页面请求的参数
- var paramsArr = [],requestArr = [];
-
- var index = 29; //签入: 34, 签出: 35
- if(level==4){//市管
- paramsArr.push({tags:["各区","社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{ year: 2017,code:area,level:level, index: 29}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:29}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:44,area:area}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:43,area:area,lowLevel:2}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:42,area:area,lowLevel:1}});
- }else if(level==3){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 44}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:44}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:43,area:area}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:42,area:area,lowLevel:1}});
- }else if(level==2){//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 43}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:43}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:42,area:area}});
- }
- requestArr.push(paramsArr);
- plus.storage.setItem("levelParamsArr",JSON.stringify(requestArr));
- 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 = lineIndexArr[level];
-
- //1-4 :加载签约率、完成率
- // arr[1].params.index = index;
- sendGet(arr[1].reqUrl, arr[1].params, null, countHandle, true);
-
- //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;
- sendPost(arr[2].reqUrl, arr[2].params, null, dateLineHandle);
-
- //1-6:加载【第一个】tab标签数据
- // arr[3].params.index = index - 1;
- 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;
- }
- }
- );
- },
- /**
- * 初始化筛选事件
- */
- shaixuanInit = function(main){
- var shaixuan = plus.webview.getWebviewById('xq-shaixuan.html');
- if(!shaixuan){
- shaixuan = mui.createWindow({
- id: 'xq-shaixuan.html',
- url: 'xq-shaixuan.html',
- styles: {
- top: 0,
- bottom: 0,
- left: '20%',
- width: '80%',
- scorllIndicator: "none"
- },
- show:{
- aniShow: "slide-in-right",
- duration: "400"
- },
- extras:{
- }
- });
- }
- 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");
- var tabName = $(".c-lab-mor li.hit a").html();
- //1-6:加载tab标签数据
- if($(this).attr("data-click")=="false"){//tab数据未加载
- plus.nativeUI.showWaiting();
- var index ;
- if(tabName == "各区"){
- // index = 29;
- // curLeveArr[3].params.index = index;
- sendPost(curLeveArr[3].reqUrl, curLeveArr[3].params, null, listHandle);
- }else if(tabName == "社区"){//社区数据
- // index = 43;
- // curLeveArr[4].params.index = index;
- if(curLeveArr.length == 5){
- sendPost(curLeveArr[3].reqUrl, curLeveArr[3].params, null, listHandle);
- }else{
- sendPost(curLeveArr[4].reqUrl, curLeveArr[4].params, null, listHandle);
- }
-
- }else if(tabName == "团队"){//团队数据
- // index = 42;
- // curLeveArr[5].params.index = index;
- if(curLeveArr.length == 6){
- sendPost(curLeveArr[5].reqUrl, curLeveArr[5].params, null, listHandle);
- }else if(curLeveArr.length == 5){
- sendPost(curLeveArr[4].reqUrl, curLeveArr[4].params, null, listHandle);
- }else{
- sendPost(curLeveArr[3].reqUrl, curLeveArr[3].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;
- // curLeveArr[2].params.index = lineIndexArr[level];
- 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 = 29;
- if(!lowCode || lowCode=='0'){
- if(level==3 && $(".c-lab-mor li.hit a").html()=="各区"){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 44}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index: 44}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:43,area:area}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:42,area:area,lowLevel:1}});
- }else{//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:2},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:2, index: 43}},
- {reqUrl:"/statistics/interval_total",params:{level: 2, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index:43}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:2,index:42,area:area}});
- }
- }else{
- if(level==3 && $(".c-lab-mor li.hit a").html()=="各区"){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 54, lowCode: lowCode}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index: 54, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:53,area:area, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:level,index:52,area:area,lowLevel:1, lowCode: lowCode}});
- }else{//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:2},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:2, index: 53, lowCode: lowCode}},
- {reqUrl:"/statistics/interval_total",params:{level: 2, area: area, startDate: startDate, endDate: endDate, interval:$('.div-btn-group .div-btn.active').attr('data-id'),index:53, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,date:endDate,level:2,index:52,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;
- });
-
- //转签率点击了进入续签分析页面
- $("#zhuanqianWrap").on("tap", function(){
- if(!lowCode || lowCode=='0'){
- mui.openWindow({
- url: "renew-analysis.html",
- id: "renew-analysis.html",
- extras:{
- level:curLeveArr[0].level,
- code:area,
- title: title
- }
- });
- }
- })
- //说明信息相关事件
- $("#closeBtn").on("tap", function(){
- $(".information").hide();
- scroller1.refresh();
- });
-
- $(".info-icon").on("tap", function(){
- $(".information").show();
- scroller1.refresh();
- });
-
- //弹出遮罩
- $(".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){
- lowCode = e.detail.lowCode;
- var name = e.detail.name;
- $(".choose-label").text("("+name+")");
-
- level = roleLevel;
- area = userRole.code;
- title = userRole.name;
-
- var paramsArr = [];
- var index = 29;
- if(lowCode == '0'){
- if(level==4){//市管
- paramsArr.push({tags:["各区","社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{ year: 2017,code:area,level:level, index: 29}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:29}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:44,area:area}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:43,area:area,lowLevel:2}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:42,area:area,lowLevel:1}});
- }else if(level==3){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 44}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:44}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:43,area:area}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:42,area:area,lowLevel:1}});
- }else if(level==2){//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 43}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:43}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:42,area:area}});
- }
- }else{
- var index = 51; //签入: 34, 签出: 35
- if(level==4){//市管
- paramsArr.push({tags:["各区","社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{ year: 2017,code:area,level:level, index: 51, lowCode: lowCode}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:51, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:54,area:area, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:53,area:area,lowLevel:2, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:52,area:area,lowLevel:1, lowCode: lowCode}});
- }else if(level==3){//区管
- paramsArr.push({tags:["社区","团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 54, lowCode: lowCode}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:54, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:53,area:area, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:52,area:area,lowLevel:1, lowCode: lowCode}});
- }else if(level==2){//社区管
- paramsArr.push({tags:["团队"],curTitle:title,level:level},
- {reqUrl:"/statistics/getRenewPercentAndChangePercent",params:{year: 2017,code:area,level:level, index: 53, lowCode: lowCode}},
- {reqUrl:"/statistics/interval_total",params:{level: level, area: area, startDate: startDate, endDate: endDate, interval:"1",index:53, lowCode: lowCode}},
- {reqUrl:"/statistics/lowlevel_all_sign_renew",params:{sort:1,year:2017,level:level,index:52,area:area, lowCode: lowCode}});
- }
- }
- var existArr = JSON.parse(plus.storage.getItem("levelParamsArr"));
- //清空数据,然后再存储新的路径
- existArr.splice(0, existArr.length);
-
- existArr.push(paramsArr);
- plus.storage.setItem("levelParamsArr",JSON.stringify(existArr));
- curLeveArr = paramsArr;
- current_team_index = 0;
- loadAllData(paramsArr);
- });
- };
- /*****************************************************************************/
- /***** 数据返回处理函数 **********/
- /*****************************************************************************/
- var countHandle = function(res){
- if(res.status == 200) {
- res = res.data;
- //折线图目标量是去年的签约量
- taskNum = parseInt(res.yesterYearSign);
- $('#xuqianlv').waterbubble({
- txt: res.renewRange,
- data: parseFloat(res.renewRange)/100,
- waterColor: '#12B7F5',
- lineWidth:0,
- radius: 75,
- textColor: 'rgba(0, 0, 0, 0.8)',
- font: 'bold 25px arial'
- });
-
- $(".p-xuqianlv").html("<span class='c-17b3ec'>"+res.thisYearRenew+"</span>/"+res.yesterYearSign);
-
- $('#zhuanqianlv').waterbubble({
- txt: res.switchRange,
- data: parseFloat(res.switchRange)/100,
- waterColor: '#4ECD70',
- lineWidth:0,
- radius: 75,
- textColor: 'rgba(0, 0, 0, 0.8)',
- font: 'bold 25px arial'
- });
- $(".p-zhuanqianlv").html("<span class='c-4ECD70'>"+res.thisYearSwithch+"</span>/"+res.thisYearRenew);
- } else {
- mui.toast(res.msg);
- }
- },
- dateLineHandle = function(res){
- if(res.status==200){
- for(var p in res.data){
- taskNum = taskNum;
- dateData[p] = formatDateData(res.data[p].data);
- if(dateData[p].amountArr && dateData[p].amountArr.length>0){
- $('#l-jmfx').show();
- $(".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;
- var isTD = false;
- for(var k in res){
- var list = res[k];
- var topArr = soreRank(renewArr(list));
- var liIndex = $(".c-lab-mor li.hit").index();
- if($(".c-lab-mor li.hit a").html()=="团队"){//社区看团队数据
- isTD = true;
- 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 mt20 '+qylClass+'">'+(parseFloat(list[j].signNum)/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();
- var rateArrS = rateArr(list).reverse();//签约率
- var renewArrS = renewArr(list).reverse();//续签量
-
- var qylAmountArr = arr_dive_qyl(amountArrS,renewArrS);//签约量
- echartsCCFun("chart-main"+liIndex,qylAmountArr,renewArrS,rateArrS,nameArrs);//区进展、社区进展的图表
- }
-
- 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-a0dc28";
- 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).reverse();//签约量
- 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].signNum>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 mt20 '+qylClass+'">'+list[j].signNum+'</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").show();
- if(!list){
- $(".div-right-danwei").hide();
- $("#chart-main"+liIndex).hide();
- }else{
- $(".div-right-danwei").show();
- $("#chart-main"+liIndex).show();
- var heightM = current_team_index==0?list.length*customHeight+30:list.length*customHeight;
- $("#chart-main"+liIndex).height(heightM);
- var rateArrS = rateArr(list).reverse();//签约率
- var renewArrS = renewArr(list, true).reverse();//续签量
-
- var qylAmountArr = arr_dive_qyl(amountArrS,renewArrS);//签约量
- echartsTDFun("chart-main"+liIndex,qylAmountArr,renewArrS,rateArrS,nameArrs);//区进展、社区进展的图表
- }
- 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].signNum);
- }
- }else{//其他单位为千人
- for(var k in list){
- amountArr.push(list[k].signNum/1000);
- }
- }
-
- return amountArr;
- },
- rateArr = function(list){//签约率数据
- var rateArr = [];
- for(var k in list){
- var rate = parseFloat(list[k].rate)?parseFloat(list[k].rate):"0.00";
- rateArr.push(rate);
- }
- return rateArr;
- },
- renewArr = function(list,isTD){//续签量数据
- var renewArr = [];
- for(var k in list){
- if(isTD){//如果是团队的话,单位为人
- renewArr.push(list[k].renewNum);
- }else{//其他单位为千人
- renewArr.push(list[k].renewNum/1000);
- }
- }
- return renewArr;
- },
- arr_dive = function(personArr,amountArr){//柱状图叠层 (人口数-签约量=人口数)
- var resultArr = [];
- for(var k in personArr){
- resultArr.push(personArr[k]-amountArr[k]);
- }
- return resultArr;
- },
- arr_dive_qyl = function(amountArr,renewArr){//柱状图叠层 (签约量)
- var resultArr = [];
- for(var k in renewArr){
- if(amountArr[k]-renewArr[k]>0){//去年签约量-续签量 (签约量>=续签量)
- resultArr.push(amountArr[k]-renewArr[k]);
- }else{
- resultArr.push(0);
- }
- }
- return resultArr;
- },
- maxData = function(data){
- var maxData = Math.max.apply(Math,data);
- var yAxis = maxData<10?10:maxData;
- return yAxis;
- },
- getStartDate = function(){ //年度开始的时间为7月1号
- return chooseYear+'-07-01';
- },
- //获取结束时间
- getEndDate = function(){ //如果是前一个年度的时间,那么结束的时间为6月30号,如果是当前年度的,则结束时间为现在
- var endDate = new Date((chooseYear+1) + '-06-30'),
- now = new Date();
- if(now < endDate){
- return now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate();
- }else{
- return (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){//区进展、社区进展的图表
- 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:'#a0dc28', label:{show:false, position: 'insideRight'}}},
- data:taskArrS,
- },
- {
- name:'续签量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#ffc149', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:amountArrS
- },
- {
- 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: '15',xAxis:-1, xAxis: '15'}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: '15'}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
-
- }
-
- ]
- };
-
- myChart.setOption(option);
- },
- echartsCCFun = function(elementId,qylAmountArr,renewArrS,rateArrS,nameArr){//区进展、社区进展的图表
- var myChart = echarts.init(document.getElementById(elementId));
- var height = nameArr.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:'#ffc149', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:renewArrS
- },
- {
- name:'去年签约量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#A0DC28', label:{show:false, position: 'insideRight'}}},
- data:qylAmountArr,
- },
-
- {
- 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: qylAmountArr,xAxis:-1, xAxis: qylAmountArr}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: qylAmountArr}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
- }
-
- ]
- };
-
- myChart.setOption(option);
- },
- echartsTDFun = function(elementId,qylAmountArr,renewArrS,rateArrS,nameArr){//团队进展图表
- var myChart = echarts.init(document.getElementById(elementId));
- var height = nameArr.length*customHeight;
- var gridY = current_team_index==0?30:0;
- var option = {
- grid: {x:60,y: gridY,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:'#ffc149', label:{show:false, position: 'insideRight',textStyle:{color:'#fff'}}}},
- data:renewArrS
- },
- {
- name:'去年签约量',
- type:'bar',
- barWidth : 20,//柱图宽度
- stack: '人数',
- xAxisIndex:1,
- itemStyle: {normal: {barBorderRadius:0,color:'#A0DC28', label:{show:false, position: 'insideRight'}}},
- data:qylAmountArr,
- },
-
- {
- 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: qylAmountArr,xAxis:-1, xAxis: qylAmountArr}, // 当xAxis为类目轴时,数值1会被理解为类目轴的index,通过xAxis:-1|MAXNUMBER可以让线到达grid边缘
- {name: '标线1终点', yAxis: nameArr[nameArr.length-1], xAxis: qylAmountArr}, // 当xAxis为类目轴时,字符串'周三'会被理解为与类目轴的文本进行匹配
- ],
- ]
- }
- }
-
- ]
- };
- myChart.setOption(option);
- };
- /*****************************************************************************/
- /***** 返回事件处理 **********/
- /*****************************************************************************/
- mui.back = function(){
- 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("xq-shaixuan.html");
- if(shaixuan){
- shaixuan.close();
- }
- setTimeout(function(){
- self.close();
- },500)
- }else{ //加载当前级别数据
- current_team_index = 0;
- arr.pop();
- curLeveArr = arr[arr.length-1];
- area = curLeveArr[1].params.code;
- level = curLeveArr[1].params.level;
- plus.storage.setItem("levelParamsArr",arr.length==0?plus.storage.removeItem("levelParamsArr"):JSON.stringify(arr));
- loadAllData(curLeveArr);
- }
- }
- document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
|