Files
iMES_Net/iMES.WebApi/wwwroot/BiManage/JS/indexv1.min.js
2026-02-06 18:34:35 +08:00

3 lines
13 KiB
JavaScript

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<model.FunData.length;t++)if(model.FunData[t].PageCode.indexOf(n)>-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.Result.length;t++)$.inArray(n.Result[t].ModelType,i)==-1&&(i.push(n.Result[t].ModelType),model.LMData.push({TYPE:n.Result[t].PModelCode,NAME:n.Result[t].ModelType,ISSEL:"N"}));model.UseYYList=n.Result;n.Result1=="Y"?$(".nav-list ul li:visible").eq(1).click():model.SelModelMenu("");n.Result2=="Y"&&model.InitData()}})},SaveYY:function(n){var t="";t+=n.ISSY==1?n.ModelCode+":N":n.ModelCode+":Y";n.ISSY=n.ISSY==1?0:1;t&&$.post("/API/VIEWAPI.ashx?Action=INIT_SETAPPINDEX",{P1:t,type:"PCINDEX"},function(n){$.trim(n.ErrorMsg)==""&&top.ComFunJS.winsuccess("操作成功")})},UploadHeadImage:function(){ComFunJS.winviewform("/BiManage/Base/UploadTX.html","头像上传","700","570")},ModifyPwd:function(n){var i=$("#newPwd").val(),r=$("#newPwd2").val(),t="";if($("#UpdatePDModal .szhl_require")&&$("#UpdatePDModal .szhl_require").each(function(){$(this).val()==""&&(t=$(this).parent().find("label").text()+"不能为空")}),t!==""){top.layer.tips(t,n);return}if(i!=r){t="确认密码不一致";top.layer.tips(t,n);return}$.getJSON("/api/Auth/ExeAction?Action=MODIFYPWD",{P1:i,P2:r},function(t){$(n).removeClass("disabled").find("i").hide();$.trim(t.ErrorMsg)==""&&(top.ComFunJS.winsuccess("操作成功"),$("#UpdatePDModal").modal("hide"))});$("#newPwd").val("");$("#newPwd2").val("")},SaveWigetdata:function(){localStorage.setItem("WIGETDATAV5",JSON.stringify(model.FunData.$model));model.SelModelMenu("")},ChangeModelIsShow:function(n,t,i){i&&i.stopPropagation();n.isshow=!n.isshow;model.SaveWigetdata()},TypeData:[],GetTypeData:function(n,t){$.getJSON("/api/Auth/ExeAction?Action=GETZIDIANSLIST",{P1:n},function(n){if(n.ErrorMsg==""){if(t)return t.call(this,n.Result);model.TypeData=n.Result}})},UserCustomData:[],GetCustomData:function(n,t){$.getJSON("/api/Auth/ExeAction?Action=GETUSERGROUP",{P1:n},function(n){if(n.ErrorMsg==""){if(t)return t.call(this,n.Result);model.UserCustomData=n.Result}})},DelCustomData:function(n,t){t.stopPropagation&&t.stopPropagation();top.ComFunJS.winconfirm("确认要删除自定义搜索“"+n.DataContent+"”吗?",function(){$.post("/API/VIEWAPI.ashx",{Action:"XTGL_DELUSERGROUP",P1:n.ID},function(t){$.trim(t.ErrorMsg)==""&&(model.UserCustomData.remove(n),top.ComFunJS.winsuccess("删除成功"))})})},ShowColumns:[],ListData:[],page:{pageindex:1,pagecount:10,total:0},pageNum:[{num:10},{num:20},{num:30},{num:50},{num:100}],GetExtColumns:function(n){model.SelModel&&model.rdm==n&&$.getJSON("/api/Auth/ExeAction?Action=GETEXTENDFIELD",{P1:model.SelModel.ModelCode},function(n){if(n.ErrorMsg==""){$(n.Result).each(function(n,t){model.ShowColumns.push({ColName:t.TableFiledName,ColText:t.TableFiledName,IsSel:!1,format:""})});var t=localStorage.getItem(model.SelModel.ModelCode+"ShowColumns");t&&$(model.ShowColumns).each(function(n,i){$(JSON.parse(t)).each(function(n,t){i.ColName==t.ColName&&(i.IsSel=t.IsSel)})})}})},ReSetShow:function(n){n&&model.SelModel&&(model.SelModel.ModelCode!="LCSP"&&n.type!="link"?(n.IsSel=!n.IsSel,localStorage.setItem(model.SelModel.ModelCode+"ShowColumns",JSON.stringify(model.ShowColumns))):typeof tempindex!="undefined"&&tempindex.ReSetShow(n))},search:{seartype:"1",searchcontent:""},FnFormat:function(n,t){if(n=n+"",(n||t.format=="gzstatus")&&t.format)switch(t.format){case"shstate":n=="0"?n="未审核":n=="-1"?n="审核不通过":n=="1"&&(n="审核通过");break;case"statename":n=="-1"?n="":n=="已退回"&&(n="<span style='color:red;font-weight:bold'>"+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="<img src='"+n+"' style='width:60px;height:60px;' />";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="<label class='text-danger'>退回<\/label>"}break;case"clzt":switch(n){case"0":n="可用";break;case"1":n="报废";break;case"2":n="维修"}break;case"hyszt":switch(n){case"0":n="启用";break;case"1":n="禁用"}}return t.len&&(n=n.length>t.len?n.substring(0,t.len)+"...":n),n},ViewXXFB:function(n){ComFunJS.winviewform("/BiManage/AppPage/XXFB/XXFBVIEW.html?ID="+n.ID+"&r="+Math.random(),"新闻公告")},mouseover:function(){$(this).find(".tool").css("display","block")},mouseout:function(){$(this).find(".tool").css("display","none")},KQGZData:{},QDData:{QDDate:"未签到",Status:-1},QTData:{QTDate:"未签退",Status:-1},QDStatus:0,GetKQGZ:function(){$.getJSON("/API/VIEWAPI.ashx?Action=KQGL_GETKQGZ",{},function(n){n.ErrorMsg==""&&(n.Result.length>0&&(model.KQGZData=n.Result[0]),n.Result1.length>0&&(model.QDData.QDDate=n.Result1[0].KQDate,model.QDData.Status=n.Result1[0].Status,model.QDStatus=1),n.Result2.length>0&&(model.QTData.QTDate=n.Result2[0].KQDate,model.QTData.Status=n.Result2[0].Status,model.QDStatus=2))})},GetQDStausName:function(){var n="";switch(model.QDStatus){case 0:n="签到";break;case 1:n="签退";break;case 2:n="考勤结束"}return n},SaveQD:function(){model.QDStatus!=2&&$.post("/API/VIEWAPI.ashx",{Action:"KQGL_ADDKQJL",P1:model.QDStatus},function(n){$.trim(n.ErrorMsg)==""&&(model.QDStatus==0?(model.QDData.QDDate=n.Result.KQDate,model.QDData.Status=n.Result.Status,model.QDStatus=1):model.QDStatus==1&&(model.QTData.QTDate=n.Result.KQDate,model.QTData.Status=n.Result.Status,model.QDStatus=2),top.ComFunJS.winsuccess((model.QDStatus==1?"签到":"签退")+"成功"))})},InitData:function(){$.post("/API/VIEWAPI.ashx",{Action:"INIT_INITMODELTYPE"},function(){})},OpenSet:function(n){n&&n.stopPropagation();$("#myModal").modal("show")}});avalon.ready(function(){model.GetYYList();model.GetUserData();model.GetXXZXList();model.GetKQGZ()});model.page.$watch("pagecount",function(){localStorage.setItem(model.PageCode+"pagecount",model.page.pagecount)});
//# sourceMappingURL=index.min.js.map