!function(){var isLayui=window.layui&&layui.define,ready={getPath:function(){var jsPath=document.currentScript?document.currentScript.src:function(){var js=document.scripts,last=js.length-1,src;for(var i=last;i>0;i--){if(js[i].readyState==="interactive"){src=js[i].src;break}}return src||js[last].src}();return jsPath.substring(0,jsPath.lastIndexOf("/")+1)}(),getStyle:function(node,name){var style=node.currentStyle?node.currentStyle:window.getComputedStyle(node,null);return style[style.getPropertyValue?"getPropertyValue":"getAttribute"](name)},link:function(href,fn,cssname){if(!laydate.path){return}var head=document.getElementsByTagName("head")[0],link=document.createElement("link");if(typeof fn==="string"){cssname=fn}var app=(cssname||href).replace(/\.|\//g,"");var id="layuicss-"+app,timeout=0;link.rel="stylesheet";link.href=laydate.path+href;link.id=id;if(!document.getElementById(id)){head.appendChild(link)}if(typeof fn!=="function"){return}(function poll(){if(++timeout>8*1000/100){return window.console&&console.error("laydate.css: Invalid")}parseInt(ready.getStyle(document.getElementById(id),"width"))===1989?fn():setTimeout(poll,100)}())}},laydate={v:"5.0.9",config:{},index:(window.laydate&&window.laydate.v)?100000:0,path:ready.getPath,set:function(options){var that=this;that.config=lay.extend({},that.config,options);return that},ready:function(fn){var cssname="laydate",ver="",path=(isLayui?"modules/laydate/":"theme/")+"default/laydate.css?v="+laydate.v+ver;isLayui?layui.addcss(path,fn,cssname):ready.link(path,fn,cssname);return this}},thisDate=function(){var that=this;return{hint:function(content){that.hint.call(that,content)},config:that.config}},MOD_NAME="laydate",ELEM=".layui-laydate",THIS="layui-this",SHOW="layui-show",HIDE="layui-hide",DISABLED="laydate-disabled",TIPS_OUT="开始日期超出了结束日期
建议重新选择",LIMIT_YEAR=[100,200000],ELEM_STATIC="layui-laydate-static",ELEM_LIST="layui-laydate-list",ELEM_SELECTED="laydate-selected",ELEM_HINT="layui-laydate-hint",ELEM_PREV="laydate-day-prev",ELEM_NEXT="laydate-day-next",ELEM_FOOTER="layui-laydate-footer",ELEM_CONFIRM=".laydate-btns-confirm",ELEM_TIME_TEXT="laydate-time-text",ELEM_TIME_BTN=".laydate-btns-time",Class=function(options){var that=this;that.index=++laydate.index;that.config=lay.extend({},that.config,laydate.config,options);laydate.ready(function(){that.init()})},lay=function(selector){return new LAY(selector)},LAY=function(selector){var index=0,nativeDOM=typeof selector==="object"?[selector]:(this.selector=selector,document.querySelectorAll(selector||null));for(;index0){return that[0].getAttribute(key)}}():that.each(function(index,item){item.setAttribute(key,value)})};LAY.prototype.removeAttr=function(key){return this.each(function(index,item){item.removeAttribute(key)})};LAY.prototype.html=function(html){return this.each(function(index,item){item.innerHTML=html})};LAY.prototype.val=function(value){return this.each(function(index,item){item.value=value})};LAY.prototype.append=function(elem){return this.each(function(index,item){typeof elem==="object"?item.appendChild(elem):item.innerHTML=item.innerHTML+elem})};LAY.prototype.remove=function(elem){return this.each(function(index,item){elem?item.removeChild(elem):item.parentNode.removeChild(item)})};LAY.prototype.on=function(eventName,fn){return this.each(function(index,item){item.attachEvent?item.attachEvent("on"+eventName,function(e){e.target=e.srcElement;fn.call(item,e)}):item.addEventListener(eventName,fn,false)})};LAY.prototype.off=function(eventName,fn){return this.each(function(index,item){item.detachEvent?item.detachEvent("on"+eventName,fn):item.removeEventListener(eventName,fn,false)})};Class.isLeapYear=function(year){return(year%4===0&&year%100!==0)||year%400===0};Class.prototype.config={type:"date",range:false,format:"yyyy-MM-dd",value:null,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:false,showBottom:true,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:false,mark:{},zIndex:null,done:null,change:null};Class.prototype.lang=function(){var that=this,options=that.config,text={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在",perpetual:"永久"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now",perpetual:"Perpetual"}}};return text[options.lang]||text["cn"]};Class.prototype.init=function(){var that=this,options=that.config,dateType="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",isStatic=options.position==="static",format={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};options.elem=lay(options.elem);options.eventElem=lay(options.eventElem);if(!options.elem[0]){return}if(options.range===true){options.range="-"}if(options.format===format.date){options.format=format[options.type]}that.format=options.format.match(new RegExp(dateType+"|.","g"))||[];that.EXP_IF="";that.EXP_SPLIT="";lay.each(that.format,function(i,item){var EXP=new RegExp(dateType).test(item)?"\\d{"+function(){if(new RegExp(dateType).test(that.format[i===0?i+1:i-1]||"")){if(/^yyyy|y$/.test(item)){return 4}return item.length}if(/^yyyy$/.test(item)){return"1,4"}if(/^y$/.test(item)){return"1,308"}return"1,2"}()+"}":"\\"+item;that.EXP_IF=that.EXP_IF+EXP;that.EXP_SPLIT=that.EXP_SPLIT+"("+EXP+")"});that.EXP_IF=new RegExp("^"+(options.range?that.EXP_IF+"\\s\\"+options.range+"\\s"+that.EXP_IF:that.EXP_IF)+"$");that.EXP_SPLIT=new RegExp("^"+that.EXP_SPLIT+"$","");if(!that.isInput(options.elem[0])){if(options.trigger==="focus"){options.trigger="click"}}if(!options.elem.attr("lay-key")){options.elem.attr("lay-key",that.index);options.eventElem.attr("lay-key",that.index)}options.mark=lay.extend({},(options.calendar&&options.lang==="cn")?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},options.mark);lay.each(["min","max"],function(i,item){var ymd=[],hms=[];if(typeof options[item]==="number"){var day=options[item],time=new Date().getTime(),STAMP=86400000,thisDate=new Date(day?(day0){return true}var divHeader=lay.elem("div",{"class":"layui-laydate-header"}),headerChild=[function(){var elem=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});elem.innerHTML="";return elem}(),function(){var elem=lay.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});elem.innerHTML="";return elem}(),function(){var elem=lay.elem("div",{"class":"laydate-set-ym"}),spanY=lay.elem("span"),spanM=lay.elem("span");elem.appendChild(spanY);elem.appendChild(spanM);return elem}(),function(){var elem=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});elem.innerHTML="";return elem}(),function(){var elem=lay.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});elem.innerHTML="";return elem}()],divContent=lay.elem("div",{"class":"layui-laydate-content"}),table=lay.elem("table"),thead=lay.elem("thead"),theadTr=lay.elem("tr");lay.each(headerChild,function(i,item){divHeader.appendChild(item)});thead.appendChild(theadTr);lay.each(new Array(6),function(i){var tr=table.insertRow(0);lay.each(new Array(7),function(j){if(i===0){var th=lay.elem("th");th.innerHTML=lang.weeks[j];theadTr.appendChild(th)}tr.insertCell(j)})});table.insertBefore(thead,table.children[0]);divContent.appendChild(table);elemMain[i]=lay.elem("div",{"class":"layui-laydate-main laydate-main-list-"+i});elemMain[i].appendChild(divHeader);elemMain[i].appendChild(divContent);elemHeader.push(headerChild);elemCont.push(divContent);elemTable.push(table)});lay(divFooter).html(function(){var html=[],btns=[];if(options.type==="datetime"){html.push(''+lang.timeTips+"")}lay.each(options.btns,function(i,item){var title=lang.tools[item]||"btn";if(options.range&&item==="now"){return}if(isStatic&&item==="clear"){title=options.lang==="cn"?"重置":"Reset"}btns.push(''+title+"")});html.push('");return html.join("")}());lay.each(elemMain,function(i,main){elem.appendChild(main)});options.showBottom&&elem.appendChild(divFooter);if(/^#/.test(options.theme)){var style=lay.elem("style"),styleText=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,that.elemID).replace(/{{theme}}/g,options.theme);if("styleSheet" in style){style.setAttribute("type","text/css");style.styleSheet.cssText=styleText}else{style.innerHTML=styleText}lay(elem).addClass("laydate-theme-molv");elem.appendChild(style)}that.remove(Class.thisElemDate);isStatic?options.elem.append(elem):(document.body.appendChild(elem),that.position());that.checkDate().calendar();that.changeEvent();Class.thisElemDate=that.elemID;typeof options.ready==="function"&&options.ready(lay.extend({},options.dateTime,{month:options.dateTime.month+1}))};Class.prototype.remove=function(prev){var that=this,options=that.config,elem=lay("#"+(prev||that.elemID));if(!elem.hasClass(ELEM_STATIC)){that.checkDate(function(){elem.remove()})}return that};Class.prototype.position=function(){var that=this,options=that.config,elem=that.bindElem||options.elem[0],rect=elem.getBoundingClientRect(),elemWidth=that.elem.offsetWidth,elemHeight=that.elem.offsetHeight,scrollArea=function(type){type=type?"scrollLeft":"scrollTop";return document.body[type]|document.documentElement[type]},winArea=function(type){return document.documentElement[type?"clientWidth":"clientHeight"]},margin=5,left=rect.left,top=rect.bottom;if(left+elemWidth+margin>winArea("width")){left=winArea("width")-elemWidth-margin}if(top+elemHeight+margin>winArea()){top=rect.top>elemHeight?rect.top-elemHeight:winArea()-elemHeight;top=top-margin*2}if(options.position){that.elem.style.position=options.position}that.elem.style.left=left+(options.position==="fixed"?0:scrollArea(1))+"px";that.elem.style.top=top+(options.position==="fixed"?0:scrollArea())+"px"};Class.prototype.hint=function(content){var that=this,options=that.config,div=lay.elem("div",{"class":ELEM_HINT});div.innerHTML=content||"";lay(that.elem).find("."+ELEM_HINT).remove();that.elem.appendChild(div);clearTimeout(that.hinTimer);that.hinTimer=setTimeout(function(){lay(that.elem).find("."+ELEM_HINT).remove()},3000)};Class.prototype.getAsYM=function(Y,M,type){type?M--:M++;if(M<0){M=11;Y--}if(M>11){M=0;Y++}return[Y,M]};Class.prototype.systemDate=function(newDate){var thisDate=newDate||new Date();return{year:thisDate.getFullYear(),month:thisDate.getMonth(),date:thisDate.getDate(),hours:newDate?newDate.getHours():0,minutes:newDate?newDate.getMinutes():0,seconds:newDate?newDate.getSeconds():0}};Class.prototype.checkDate=function(fn){var that=this,thisDate=new Date(),options=that.config,dateTime=options.dateTime=options.dateTime||that.systemDate(),thisMaxDate,error,elem=that.bindElem||options.elem[0],valType=that.isInput(elem)?"val":"html",value=that.isInput(elem)?elem.value:(options.position==="static"?"":elem.innerHTML),checkValid=function(dateTime){if(dateTime.year>LIMIT_YEAR[1]){dateTime.year=LIMIT_YEAR[1],error=true}if(dateTime.month>11){dateTime.month=11,error=true}if(dateTime.hours>23){dateTime.hours=0,error=true}if(dateTime.minutes>59){dateTime.minutes=0,dateTime.hours++,error=true}if(dateTime.seconds>59){dateTime.seconds=0,dateTime.minutes++,error=true}thisMaxDate=laydate.getEndDate(dateTime.month+1,dateTime.year);if(dateTime.date>thisMaxDate){dateTime.date=thisMaxDate,error=true}},initDate=function(dateTime,value,index){var startEnd=["startTime","endTime"];value=(value.match(that.EXP_SPLIT)||[]).slice(1);index=index||0;if(options.range){that[startEnd[index]]=that[startEnd[index]]||{}}lay.each(that.format,function(i,item){var thisv=parseFloat(value[i]);if(value[i].length必须遵循下述格式:
"+(options.range?(options.format+" "+options.range+" "+options.format):options.format)+"
已为你重置");error=true}else{error=false}}}else{if(value&&value.constructor===Date){options.dateTime=that.systemDate(value)}else{options.dateTime=that.systemDate();delete that.startState;delete that.endState;delete that.startDate;delete that.endDate;delete that.startTime;delete that.endTime}}checkValid(dateTime);if(error&&value){that.setValue(options.range?(that.endDate?that.parse():""):that.parse())}fn&&fn();return that};Class.prototype.mark=function(td,YMD){var that=this,mark,options=that.config;lay.each(options.mark,function(key,title){var keys=key.split("-");if((keys[0]==YMD[0]||keys[0]==0)&&(keys[1]==YMD[1]||keys[1]==0)&&keys[2]==YMD[2]){mark=title||YMD[2]}});mark&&td.html(''+mark+"");return that};Class.prototype.limit=function(elem,date,index,time){var that=this,options=that.config,timestrap={},dateTime=options[index>41?"endDate":"dateTime"],isOut,thisDateTime=lay.extend({},dateTime,date||{});lay.each({now:thisDateTime,min:options.min,max:options.max},function(key,item){timestrap[key]=that.newDate(lay.extend({year:item.year,month:item.month,date:item.date},function(){var hms={};lay.each(time,function(i,keys){hms[keys]=item[keys]});return hms}())).getTime()});isOut=timestrap.nowtimestrap.max;elem&&elem[isOut?"addClass":"removeClass"](DISABLED);return isOut};Class.prototype.calendar=function(value){var that=this,options=that.config,dateTime=value||options.dateTime,thisDate=new Date(),startWeek,prevMaxDate,thisMaxDate,lang=that.lang(),isAlone=options.type!=="date"&&options.type!=="datetime",index=value?1:0,tds=lay(that.table[index]).find("td"),elemYM=lay(that.elemHeader[index][2]).find("span");if(dateTime.yearLIMIT_YEAR[1]){dateTime.year=LIMIT_YEAR[1],that.hint("最高只能支持到公元"+LIMIT_YEAR[1]+"年")}if(!that.firstDate){that.firstDate=lay.extend({},dateTime)}thisDate.setFullYear(dateTime.year,dateTime.month,1);startWeek=thisDate.getDay();prevMaxDate=laydate.getEndDate(dateTime.month||12,dateTime.year);thisMaxDate=laydate.getEndDate(dateTime.month+1,dateTime.year);lay.each(tds,function(index,item){var YMD=[dateTime.year,dateTime.month],st=0;item=lay(item);item.removeAttr("class");if(index=startWeek&&index=that.firstDate.year){ymd.month=options.max.month;ymd.date=options.max.date}}that.limit(lay(li),ymd,index);yearNum++});lay(elemYM[isCN?0:1]).attr("lay-ym",(yearNum-8)+"-"+listYM[1]).html((startY+text)+" - "+(yearNum-1+text))}else{if(type==="month"){lay.each(new Array(12),function(i){var li=lay.elem("li",{"lay-ym":i}),ymd={year:listYM[0],month:i};i+1==listYM[1]&&lay(li).addClass(THIS);li.innerHTML=lang.month[i]+(isCN?"月":"");ul.appendChild(li);if(listYM[0]=that.firstDate.year){ymd.date=options.max.date}}that.limit(lay(li),ymd,index)});lay(elemYM[isCN?0:1]).attr("lay-ym",listYM[0]+"-"+listYM[1]).html(listYM[0]+text)}else{if(type==="time"){var setTimeStatus=function(){lay(ul).find("ol").each(function(i,ol){lay(ol).find("li").each(function(ii,li){that.limit(lay(li),[{hours:ii},{hours:that[startEnd].hours,minutes:ii},{hours:that[startEnd].hours,minutes:that[startEnd].minutes,seconds:ii}][i],index,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][i])})});if(!options.range){that.limit(lay(that.footer).find(ELEM_CONFIRM),that[startEnd],0,["hours","minutes","seconds"])}};if(options.range){if(!that[startEnd]){that[startEnd]={hours:0,minutes:0,seconds:0}}}else{that[startEnd]=dateTime}lay.each([24,60,60],function(i,item){var li=lay.elem("li"),childUL=["

"+lang.time[i]+"

    "];lay.each(new Array(item),function(ii){childUL.push(""+lay.digit(ii,2)+"")});li.innerHTML=childUL.join("")+"
";ul.appendChild(li)});setTimeStatus()}}}if(haveList){elemCont.removeChild(haveList)}elemCont.appendChild(ul);if(type==="year"||type==="month"){lay(that.elemMain[index]).addClass("laydate-ym-show");lay(ul).find("li").on("click",function(){var ym=lay(this).attr("lay-ym")|0;if(lay(this).hasClass(DISABLED)){return}if(index===0){dateTime[type]=ym;if(isAlone){that.startDate[type]=ym}that.limit(lay(that.footer).find(ELEM_CONFIRM),null,0)}else{if(isAlone){that.endDate[type]=ym}else{var YM=type==="year"?that.getAsYM(ym,listYM[1]-1,"sub"):that.getAsYM(listYM[0],ym,"sub");lay.extend(dateTime,{year:YM[0],month:YM[1]})}}if(options.type==="year"||options.type==="month"){lay(ul).find("."+THIS).removeClass(THIS);lay(this).addClass(THIS);if(options.type==="month"&&type==="year"){that.listYM[index][0]=ym;isAlone&&(that[["startDate","endDate"][index]].year=ym);that.list("month",index)}}else{that.checkDate("limit").calendar();that.closeList()}that.setBtnStatus();options.range||that.done(null,"change");lay(that.footer).find(ELEM_TIME_BTN).removeClass(DISABLED)})}else{var span=lay.elem("span",{"class":ELEM_TIME_TEXT}),scroll=function(){lay(ul).find("ol").each(function(i){var ol=this,li=lay(ol).find("li");ol.scrollTop=30*(that[startEnd][hms[i]]-2);if(ol.scrollTop<=0){li.each(function(ii,item){if(!lay(this).hasClass(DISABLED)){ol.scrollTop=30*(ii-2);return true}})}})},haveSpan=lay(elemHeader[2]).find("."+ELEM_TIME_TEXT);scroll();span.innerHTML=options.range?[lang.startTime,lang.endTime][index]:lang.timeTips;lay(that.elemMain[index]).addClass("laydate-time-show");if(haveSpan[0]){haveSpan.remove()}elemHeader[2].appendChild(span);lay(ul).find("ol").each(function(i){var ol=this;lay(ol).find("li").on("click",function(){var value=this.innerHTML|0;if(lay(this).hasClass(DISABLED)){return}if(options.range){that[startEnd][hms[i]]=value}else{dateTime[hms[i]]=value}lay(ol).find("."+THIS).removeClass(THIS);lay(this).addClass(THIS);setTimeStatus();scroll();(that.endDate||options.type==="time")&&that.done(null,"change");that.setBtnStatus()})})}return that};Class.prototype.listYM=[];Class.prototype.closeList=function(){var that=this,options=that.config;lay.each(that.elemCont,function(index,item){lay(this).find("."+ELEM_LIST).remove();lay(that.elemMain[index]).removeClass("laydate-ym-show laydate-time-show")});lay(that.elem).find("."+ELEM_TIME_TEXT).remove()};Class.prototype.setBtnStatus=function(tips,start,end){var that=this,options=that.config,isOut,elemBtn=lay(that.footer).find(ELEM_CONFIRM),isAlone=options.range&&options.type!=="date"&&options.type!=="time";if(isAlone){start=start||that.startDate;end=end||that.endDate;isOut=that.newDate(start).getTime()>that.newDate(end).getTime();(that.limit(null,start)||that.limit(null,end))?elemBtn.addClass(DISABLED):elemBtn[isOut?"addClass":"removeClass"](DISABLED);if(tips&&isOut){that.hint(typeof tips==="string"?TIPS_OUT.replace(/日期/g,tips):TIPS_OUT)}}};Class.prototype.parse=function(state,date){var that=this,options=that.config,dateTime=date||(state?lay.extend({},that.endDate,that.endTime):(options.range?lay.extend({},that.startDate,that.startTime):options.dateTime)),format=that.format.concat();lay.each(format,function(i,item){if(/yyyy|y/.test(item)){format[i]=lay.digit(dateTime.year,item.length)}else{if(/MM|M/.test(item)){format[i]=lay.digit(dateTime.month+1,item.length)}else{if(/dd|d/.test(item)){format[i]=lay.digit(dateTime.date,item.length)}else{if(/HH|H/.test(item)){format[i]=lay.digit(dateTime.hours,item.length)}else{if(/mm|m/.test(item)){format[i]=lay.digit(dateTime.minutes,item.length)}else{if(/ss|s/.test(item)){format[i]=lay.digit(dateTime.seconds,item.length)}}}}}}});if(options.range&&!state){return format.join("")+" "+options.range+" "+that.parse(1)}return format.join("")};Class.prototype.newDate=function(dateTime){dateTime=dateTime||{};return new Date(dateTime.year||1,dateTime.month||0,dateTime.date||1,dateTime.hours||0,dateTime.minutes||0,dateTime.seconds||0)};Class.prototype.setValue=function(value){var that=this,options=that.config,elem=that.bindElem||options.elem[0],valType=that.isInput(elem)?"val":"html";options.position==="static"||lay(elem)[valType](value||"");return this};Class.prototype.stampRange=function(){var that=this,options=that.config,startTime,endTime,tds=lay(that.elem).find("td");if(options.range&&!that.endDate){lay(that.footer).find(ELEM_CONFIRM).addClass(DISABLED)}if(!that.endDate){return}startTime=that.newDate({year:that.startDate.year,month:that.startDate.month,date:that.startDate.date}).getTime();endTime=that.newDate({year:that.endDate.year,month:that.endDate.month,date:that.endDate.date}).getTime();if(startTime>endTime){return that.hint(TIPS_OUT)}lay.each(tds,function(i,item){var ymd=lay(item).attr("lay-ymd").split("-"),thisTime=that.newDate({year:ymd[0],month:ymd[1]-1,date:ymd[2]}).getTime();lay(item).removeClass(ELEM_SELECTED+" "+THIS);if(thisTime===startTime||thisTime===endTime){lay(item).addClass(lay(item).hasClass(ELEM_PREV)||lay(item).hasClass(ELEM_NEXT)?ELEM_SELECTED:THIS)}if(thisTime>startTime&&thisTime