var basePath=window.P_basePath||"";var loadingHtml='
加载中...
';Base={local:function(){return Base.cookie("local")||"zh"},Logger:{log:function(a){if(!!window.console){window.console.log(a)}},info:function(a){if(!!window.console){window.console.info(a)}},warn:function(a){if(!!window.console){window.console.warn(a)}},error:function(a){if(!!window.console){window.console.error(a)}},log2Server:function(a){}},handleURI:function(a){return a
}};Base.Dialog={_mask_classid:"_mask_classid",_zIndex:100,_getZIndex:function(){return Base.Dialog._zIndex++},showMask:function(b){var a=$("",{"class":Base.Dialog._mask_classid,css:{position:"fixed",background:"#000000",width:"100%",height:"100%","z-index":b||999,filter:"alpha(opacity=30)","-moz-opacity":0.3,opacity:0.3}});$(document.body).prepend(a)},hideMask:function(){var d=$("."+Base.Dialog._mask_classid,document.body);var c=null;for(var b=0,a=d.length;b",{"class":"loadhtml_classid",css:{clear:"both",height:"0px",overflow:"hidden"}}));e=$(".loadhtml_classid",document.body)}if($("."+c,e).length>0){$("."+c,e).remove()}var a=$("",{"class":"_container "+c,css:{display:"none"}});a.data("uri",b);a.data("params",d);e.append(a);Base.Dialog.showMask(Base.Dialog._getZIndex());Base.Tip.showLoading($(document.body),true);
Base.Ajax.load(b,d,function(){Base.Tip.showLoading($(document.body),false);a.css("z-index",Base.Dialog._getZIndex());a.show();if(f){f.call(this)}},a)},closeHtml:function(a){Base.Dialog.hideMask();var b=$(".loadhtml_classid",document.body);if($("."+a,b).length>0){$("."+a,b).remove()}},openIframe:function(a,e,c){a=Base.handleURI(a);c=c||{width:400,height:260};var i=$(".loadIframe_classid",document.body);if(i.length==0){$(document.body).append($("",{"class":"loadIframe_classid",css:{clear:"both",height:"0px",overflow:"hidden"}}));
i=$(".loadIframe_classid",document.body)}if($("iframe."+e,i).length>0){$("iframe."+e,i).remove()}Base.Tip.showLoading($(document.body),true);var h=parseInt(c.height);var b=parseInt(c.width);var g="-"+parseInt(h/2)+"px";var d="-"+parseInt(b/2)+"px";var f=$("",{src:a,"class":"_container "+e,frameBorder:0,scroling:"auto",height:h,width:b,css:{display:"none",position:"fixed",width:"400px",height:"260px",background:"#f2f2f2",top:"50%",left:"50%","margin-top":g,"margin-left":d,height:h+"px",width:b+"px","border-radius":"10px","box-shadow":"0px 0px 10px #333333",border:"1px solid #ccc"}});
f.data("url",a);i.append(f);Base.Dialog.showMask(Base.Dialog._getZIndex());f.css("z-index",Base.Dialog._getZIndex());f.show();Base.Tip.showLoading($(document.body),false)},closeIframe:function(a){parent.window.Base.Dialog.hideMask();var b=$(".loadIframe_classid",parent.window.document.body);if($("iframe."+a,b).length>0){$("iframe."+a,b).remove()}},openIframeLayer:function(g,f,a,d,c){d=Base.handleURI(d);var e={type:2,shadeClose:false,title:g,fix:true,closeBtn:[0,true],shade:[0.8,"#000"],border:[0],offset:["",""],area:[(f!=undefined?f:1000)+"px",(a!=undefined?a:($(window).height()-50))+"px"],iframe:{src:d}};
e=$.extend({},e,c);var b=$.layer(e);return b},openLayer:function(g,f,b,a,d){var e={type:1,shadeClose:false,title:g,closeBtn:[0,true],shade:[0.8,"#000"],border:[0],offset:["",""],area:[(f!=undefined?f:1000)+"px",(b!=undefined?b:($(window).height()-50))+"px"],page:{dom:a}};e=$.extend({},e,d);var c=$.layer(e);return c},closeIframeLayer:function(a){layer.close(a)},closeAllLayer:function(){layer.closeAll()}};Base.Ajax={_init:function(){if(!!!$.ajaxSetup){return}$.ajaxSetup({timeout:60000,error:function(a,c,b){Base.Logger.error(a.responseText);
if(a.responseText!=""&&a.responseText.indexOf("reloginAlert")!=-1){alert(a.responseText)}}})},load:function(c,d,e,a){Base.Ajax._init();c=Base.handleURI(c);d=d||{};a=a||"";if(a==""){alert("containerId参数未传入");return false}var b=$(a).data("showLoading");if(!!b){Base.Tip.showLoading($(a),true)}return $(a).load(c,d,function(h,f,g){if(h.indexOf('loginPage="true"')!=-1){$(a).html("登录超时,请重新登录!");alert("登录超时,请重新登录!");location.href=window.P_basePath+"/login"}if(e){if(!!b){Base.Tip.showLoading($(a),false)}e.call(this)
}})},post:function(c,d,e,b,f,a){Base.Ajax._init();c=Base.handleURI(c);return $.ajax({type:"POST",url:c,data:e,dataType:b?b:"json",async:d,success:function(h,g){try{if(f){f(h,g).call(this)}}catch(i){}},error:function(g,i,h){Base.Logger.error(g.responseText);if(a){a(g,i,h)}else{if(g.responseText!=""){if(g.responseText.indexOf('loginPage="true"')!=-1){alert("登录超时,请重新登录!");location.href=window.P_basePath+"/login"}Base.Logger.error(g.responseText)}}}})},_recordRequestTime:function(a){$(a).data("_ajax_latestRequestTime",new Date().getTime())
},_recordRequestCount:function(a){$(a).data("_ajax_latestRequestCount",new Date().getTime())},recordRequestInfo:function(d,e){var c=new Date().getTime();var a=$(d).data("_ajax_latestRequestTime")||c;$(d).data("_ajax_intervalSeconds",e);var b=1;if(parseInt((c-a)/1000)<=e){b=parseInt($(d).data("_ajax_latestRequestCount")||0);b++}$(d).data("_ajax_latestRequestCount",b);$(d).data("_ajax_latestRequestTime",c)},checkEnableRequest:function(d,e){var c=new Date().getTime();var a=$(d).data("_ajax_latestRequestTime")||c;
var f=parseInt($(d).data("_ajax_intervalSeconds")||60);if(parseInt((c-a)/1000)>f){$(d).data("_ajax_latestRequestCount",0)}var b=parseInt($(d).data("_ajax_latestRequestCount")||0);return b<=e}};Base.Tip={_init:function(){if(!!!$.jBox){return false}var a={};a.defaults={id:null,zIndex:5000,top:"30%",border:5,opacity:0.2,timeout:0,showType:"fade",showSpeed:"fast",showIcon:true,showClose:true,draggable:true,dragLimit:true,dragClone:false,persistent:true,showScrolling:true,ajaxData:{},iframeScrolling:"auto",title:"jBox",width:350,height:"auto",bottomText:"",buttons:{"确定":"ok"},buttonsFocus:0,loaded:function(b){},submit:function(b,c,d){return true
},closed:function(){}};a.stateDefaults={content:"",buttons:{"确定":"ok"},buttonsFocus:0,submit:function(b,c,d){return true}};a.tipDefaults={content:"",icon:"info",top:"40%",width:"auto",height:"auto",opacity:0,timeout:2000,closed:function(){}};a.messagerDefaults={content:"",title:"温馨提示",icon:"none",width:350,height:"auto",timeout:3000,showType:"slide",showSpeed:600,border:0,buttons:{},buttonsFocus:0,loaded:function(b){},submit:function(b,c,d){return true},closed:function(){}};a.languageDefaults={close:"关闭",ok:"确定",yes:"是",no:"否",cancel:"取消"};
$.jBox.setDefaults(a)},_autoClose:function(b,a){},closeAll:function(){},alert:function(a){jBox.alert(a,"温馨提示",{width:400,height:120,icon:"info"})},information:function(a){jBox.alert(a,"温馨提示",{width:400,height:120,icon:"info"})},error:function(a){jBox.alert(a,"温馨提示",{width:400,height:120,icon:"error"})},warning:function(a){jBox.alert(a,"温馨提示",{width:400,height:120,icon:"warning"})},notification:function(a){jBox.tip(a,"info")},success:function(a){jBox.tip(a,"success")},alertConfirm:function(c,b,a){jBox.confirm(b,c,a,{id:"alertConfirm",showScrolling:false,buttons:{"确定":true}})
},confirm:function(d,c,b,a){jBox.confirm(c,d,function(e,g,i){if(e==true){b()}else{a()}},{id:"confirm",showScrolling:false,buttons:{"确定":true,"取消":false}})},showLoading:function(e,a,d){if($(".showloading",e).length>0){$(".showloading",e).remove()}if($(".showloading",e).length==0){var b=$("",{"class":"showloading"});d=d||"加载中...";b.append(d);e.append(b)}var c=$(".showloading",e);if(a){c.css("display","block")}else{setTimeout(function(){c.css("display","none")},50)}},showProgessbar:function(f,a,e){if($(".showProgessbar",f).length>1){$(".showProgessbar",f).remove()
}if($(".showProgessbar",f).length==0){var b=$("",{"class":"showProgessbar"});e=e||"努力加载中~";b.append(''+e+"
");f.append(b)}function d(){$(".progressbar span",f).animate({width:"0%"},0).animate({width:"100%"},3000,"linear",function(){d()})}var c=$(".showProgessbar",f);if(a){c.css("display","block");d()}else{$(".progressbar span",f).stop();setTimeout(function(){c.css("display","none")},50)}}};Base.Tip._init();Base.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};
if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");
for(var h=0;h");a=a.replace(/"/g,'"');a=a.replace(/ /g," ");return a},htmlEncode:function htmlEncode(a){a=a.replace(/&/g,"&");
a=a.replace(//g,">");a=a.replace(/\"/g,""");a=a.replace(/ /g," ");return a},getChineseLength:function(e){var d=0;var c=e.split("");for(var b=0,a=c.length;bb){break}d+=e[c]}return d},getXYDPI:function(){var b=new Array;if(window.screen.deviceXDPI){b[0]=window.screen.deviceXDPI;
b[1]=window.screen.deviceYDPI}else{var a=document.createElement("DIV");a.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";document.body.appendChild(a);b[0]=parseInt(a.offsetWidth);b[1]=parseInt(a.offsetHeight);a.parentNode.removeChild(a)}return b},convertMM2PX:function(e,a){var c=Utils.getXYDPI();var b=parseInt(e)*parseInt(c[0])/25.4;var d=parseInt(a)*parseInt(c[1])/25.4;return{width:parseInt(b),height:parseInt(d)}},getRequestParam:function(a){var e=window.location.search;
var d=e.substr(1,e.length-1).split("&");for(var b=0;b=2){b=a%2;c.push(b);a=(a-b)/2}c.push(a);c.reverse();return c.join("")};Utils.getBitSelection=function(f){var b=[];if(f!=""){var a=Utils.toBin(f);var d="";var g;for(var e=0,c=a.length;e0){return Utils.IP._inner[0]}return""
},getIpv61:function(){if(Utils.IP._ipv6.length>0){return Utils.IP._ipv6[0]}return""},getPublicIp1:function(){if(Utils.IP._public.length>0){return Utils.IP._public[0]}return""}};RMBUtil={convert2Thousand:function(c){var b=/(-?\d+)(\d{3})/;var a=c+"";while(b.test(a)){a=a.replace(b,"$1,$2")}return a},number2ChineseUpper:function(k){if(!/^(0|[1-9]\d*)(\.\d+)?$/.test(k)){return""}if(typeof(k)=="number"){if(-1==k.toString().indexOf(".")){if(k==0){return"零"}var c=RMBUtil._seti2c(k);if(c.substring(c.length-1)=="零"){c=c.substring(0,c.length-1)
}return c}else{var g,e,h,b,d,j;d=k.toString().split(".");g=d[0];h=d[1];e=RMBUtil._seti2c(g);b=RMBUtil._setf2c(h);j=e+"点"+b;j=j.replace(/零+/g,"零");return j}}else{return"---"}},number2ChineseUpperMoney:function(j){if(!/^(0|[1-9]\d*)(\.\d+)?$/.test(j)){return""}if(typeof(j)=="number"){if(-1==j.toString().indexOf(".")){if(j==0){return"零元整"}return RMBUtil._seti2cMoney(j)+"整"}else{var e,d,g,b,c,h;c=j.toString().split(".");e=c[0];g=c[1];d=RMBUtil._seti2cMoney(e);b=RMBUtil._setf2cMoney(g);if(d.length==0){h=b
}else{h=d+"零"+b}h=h.replace(/零+/g,"零");return h}}else{return"---"}},_seti2cMoney:function(e){var c=e.toString();var d="";for(var b=1;b=0?"":"-";h=parseFloat(h)>=0?parseFloat(h):-parseFloat(h);var o=h.toString();
var r;var f;var d;var p;if(/\./g.test(m)){d=m.split(".")[0];p=m.split(".")[1]}else{d=m;p=null}if(/\./g.test(o)){if(p!=null){var i=Math.round(parseFloat("0."+o.split(".")[1])*Math.pow(10,p.length))/Math.pow(10,p.length);r=(Math.floor(h)+Math.floor(i)).toString();f=/\./g.test(i.toString())?i.toString().split(".")[1]:"0"}else{r=Math.round(h).toString();f="0"}}else{r=o;f="0"}if(d!=null){var j="";var l=d.match(/0*$/)[0].length;var q=null;if(/,/g.test(d)){q=d.match(/,[^,]*/)[0].length-1}var a=new RegExp("(\\d{"+q+"})","g");
if(r.length12){k="0秒"}return k},floatAdd:function(h,g){var f,d,b;try{f=h.toString().split(".")[1].length}catch(i){f=0
}try{d=g.toString().split(".")[1].length}catch(i){d=0}b=Math.pow(10,Math.max(f,d));var j=(f>=d)?f:d;var c=(h*b+g*b)/b;return parseFloat(c.toFixed(j))},floatSub:function(f,d){var c,b,a,h;try{c=f.toString().split(".")[1].length}catch(g){c=0}try{b=d.toString().split(".")[1].length}catch(g){b=0}a=Math.pow(10,Math.max(c,b));h=(c>=b)?c:b;return parseFloat(((f*a-d*a)/a).toFixed(h))},floatMul:function(d,b){var a=0,f=d.toString(),c=b.toString();try{a+=f.split(".")[1].length}catch(g){}try{a+=c.split(".")[1].length
}catch(g){}var h=Number(f.replace(".",""))*Number(c.replace(".",""))/Math.pow(10,a);return parseFloat(h.toFixed(2))},FloatDiv:function(arg1,arg2){var t1=0,t2=0,r1,r2;try{t1=arg1.toString().split(".")[1].length}catch(e){}try{t2=arg2.toString().split(".")[1].length}catch(e){}with(Math){r1=Number(arg1.toString().replace(".",""));r2=Number(arg2.toString().replace(".",""));return(r1/r2)*pow(10,t2-t1)}}};ValidatorUtil={chineseChar:function(a){return/^[\u4e00-\u9fa5]+$/gi.test(a)},commonChar:function(a){return/^[A-Za-z0-9]+$/gi.test(a)
},commonCharInclude_:function(a){return/^\w+$/gi.test(a)},commonCharIncludeChinese:function(a){return/^[\da-z\u4E00-\u9FA5\uF900-\uFA2D]+$/gi.test(a)},email:function(a){var b=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;return b.test(a)},mobile:function(a){var b=/^1[0-9][0-9]\d{8}$/;return b.test(a)},phone:function(b){var a=/^(0[0-9]{2,3}\-?)?([2-9][0-9]{6,7}){1}(\-[0-9]{1,4})?$/;return a.test(b)},number:function(b){var a=/^\d{0,}$/;return a.test(b)},floatNumber:function(a){var b=/^([+-]?)\d+\.\d+$/;return b.test(a)
},zipCode:function(b){var a=/^[1-9]\d{5}$/;return a.test(b)},luhmCheck:function(e){if(isNaN(parseInt(e,10))){return false}if(e.length==20){return true}var x=e.substr(e.length-1,1);var b=e.substr(0,e.length-1);var A=new Array();for(var w=b.length-1;w>-1;w--){A.push(b.substr(w,1))}var s=new Array();var a=new Array();var g=new Array();for(var v=0;v',getFieldXml:function(a,b){if(a==""){return""}var c=[];c.push("");c.push("");c.push(a);c.push("");
c.push("");c.push("");c.push("");c.push("");return c.join("")},getXmlValues:function(b){var a=[];a.push(Utils.tempForm.xmlHead);a.push("");$(b).each(function(d,f){var c=$(f).attr("name");if(c==undefined){alert(f.outerHTML+" 未定义name属性")}var e="";if($(f).attr("fnGetValue")!=undefined&&typeof window[$(f).attr("fnGetValue")]=="function"){e=window[$(f).attr("fnGetValue")].call($(f));if(typeof e=="object"){e=JSON.stringify(e)}}else{e=$(f).val()
}a.push(Utils.tempForm.getFieldXml(c,e))});a.push("");return a.join("")},parseXmlValues:function(h){var c=$("field",$.parseXML(h));for(var e=0,b=c.length;e