var model=avalon.define({$id:"IndexV5",userName:ComFunJS.getnowuser(),CommonData:[],yytype:"WORK",UserData:{},UserInfo:{},CompanyData:{},isshowload:!0,isiframe:"N",XXCount:0,QYGGData:[],YYData:[],LMData:[],QYHDData:[],wigetdata:[],initobj:"",ishasLeft:!0,FunData:[],isnull:!1,SelModelMenu:function(n){var t=(new Date).getTime(),i=$("body").data("ctime");if(i!="undefined"&&t-i<1e3&&n)return console.debug("操作过于频繁,稍后再试"),!1;$("body").data("ctime",t);model.FunData.clear();n?(model.SelModel=n,model.FunData.pushArray(n.FunData.$model),model.ishasLeft=!1):(model.SelModel=null,localStorage.getItem("WIGETDATAV5")?model.FunData.pushArray(JSON.parse(localStorage.getItem("WIGETDATAV5"))):(model.FunData.pushArray([{PageCode:"/BiManage/TempWiget/LCSP",ExtData:"",code:"LCSP",PageName:"流程审批",issel:!0,isshow:!0,order:0},{PageCode:"/BiManage/AppPage/RWGL/RWGLLIST",ExtData:"",code:"RWGL",PageName:"任务管理",issel:!0,isshow:!0,order:0},{PageCode:"/BiManage/TempWiget/KJFS",ExtData:"",code:"KJFS",PageName:"快捷网址",issel:!0,isshow:!0,order:0},{PageCode:"/BiManage/TempWiget/NOTE",ExtData:"",PageName:"记事本",code:"NOTE",issel:!0,isshow:!0,order:0}]),localStorage.setItem("WIGETDATAV5",JSON.stringify(model.FunData.$model))),model.ishasLeft=!0);model.selmenulev2(model.FunData[0]);$("body,html").animate({scrollTop:0},"500")},SelModelXX:function(){model.FunData.clear();model.SelModel=null;model.FunData.pushArray([{PageCode:"/BiManage/AppPage/XXZX/XXZXLIST",PageName:"消息管理",issel:!0,isshow:!0,order:0}]);model.ishasLeft=!1;model.selmenulev2(model.FunData[0])},SelUserInfo:function(){model.FunData.clear();model.SelModel=null;model.FunData.pushArray([{PageCode:"/BiManage/AppPage/XTGL/UserCenter",PageName:"个人中心",issel:!0,isshow:!0,order:0}]);model.ishasLeft=!1;model.selmenulev2(model.FunData[0])},SelModelBZ:function(){model.FunData.clear();model.SelModel=null;model.FunData.pushArray([{PageCode:"/BiManage/AppPage/BZZX/BZZXLIST",PageName:"帮助中心",issel:!0,isshow:!0,order:0}]);model.ishasLeft=!1;model.selmenulev2(model.FunData[0])},SelModelWTFK:function(){model.FunData.clear();model.SelModel=null;model.FunData.pushArray([{PageCode:"/BiManage/AppPage/WTFK/WTFKLIST",PageName:"问题反馈",issel:!0,isshow:!0,order:0}]);model.ishasLeft=!1;model.selmenulev2(model.FunData[0])},selmenulev2:function(n,t){var u,i,r;if(model.isiframe=n.isiframe,model.isiframe=="Y")u=n.PageCode.indexOf("html")>-1?n.PageCode:n.PageCode+".html",$("#main").attr("src",u).css("min-height",window.innerHeight-150+"px").parent().css("height",$("#main").height());else{if(i=(new Date).getTime(),r=$("body").data("me2time"),r!="undefined"&&i-r<1e3&&t)return console.debug("操作过于频繁,稍后再试"),!1;$("body").data("me2time",i);model.isnull=!1;model.initobj=null;model.PageCode="/BiManage/Base/Loading";gomenu=function(){model.PageCode=n.PageCode;model.page.pagecount=localStorage.getItem(model.PageCode+"pagecount")?localStorage.getItem(model.PageCode+"pagecount"):10;model.initobj=n.ExtData;model.page.pageindex=1;model.page.total=0;model.ShowColumns=[];model.TypeData=[];model.ListData=[];model.search.seartype="1";model.search.searchcontent="";$(".datetimepicker").remove()};setTimeout("gomenu()",500)}},ChangePage:function(n){model.selmenulev2(n)},refpage:function(n){if(model.rdm=ComFunJS.getnowdate("yyyy-mm-dd hh:mm:ss"),model.isiframe=="Y")$("#main").attr("src",$("#main").attr("src"));else if(n){for(var t=0;t-1){model.selmenulev2(model.FunData[t]);return}}else model.refpage(model.PageCode)},initwork:function(){localStorage.removeItem("WIGETDATAV5");location.reload()},setwork:function(){if(model.SelModel){var n=JSON.parse(localStorage.getItem("WIGETDATAV5"));n.forEach(function(n){n.PageCode==model.PageCode});model.FunData.forEach(function(t){if(model.PageCode==t.PageCode){var i={PageCode:t.PageCode,ExtData:t.ExtData,code:model.SelModel.ModelCode,PageName:t.PageName,issel:!0,isshow:!0,order:n.length*1+1};n.push(i)}});localStorage.setItem("WIGETDATAV5",JSON.stringify(n));top.ComFunJS.winsuccess("操作成功")}},PageCode:"/BiManage/Base/Loading",rdm:ComFunJS.getnowdate("yyyy-mm-dd hh:mm"),Temprender:function(){typeof tempindex!="undefined"&&model.PageCode!="/BiManage/Base/Loading"&&(tempindex.InitWigetData(model.initobj),model.ShowColumns.size()>0&&setTimeout("model.GetExtColumns("+model.rdm+")",1500))},exit:function(){ComFunJS.winconfirm("确认要退出吗?",function(){ComFunJS.delCookie("szhlcode");location.href="/BiManage/login.html"})},refiframe:function(){location.reload()},selyyType:function(n,t){$(".yytype").removeClass("active");$(t).children("a").addClass("active");model.yytype=n.TYPE;$(".nav-list ul li:visible").eq(0).click()},menutype:"WORK",GetXXZXList:function(){$.getJSON("/api/Auth/ExeAction?Action=GETXXZXIST",{},function(n){n.ErrorMsg==""&&(model.CommonData=n.Result,model.XXCount=n.Result1)})},GetUserData:function(){$.getJSON("/api/Auth/ExeAction?Action=GETUSERBYUSERNAME",{P1:ComFunJS.getnowuser()},function(n){n.ErrorMsg==""&&n.Result&&(model.UserInfo=n.Result,model.UserData=n.Result.User,model.CompanyData=n.Result.QYinfo,$(document).attr("title",model.CompanyData.QYName+"-协同办公平台"),model.GetCompanyAuth(),ComFunJS.setCookie("fileapi",n.Result.QYinfo.FileServerUrl))});$.getJSON("/api/Bll/ExeAction?Action=XXFB_GETXXFBLIST",{type:"1"},function(n){n.ErrorMsg==""&&(model.QYGGData=n.Result)})},AuthList:[],KJFSData:[],GetCompanyAuth:function(){$.getJSON("/API/VIEWAPI.ashx?Action=INIT_GETINDEXMENU",{P1:"PCINDEX"},function(n){n.ErrorMsg==""&&(n.Result&&n.Result.forEach(function(n){n.isshow=!0}),model.AuthList=n.Result,n.Result1&&(n.Result1.forEach(function(n){n.issel=n.issel=="True";n.isshow=!0}),model.KJFSData=n.Result1))})},SETKJFS:function(n,t){t&&t.stopPropagation();$.post("/API/VIEWAPI.ashx?Action=INIT_SETAPPINDEX",{P1:n.ModelCode,Status:n.issel?"N":"Y",type:"PCKJFS",name:n.ModelName},function(t){t.ErrorMsg==""&&(n.issel=n.issel?!1:!0,ComFunJS.winsuccess("设置成功"),model.refiframe())})},AddView:function(n,t,i,r,u){u&&u.stopPropagation();n=="QYTX"||n=="DXGL"?ComFunJS.winviewform("/View/Base/APP_ADD_WF.html?FormCode="+n,t,"1000"):(i||(i=""),r=="CRM"&&(n=r+"_"+n),ComFunJS.winviewform("/BiManage/AppPage/APP_ADD_WF.html?FormCode="+n+"&ID="+i,t,"1000"))},AddViewNOWF:function(n,t){ComFunJS.winviewform("/BiManage/AppPage/APP_ADD.html?PathCode="+n,t,"1000")},ViewForm:function(n,t,i,r){r=r?r:window.event;var u=r.srcElement?r.srcElement:r.target;$(u).hasClass("icon-check")||$(u).attr("type")=="checkbox"||ComFunJS.winviewform("/BiManage/AppPage/APPVIEW.html?FormCode="+n+"&ID="+t+"&PIID="+i+"&r="+Math.random(),"查看")},ViewFormNew:function(n,t,i,r){r=r?r:window.event;var u=r.srcElement?r.srcElement:r.target;$(u).hasClass("lk")&&ComFunJS.winviewform("/BiManage/AppPage/APPVIEW.html?FormCode="+n+"&ID="+t+"&PIID="+i+"&r="+Math.random(),"查看")},EditForm:function(n,t,i,r){r&&r.stopPropagation();ComFunJS.winviewform("/BiManage/AppPage/APP_ADD_WF.html?FormCode="+n+"&ID="+t+"&PIID="+i+"&r="+Math.random(),"修改","1000")},UseYYList:[],GetYYList:function(){$.getJSON("/API/VIEWAPI.ashx?Action=INIT_GETINDEXMENUNEW",{P1:"PCINDEX"},function(n){var i,t;if(n.ErrorMsg==""){for(n.Result.forEach(function(n){n.issel=n.issel=="True"}),n.Result&&n.Result.forEach(function(n){n.FunData.forEach(function(n){n.isshow=!0})}),i=[],t=0;t"+n+"<\/span>");break;case"rwstate":n=="0"?n="待办任务":n=="1"?n="已办任务":n=="2"&&(n="过期任务");break;case"dateformat":n=ComFunJS.getnowdate("yyyy-mm-dd",n);break;case"timeformat":n=ComFunJS.getnowdate("yyyy-mm-dd hh:mm",n);break;case"username":n=ComFunJS.convertuser(n);break;case"qrcode":n="";break;case"bqh":return ComFunJS.bqhContent(n);case"text":n=ComFunJS.convstr(n);break;case"txfs":switch(n){case"0":n="短信和微信";break;case"1":n="短信";break;case"2":n="微信"}break;case"xxshzt":switch(n){case"0":n="未审核";break;case"1":n="已审核";break;case"2":n="正常";break;case"-1":n="