Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
META-INF.web.lib.js.bee.jquery.bee.cloud1.js Maven / Gradle / Ivy
/*!
* 技术支持:度仙(13126408001)
*/
;var $p;try{top.data=parent&&parent.top.data?parent.top.data:new Object();top.ext=parent&&parent.top.ext?parent.top.ext:new Object();$p=parent.$}catch(e){}(function($){$.statusCode={ok:200,error:300,timeout:301,warning:302,nologin:311};$.error=function(msg){$.msg(msg)};$.warning=function(msg){$.msg(msg)};$.msg=function(msg){alert(typeof(msg)=="string"?msg:msg.message+(msg.code?"("+msg.code+")":""))};$.timeout=function(msg){$.msg(msg);top.location.href=$.loginUrl};$.freshLogin=function(){var $logininfo=$(".logininfo");if($logininfo.length==0){$logininfo=($p||$)(".logininfo")}$logininfo.find("span[name='employee_name']").text($.cookie("employee_name")||$.cookie("account"));$logininfo.find("span[name='org_name']").text($.cookie("org_name"));$logininfo.find("a[name='qout']").text("退出").one("click",function(){$.post({url:$(this).attr("url")||"/auth/login/logout",success:function(data){var strCookie=document.cookie;var arrCookie=strCookie.split("; ");for(var i=0;i0){$.cookie(arr[0],null)}}location.href="/"}})})};$.loginUrl=top.loginUrl||"/index.html";$.login=function(callback){var option={url:"/html/auth/login.shtml",title:"登陆超时,请重新登陆!",win:window,width:"448px",height:"380px",onshow:function(){console.log("onshow")},oniframeload:function(){var me=this;me.iframeNode.scrolling="auto";console.log("oniframeload")},onclose:function(){if(this.returnValue){if(typeof(dt.callback)=="function"){dt.callback(this.returnValue)}}console.log("onclose")},onremove:function(){console.log("onremove")},callback:function(){callback();$.freshLogin()},cancel:false};top.dialog(option).showModal()};$.reload=function(){if(!top.ajaxList){return}top.sending=top.ajaxList.length;var s;while(s=top.ajaxList.pop()){$.ajax(s)}};$.phost={wechat:"http://wechat.gcc.linham.cn"};$.churl=function(url){var arr=url.split("/");if(arr.length<3){return url}var nurl=$.phost[arr[1]];if(nurl){url=nurl+url}return url};$.isCross=function(url){return url.indexOf("://")>0&&url.indexOf("://"+document.domain)==-1};$.oAjax=$.ajax;$.ajaxCount=0;$.ajax=function(s){if(!s){return}s.url=$.churl(s.url);if(s.dataType=="html"){return $.oAjax(s)}s.url=s.url.rurl(s.data);s.dataType=s.dataType||"json";if(s.data instanceof FormData){s.processData=false;s.contentType=false}else{s.contentType="application/json;charset=utf-8"}if(s.dataType=="json"&&$.isCross(s.url)){s.crossDomain=true;s.xhrFields={withCredentials:true}}if(s.type!="GET"&&s.dataType=="json"&&typeof(s.data)=="object"&&!(s.data instanceof FormData)){s.data=JSON.stringify(s.data)}if(s.success){var _s=s;var _success=s.success;var _error=s.error||$.error;s.success=function(msg){if(typeof(msg)=="string"){_success(msg);return}if(msg.status==$.statusCode.timeout){if(!top.ajaxList){top.ajaxList=[]}top.ajaxList.push(_s);if(top.openLogin){return}if($.cookie("token")&&!top.openLogin){top.openLogin=true;$.login(function(){top.openLogin=false;$.reload()})}else{top.location.href=$.loginUrl}}else{if(msg.status==$.statusCode.nologin){top.location.href=$.loginUrl}else{if(msg.status==$.statusCode.ok){if(!msg.data){msg.data=[]}_success(msg)}else{if(msg.status==$.statusCode.warning){$.warning(msg.massage)}else{if(msg.status==$.statusCode.error){_error(msg)}else{if(msg.message){_error(msg)}else{_success(msg)}}}}}}if(msg.status!=$.statusCode.ok&&$.error){$.error(msg)}}}var _complete=s.complete;s.complete=function(XHR,TS){$.ajaxCount--;if(_complete){_complete(XHR,TS)}$.loaded(XHR,TS)};$.loading();$.ajaxCount++;$.oAjax(s)};$.loading=function(){var dialog=top.dialog?top.dialog.get(window):null;if(dialog&&dialog.loading){dialog.loading()}else{var tabbar=top.tabbar?typeof(top.tabbar.get)=="function"?top.tabbar.get(window):top.tabbar:{};if(tabbar&&tabbar.loading){tabbar.loading()}}};$.loaded=function(){var dialog=top.dialog?top.dialog.get(window):null;try{if($.ajaxCount<=0&&dialog&&dialog.loaded){dialog.loaded()}else{if($.ajaxCount<=0){var tabbar=top.tabbar?typeof(top.tabbar.get)=="function"?top.tabbar.get(window):top.tabbar:{};if(tabbar&&tabbar.loaded){tabbar.loaded()}}}}catch(e){alert(e)}};$.arg=function(){if(typeof(arguments[0])=="object"){var args=arguments[0];if(args.dataType==undefined){args.dataType="json"}if(args.cache==undefined){args.cache=false}return args}var url=arguments[0],data=arguments[1],callback=arguments[2],type=arguments[3],async=arguments[4];if($.isFunction(data)){type=type||callback;callback=data;data={}}if(typeof(type)=="boolean"){async=type;type="json"}return{url:url,data:data,success:callback,dataType:type||"json",cache:false,async:async===false?false:true}};$.get=function(){var opt=$.arg.apply(this,arguments);opt.type="GET";return $.ajax(opt)};$.post=function(){var opt=$.arg.apply(this,arguments);opt.type="POST";return $.ajax(opt)};$.put=function(){var opt=$.arg.apply(this,arguments);opt.type="PUT";return $.ajax(opt)};$.del=function(){var opt=$.arg.apply(this,arguments);opt.type="DELETE";return $.ajax(opt)};$.getParam=function(name,href){href=href||location;var r=(href.search+href.hash).match(new RegExp("[?]"+name+"=([^&|#]*)(&|#?)","i"));return r?unescape(r[1]):null};$.getParams=function(href){var url=href||location.search;if(url.indexOf("?")==-1){return{}}var params={};var strs=url.substr(url.indexOf("?")+1).split(/&|#/);for(var i=0;i0?"&":"?")+params);$("table[res][auto=true]",this).each(function(){var tb=new Table(this);tb.param.params=ps;if($(this).attr("auto")=="true"){tb.go()}});$("ul[res][auto=true]",this).each(function(){var tb=new Table(this);tb.param.params=ps;if($(this).attr("auto")=="true"){tb.go()}});if($.isFunction(callback)){callback()}};return $._load.apply(this,params?[url,params,call]:[url,call])}});$.extend(String.prototype,{rurl:function(data){data=data||{};return this.replace(/\${(.)*?}/g,function($1){return self[$1.replace(/[\${}]+/g,"")]||""}).replace(/{(.)*?}/g,function($1){var key=$1.replace(/[{}]+/g,"");return $.getParam(key)||data[key]||$1}).replace(/\[.*?{.*?}\]/g,"").replace(/[\[\]]/g,"").replace(/{.*?}/g,"")},isPositiveInteger:function(){return(new RegExp(/^[1-9]\d*$/).test(this))},isInteger:function(){return(new RegExp(/^\d+$/).test(this))},isNumber:function(value,element){return(new RegExp(/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/).test(this))},trim:function(){return this.replace(/(^\s*)|(\s*$)|\r|\n| /g,"")},trans:function(){return this.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')},replaceAll:function(os,ns){return this.replace(new RegExp(os,"gm"),ns)},replaceTm:function($data){if(!$data){return this}return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){return $data[$1.replace(/[{}]+/g,"")]})},replaceTmById:function(_box){var $parent=_box||$(document);return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){var $input=$parent.find("#"+$1.replace(/[{}]+/g,""));return $input.size()>0?$input.val():$1})},replaceTmByName:function(_box){var $parent=_box||$(document);return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){var $input=$parent.find("input[name="+$1.replace(/[{}]+/g,"")+"]");var val=[];$.each($input,function(){if(this.type=="checkbox"){if(this.checked){val.push(this.value)}}else{val.push(this.value)}});return val.length>0?val.join("_"):$1})},encodeHTML:function(){return this.replace(/[<>\"]/g,function(c){return{"<":"<",">":">",'"':"""}[c]})},decodeHTML:function(){return this.replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"')},clear:function(def){return this.replace(/\${(.)*?}/g,def||"")},bind:function(data,encodeHTML){if(!data){return this}var $this=this.replace(/%7(B|D)/g,function(c){return{"%7B":"{","%7D":"}"}[c]});return $this.replace(/\${(.)*?}/g,function($1){try{var val;if(data.length>0&&data[0]){var tmpData=data[0];val=tmpData[$1.replace(/[\${}]+/g,"")];if(typeof(val)=="object"){val=val.value}}else{var tmp=$1.replace(/[\${}]+/g,"").split("|");var key=tmp[0],obj={};key=key.replace(/#\((.)*?\)/,function($1){var f=$1.replace(/[\#\(\)]+/g,"");var v=data[f];return v?v:f});try{if(key.indexOf(".")>0){var arr=key.split(".");var ks="data";for(var i=0;i1?"|"+tmp[1]:"")+"}"}if(tmp.length>1){if(tmp[1].startsWith("@")){if(val===undefined||val===null){return""}try{if(typeof(val)=="string"&&val.startsWith(",")){val=val.substr(1)}var key=tmp[1].substr(1);var dict=$.dictionary[key];if(dict instanceof Array){return val}var arr=typeof(val)=="string"?val.split(","):[val];var tvalue="";arr.forEach(function(item,index){tvalue+=(","+(dict[item]||item))});return tvalue.substr(1)}catch(e){return val}}else{if(tmp[1].startsWith("#")){try{var obj=eval("("+tmp[1].substr(1)+")");return obj[val]}catch(e){return val}}else{if(tmp[1].startsWith("D")){val=Util.formatDate(val,tmp[tmp.length-1].substr(1))}else{if(tmp[1].startsWith("N")){val=Util.formatNumber(val,tmp[tmp.length-1].substr(1))}else{var tobj={},arr=tmp[1].replaceAll('"',"").split(",");for(var i=0;i").replace(/</g,"<");var val=eval("("+fn+")");return val==null?"":val}catch(e){return $1}})},isFinishedTm:function(){return !(new RegExp("{[A-Za-z_]+[A-Za-z0-9_]*}").test(this))},skipChar:function(ch){if(!this||this.length===0){return""}if(this.charAt(0)===ch){return this.substring(1).skipChar(ch)}return this},isValidPwd:function(){return(new RegExp(/^([_]|[a-zA-Z0-9]){6,32}$/).test(this))},isValidMail:function(){return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.trim()))},isSpaces:function(){for(var i=0;i"+v+"")})}else{if(res.startsWith("#")){var obj=eval("("+res.substr(1)+")");$.each(obj||{},function(k,v){$dm.append(""+v+" ")})}else{res=res.replace("{parent_value}",pval);$.get($.turnUrl(res),function(data){$.each(data.result||data.data||[],function(i,item){var children=item.children;var $op=$(""+item[vtitle]+" ");$dm.append($op);$op.data("data",item);$.each(children||[],function(k,ktem){var $op=$("---"+ktem[vtitle]+" ");$dm.append($op);$op.data("data",ktem)})})},false)}}};$.radioCheckboxTmp=" ${title} ";$._val=$.fn.val;$.fn.val=function(value){if(value instanceof Array&&value.length>0&&typeof(value[0])=="string"&&this.attr("custom")){for(var i in value){var a=value[i].split(",");value[i]=a[0];if(a.length>1){this.filter("[value="+a[0]+"]").next().val(a[1]).removeAttr("disabled")}else{if(this.filter("[value="+a[0]+"]").length==0){var custom=this.attr("custom");this.filter("[value="+custom+"]").attr("value",a[0]).next().val(a[0]).removeAttr("disabled")}}}this.not("[type=text]").val([value]);return this}var _val=$._val.apply(this,value===undefined?value:[value]);return _val};$.initRadioCheckbox=function($dm){$(":radio[res],:checkbox[res]",$dm).each(function(){var type=this.type;var $this=$(this),res=$this.attr("res"),vfield=$this.attr("vfield"),vtitle=$this.attr("vtitle")||"title",custom=$this.attr("custom"),data_rules=$this.attr("data-rules"),def=$this.attr("defval")||$.getParam("defval");def=def?def.split(","):[];var $wrap=$this.parent(),$tmp=$this.clone().removeAttr("res");if($wrap.is("label")){$wrap=$wrap.parent();$this.parent().remove()}$this.remove();if(res.startsWith("@")){var item=$.dictionary[res.substr(1)]||{};var $first=$wrap.children().first();$.each(item,function(k,v){var obj={type:type,name:$tmp.attr("name"),value:item instanceof Array?v:k,custom:custom?custom:"",data_rules:data_rules?data_rules:"",title:v};if(custom==obj.value){obj.title="";var $item=$($.radioCheckboxTmp.bind(obj));var name=item instanceof Array?"":(" name="+$this.attr("name"));var $other=$(" ");$item.append($other);if(item instanceof Array){$other.change(function(){$(this).prev().attr("value",this.value)})}$wrap.append($item)}else{$wrap.append($.radioCheckboxTmp.bind(obj))}});$wrap.find("input").not("[type=text]").val(def);$wrap.find("input").not("[_t=other]").change(function(){$wrap.find("input[_t=other]").attr("disabled","disabled");var $text=$(this).next();if($text.attr("type")=="text"){$text.removeAttr("disabled").focus()}})}else{if(res.startsWith("#")){var obj=eval("("+res.substr(1)+")");$.each(obj||{},function(k,v){var obj={type:type,name:$tmp.attr("name"),value:k,title:v};$wrap.append($.radioCheckboxTmp.bind(obj))});$wrap.find("input").val(def)}else{$.get($.turnUrl(res),function(data){$.each(data.data||[],function(i,v){var obj={type:type,name:$tmp.attr("name"),value:v[vfield],title:v[vtitle]};$wrap.append($.radioCheckboxTmp.bind(obj))});$wrap.find("input").val(def)},false)}}})};$.initButton=function($dm){$("button[target=delete]",$dm).each(function(){$(this).click(function(){var $this=$(this),res=$this.attr("href")||$this.attr("res"),title=$this.attr("title"),callback=$this.attr("callback");if(!res){return}var info=title?(title.indexOf("删除")==0?title:"删除"+title):"删除当前数据";if(!confirm("确定"+info+"吗?")){return}$.del(res,function(data){if(callback){if(callback.endsWith("()")){eval(callback)}else{var call=eval(callback);call(data)}}})})})};$.store=function(key,value){if(!key){return}if(value===undefined){var tmpData=localStorage.getItem(key);try{tmpData=JSON.parse(tmpData)}catch(e){}return tmpData}else{var data=value;if(typeof(value)=="object"){data=JSON.stringify(value)}localStorage.setItem(key,data)}},$.initLayDate=function($dm){$("input.datetime,.laydate",$dm).each(function(){var me=$(this);var id=this.id||("id"+Math.random()).replace(".","");if(!this.id){me.attr("id",id)}var option=me.attr("option"),callback=me.attr("callback");try{callback=callback&&callback.endsWith(")")?callback:eval(callback)}catch(e){}option=option?JSON.parse(option):{};var curDate=new Date();if(option.min==0||option.min=="nowTime"){var dt=new Date();dt.setHours(dt.getHours()+1);dt.setMinutes(0);dt.setSeconds(0);option.min=Util.formatDate(dt)}else{if(option.min&&option.min.endsWith("h")){var h=parseInt(option.min.replace("h",""))||0;var dt=new Date();dt.setHours(curDate.getHours()+h+1);dt.setMinutes(0);dt.setSeconds(0);option.min=Util.formatDate(dt)}else{if(option.min&&option.min.endsWith("m")){var m=parseInt(option.min.replace("m",""))||0;var dt=new Date();dt.setMinutes(curDate.getMinutes()+m);dt.setSeconds(0);option.min=Util.formatDate(dt)}else{if(option.min&&option.min.endsWith("d")){var d=parseInt(option.min.replace("d",""))||0;var dt=new Date();dt.setDate(curDate.getDate()+d);option.min=Util.formatDate(dt)}else{if(option.min&&option.min.endsWith("M")){var m=parseInt(option.min.replace("M",""))||0;var dt=new Date();dt.setMonth(curDate.getMonth()+m);option.min=Util.formatDate(dt)}else{if(option.min&&option.min.endsWith("y")){var y=parseInt(option.min.replace("y",""))||0;var dt=new Date();dt.setYear(curDate.getYear()+y);option.min=Util.formatDate(dt)}}}}}}option.elem="#"+id;option.type=option.type||me.attr("datetype")||"datetime";option.done=function(value,date){if(typeof(callback)=="function"){callback(value,this.elem)}else{if(callback){eval(callback)}}};option.change=function(value,date){};try{laydate.render(option)}catch(e){console.error(e)}})};$.countdown=function(){setInterval(function(){},1000)};$.initCountdown=function($dm){var $items=$(".countdown",$dm);window.setInterval(function(){$items.each(function(){var me=$(this),end=me.attr("end"),tmpEnd=parseInt(end),start=me.attr("start"),tmpStart=parseInt(start),curTime=new Date().getTime();if(!end&&!start){return}if(end&&end.length>=10){if(tmpEnd&&tmpEnd>1000000){end=tmpEnd}var endTime=new Date(end).getTime();if(curTime>endTime){me.text("已超时");return}var hh=parseInt((endTime-curTime)/(1000*60*60))||"0";var mm="00"+(parseInt(((endTime-curTime)%(1000*60*60))/(1000*60))||"0");var ss="00"+(parseInt((((endTime-curTime)%(1000*60*60))%(1000*60))/1000)||"0");var info=hh+":"+mm.substr(mm.length-2)+":"+ss.substr(ss.length-2);me.text(info)}else{if(start&&start.length>=10){if(tmpStart&&tmpStart>1000000){start=tmpStart}var startTime=new Date(start).getTime();if(startTime>curTime){me.text("未开始");return}var hh=parseInt((curTime-startTime)/(1000*60*60))||"0";var mm="00"+(parseInt(((curTime-startTime)%(1000*60*60))/(1000*60))||"0");var ss="00"+(parseInt((((curTime-startTime)%(1000*60*60))%(1000*60))/1000)||"0");var info=hh+":"+mm.substr(mm.length-2)+":"+ss.substr(ss.length-2);me.text(info)}else{me.text(end||start)}}})},1000)};$.inputSelect=function($dm){var init=function($sel,data){var call=$sel.attr("onselect");if(call){call=call&&call.endsWith(")")?call:eval(call)}var vfield=me.attr("vfield"),vtitle=me.attr("vtitle")};$("input[select]",$dm).each(function(){var me=$(this),res=me.attr("select"),vfield=me.attr("vfield");if(res.startsWith("@")){let key=res.substr(1),dict=$.dictionary[key];if(dict){let option={lookup:dict instanceof Array?dict:Object.values(dict),minChars:0,onSelect:function(suggestion){me.focus()}};me.autocomplete(option)}}else{me.one("click",function(){alert("asdf")});$.get($.turnUrl(res),function(data){var arr=[];vfield=vfield||"name";$.each(data.data||[],function(i,v){let value=v[vfield]||v.title||null;if(value){arr.push(value)}});let option={lookup:arr,minChars:0,onSelect:function(suggestion){me.focus()}};me.autocomplete(option)},false)}})};$.initTabbar=function($dm){$("a[target=tabbar],button[target=tabbar]",$dm).each(function(e){var $this=$(this);$this.off().click(function(e){stopDefault(e);var me=$(this);var key=me.attr("trgkey")||me.attr("id")||me.attr("key")||("key"+new Date().getTime());if(me.attr("more")!="true"){me.attr("trgkey",key)}var url=me.attr("url")||me.attr("href"),title=me.attr("tab_title")||me.attr("title")||me.text();url=url.bind($.getParams());var id=key;(tabbar||window.top.tabbar).add({url:url,title:title,key:key,info:me.attr("title"),icon:""})})})};$.initUpload=function($dom){$("div[upload=true]",$dom).each(function(e){var $this=$(this)})};$.init=function(dom){dom=dom||document;if(typeof(initDialog)=="function"){initDialog(dom)}$.initSelect(dom);$.inputSelect(dom);$.initRadioCheckbox(dom);$.initButton(dom);$.initLayDate(dom);$.initCountdown(dom);$.initTabbar(dom);$.initUpload(dom)}})(jQuery);$(document).ready(function(){$("body").addClass("animated fadeInDown");$.init();$.freshLogin()});var Util={number_cn:"〇一二三四五六七八九十".split(""),digit_cn:"亿万千百十".split(""),formatNumber:function(z,G){if(!G||!typeof(G)=="string"){return z}if(isNaN(parseFloat(z))){return z}z=parseFloat(z);if(G.trim().startsWith("{")){var w=JSON.parse(G);return w[z]}G=G.replace(/[a-z0-9]/ig,"#");var r=G.substr(0,G.indexOf("#")),F=G.substr(G.lastIndexOf("#")+1);G=G.replace(r,"").replace(F,"");if(!G){return r+z+F}var B=0,E=0,C="",w=0,v=G.split("");for(var x=v.length-1;x>=0;x--){if(v[x]=="."){E=w;w=0;continue}if(v[x]!="#"){C=v[x];B=w;w=0;break}w++}var y="",D=0,A=E>0?"."+"000000000000000000000000".substr(0,E):"",l=0,i=(""+z).split(".");if(i.length>1){l=E==0?parseFloat("."+i[1]):parseFloat("."+i[i.length-1]).toFixed(E);A=(""+l).substr(1)}D=parseInt(i[0])+parseInt(l);i[0]=""+D;if(B==0){y=i[0]}else{var u=i[0].split("");for(var x=0;x