/** * JS常用静态方法类库 * 源码地址:https://github.com/muyao1987/haoutil * 版本信息:v2.5.4 * 编译日期:2021-10-22 19:40:50 * 版权所有:Copyright by 火星科技 木遥 http://marsgis.cn */ var haoutil=haoutil||{};"object"==typeof exports?exports.haoutil=haoutil:window.haoutil=haoutil,haoutil.version="2.5.4",haoutil.name="木遥 通用常用JS方法类库",haoutil.author="木遥 , 微信: http://marsgis.cn/weixin.html",haoutil.update="2021-10-19",haoutil.website="https://github.com/muyao1987/haoutil",haoutil.msg=function(t){haoutil.isutil.isNull(t)?t="未知":"object"==typeof t&&(t=JSON.stringify(t)),window.toastr?toastr.info(t):window.layer?layer.msg(t):alert(t)},haoutil.tip=haoutil.msg,haoutil.oneMsg=function(t,e){haoutil.storage.get(e)||(haoutil.msg(t),haoutil.storage.add(e,!0))},haoutil.alert=function(t,e){haoutil.isutil.isNull(t)?t="未知":"object"==typeof t&&(t=JSON.stringify(t)),window.layer?layer.alert(t,{title:e||"提示",skin:"layui-layer-lan layer-mars-dialog",closeBtn:0,anim:0}):alert(t)},haoutil.loading={index:-1,show:function(t){this.close(),window.NProgress?((t=t||{}).color?t.template='
':t.template='
',NProgress.configure(t),NProgress.start()):window.layer&&(this.index=layer.load(2,{shade:[.3,"#000000"]}))},hide:function(){this.close()},close:function(){window.NProgress?NProgress.done(!0):window.layer&&(-1!=this.index&&layer.close(this.index),this.index=-1)}},String.prototype.startsWith=String.prototype.startsWith||function(t){return this.slice(0,t.length)==t},String.prototype.endsWith=String.prototype.endsWith||function(t){return this.slice(-t.length)==t},String.prototype.replaceAll=String.prototype.replaceAll||function(t,e){return this.replace(new RegExp(t,"gm"),e)},Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours()%12==0?12:this.getHours()%12,"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),/(E+)/.test(t)&&(t=t.replace(RegExp.$1,(1