diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/laydate.css b/ruoyi-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/laydate.css index fd9026acc..1e90e92d3 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/laydate.css +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/layui/css/modules/laydate/default/laydate.css @@ -1,2 +1,2 @@ -/*! laydate-v5.3.1 日期与时间组件 MIT License http://www.layui.com/laydate/ By 贤心 */ -.laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}@font-face{font-family:laydate-icon;src:url(font/iconfont.eot);src:url(font/iconfont.eot#iefix) format('embedded-opentype'),url(font/iconfont.svg#iconfont) format('svg'),url(font/iconfont.woff) format('woff'),url(font/iconfont.ttf) format('truetype')}.laydate-icon{font-family:laydate-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;animation-name:laydate-downbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@keyframes laydate-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;padding:0 5px;color:#999;font-size:18px;cursor:pointer}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-set-ym span{padding:0 10px;cursor:pointer}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px}.layui-laydate-footer span{display:inline-block;vertical-align:top;height:26px;line-height:24px;padding:0 10px;border:1px solid #C9C9C9;border-radius:2px;background-color:#fff;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .3s}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-footer span:hover{color:#5FB878}.layui-laydate-footer span.layui-laydate-preview{cursor:default;border-color:transparent!important}.layui-laydate-footer span.layui-laydate-preview:hover{color:#666}.layui-laydate-footer span:first-child.layui-laydate-preview{padding-left:0}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{margin:0 0 0 -1px}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;height:30px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content,.layui-laydate-range .laydate-main-list-1 .layui-laydate-header{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#B5FFF8}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eee;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} \ No newline at end of file +/*! laydate 日期与时间组件 */ +@font-face{font-family:'laydate-icon';src:url('./font/iconfont.eot');src:url('./font/iconfont.eot#iefix') format('embedded-opentype'),url('./font/iconfont.svg#iconfont') format('svg'),url('./font/iconfont.woff') format('woff'),url('./font/iconfont.ttf') format('truetype')}.laydate-icon{font-family:"laydate-icon"!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate,.layui-laydate *{box-sizing:border-box}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-laydate-main{width:272px}.layui-laydate-header *,.layui-laydate-content td,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@keyframes laydate-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-laydate{animation-name:laydate-downbit}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-prev-m,.laydate-ym-show .laydate-next-m{display:none!important}.laydate-ym-show .laydate-prev-y,.laydate-ym-show .laydate-next-y{display:inline-block!important}.laydate-ym-show .laydate-set-ym span[lay-type="month"]{display:none!important}.laydate-time-show .layui-laydate-header .layui-icon,.laydate-time-show .laydate-set-ym span[lay-type="year"],.laydate-time-show .laydate-set-ym span[lay-type="month"]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;padding:0 5px;color:#999;font-size:18px;cursor:pointer}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-set-ym span{padding:0 10px;cursor:pointer}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content th,.layui-laydate-content td{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content th{font-weight:400}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.laydate-day-holidays:before{position:absolute;left:0;top:0;font-size:12px;transform:scale(.7)}.laydate-day-holidays:before{content:'\4F11';color:#ff5722}.laydate-day-holidays[type="work"]:before{content:'\73ED';color:inherit}.layui-laydate .layui-this .laydate-day-holidays:before{color:#fff}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px}.layui-laydate-footer span{display:inline-block;vertical-align:top;height:26px;line-height:24px;padding:0 10px;border:1px solid #c9c9c9;border-radius:2px;background-color:#fff;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .3s}.layui-laydate-footer span:hover{color:#5fb878}.layui-laydate-footer span.layui-laydate-preview{cursor:default;border-color:transparent!important}.layui-laydate-footer span.layui-laydate-preview:hover{color:#666}.layui-laydate-footer span:first-child.layui-laydate-preview{padding-left:0}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{margin:0 0 0 -1px}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;box-sizing:border-box;background-color:#fff}.layui-laydate-list>li{position:relative;display:inline-block;width:33.3%;height:36px;line-height:36px;margin:3px 0;vertical-align:middle;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;height:30px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px;color:#ff5722}.layui-laydate-range{width:546px}.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-range .laydate-main-list-1 .layui-laydate-header,.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5fb878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#b5fff8}.laydate-selected:hover{background-color:#00f7de!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eee;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0}.layui-laydate-content .laydate-day-prev,.layui-laydate-content .laydate-day-next{color:#d2d2d2}.laydate-selected.laydate-day-prev,.laydate-selected.laydate-day-next{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#ff5722}.laydate-day-mark::after{background-color:#5fb878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type="date"]{color:#5fb878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:none!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:0}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:0;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:0;border-bottom:0}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .laydate-month-list>li{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-prev,.laydate-theme-grid .laydate-selected.laydate-day-next{color:#d2d2d2!important}.laydate-theme-grid .laydate-year-list,.laydate-theme-grid .laydate-month-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .laydate-month-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/layui/layui.min.js b/ruoyi-admin/src/main/resources/static/ajax/libs/layui/layui.min.js index 6cc941b5f..2ca390f2a 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/layui/layui.min.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/layui/layui.min.js @@ -1,2 +1,2 @@ -/** layui-v2.6.8 MIT License By https://www.layui.com */ -!function(win){var doc=win.document,config={modules:{},status:{},timeout:10,event:{}},Layui=function(){this.v="2.6.8"},GLOBAL=win.LAYUI_GLOBAL||{},getPath=function(){var jsPath=doc.currentScript?doc.currentScript.src:function(){var js=doc.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 config.dir=GLOBAL.dir||jsPath.substring(0,jsPath.lastIndexOf("/")+1)}(),error=function(msg,type){type=type||"log";win.console&&console[type]&&console[type]("layui error hint: "+msg)},isOpera=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",modules=config.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",all:"all","layui.all":"layui.all"};Layui.prototype.cache=config;Layui.prototype.define=function(deps,factory){var that=this,type=typeof deps==="function",callback=function(){var setApp=function(app,exports){layui[app]=exports;config.status[app]=true};typeof factory==="function"&&factory(function(app,exports){setApp(app,exports);config.callback[app]=function(){factory(setApp)}});return this};type&&(factory=deps,deps=[]);that.use(deps,callback,null,"define");return that};Layui.prototype.use=function(apps,callback,exports,from){var that=this,dir=config.dir=config.dir?config.dir:getPath,head=doc.getElementsByTagName("head")[0];apps=function(){if(typeof apps==="string"){return[apps]}else{if(typeof apps==="function"){callback=apps;return["all"]}}return apps}();if(win.jQuery&&jQuery.fn.on){that.each(apps,function(index,item){if(item==="jquery"){apps.splice(index,1)}});layui.jquery=layui.$=jQuery}var item=apps[0],timeout=0;exports=exports||[];config.host=config.host||(dir.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0];function onScriptLoad(e,url){var readyRegExp=navigator.platform==="PLaySTATION 3"?/^complete$/:/^(complete|loaded)$/;if(e.type==="load"||(readyRegExp.test((e.currentTarget||e.srcElement).readyState))){config.modules[item]=url;head.removeChild(node);(function poll(){if(++timeout>config.timeout*1000/4){return error(item+" is not a valid module","error")}config.status[item]?onCallback():setTimeout(poll,4)}())}}function onCallback(){exports.push(layui[item]);apps.length>1?that.use(apps.slice(1),callback,exports,from):(typeof callback==="function"&&function(){if(layui.jquery&&typeof layui.jquery==="function"&&from!=="define"){return layui.jquery(function(){callback.apply(layui,exports)})}callback.apply(layui,exports)}())}if(apps.length===0||(layui["layui.all"]&&modules[item])){return onCallback(),that}var url=(modules[item]?(dir+"modules/"):(/^\{\/\}/.test(that.modules[item])?"":(config.base||"")))+(that.modules[item]||item)+".js";url=url.replace(/^\{\/\}/,"");if(!config.modules[item]&&layui[item]){config.modules[item]=url}if(!config.modules[item]){var node=doc.createElement("script");node.async=true;node.charset="utf-8";node.src=url+function(){var version=config.version===true?(config.v||(new Date()).getTime()):(config.version||"");return version?("?v="+version):""}();head.appendChild(node);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){node.attachEvent("onreadystatechange",function(e){onScriptLoad(e,url)})}else{node.addEventListener("load",function(e){onScriptLoad(e,url)},false)}config.modules[item]=url}else{(function poll(){if(++timeout>config.timeout*1000/4){return error(item+" is not a valid module","error")}(typeof config.modules[item]==="string"&&config.status[item])?onCallback():setTimeout(poll,4)}())}return that};Layui.prototype.getStyle=function(node,name){var style=node.currentStyle?node.currentStyle:win.getComputedStyle(node,null);return style[style.getPropertyValue?"getPropertyValue":"getAttribute"](name)};Layui.prototype.link=function(href,fn,cssname){var that=this,head=doc.getElementsByTagName("head")[0],link=doc.createElement("link");if(typeof fn==="string"){cssname=fn}var app=(cssname||href).replace(/\.|\//g,""),id=link.id="layuicss-"+app,STAUTS_NAME="creating",timeout=0;link.rel="stylesheet";link.href=href+(config.debug?"?v="+new Date().getTime():"");link.media="all";if(!doc.getElementById(id)){head.appendChild(link)}if(typeof fn!=="function"){return that}(function poll(status){var delay=100,getLinkElem=doc.getElementById(id);if(++timeout>config.timeout*1000/delay){return error(href+" timeout")}if(parseInt(that.getStyle(getLinkElem,"width"))===1989){if(status===STAUTS_NAME){getLinkElem.removeAttribute("lay-status")}getLinkElem.getAttribute("lay-status")===STAUTS_NAME?setTimeout(poll,delay):fn()}else{getLinkElem.setAttribute("lay-status",STAUTS_NAME);setTimeout(function(){poll(STAUTS_NAME)},delay)}}());return that};Layui.prototype.addcss=function(firename,fn,cssname){return layui.link(config.dir+"css/"+firename,fn,cssname)};config.callback={};Layui.prototype.factory=function(modName){if(layui[modName]){return typeof config.callback[modName]==="function"?config.callback[modName]:null}};Layui.prototype.img=function(url,callback,error){var img=new Image();img.src=url;if(img.complete){return callback(img)}img.onload=function(){img.onload=null;typeof callback==="function"&&callback(img)};img.onerror=function(e){img.onerror=null;typeof error==="function"&&error(e)}};Layui.prototype.config=function(options){options=options||{};for(var key in options){config[key]=options[key]}return this};Layui.prototype.modules=function(){var clone={};for(var o in modules){clone[o]=modules[o]}return clone}();Layui.prototype.extend=function(options){var that=this;options=options||{};for(var o in options){if(that[o]||that.modules[o]){error(o+" Module already exists","error")}else{that.modules[o]=options[o]}}return that};Layui.prototype.router=function(hash){var that=this,hash=hash||location.hash,data={path:[],search:{},hash:(hash.match(/[^#](#.*$)/)||[])[1]||""};if(!/^#\//.test(hash)){return data}hash=hash.replace(/^#\//,"");data.href="/"+hash;hash=hash.replace(/([^#])(#.*$)/,"$1").split("/")||[];that.each(hash,function(index,item){/^\w+=/.test(item)?function(){item=item.split("=");data.search[item[0]]=item[1]}():data.path.push(item)});return data};Layui.prototype.url=function(href){var that=this,data={pathname:function(){var pathname=href?function(){var str=(href.match(/\.[^.]+?\/.+/)||[])[0]||"";return str.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return pathname.replace(/^\//,"").split("/")}(),search:function(){var obj={},search=(href?function(){var str=(href.match(/\?.+/)||[])[0]||"";return str.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");that.each(search,function(index,item){var _index=item.indexOf("="),key=function(){if(_index<0){return item.substr(0,item.length)}else{if(_index===0){return false}else{return item.substr(0,_index)}}}();if(key){obj[key]=_index>0?item.substr(_index+1):null}});return obj}(),hash:that.router(function(){return href?((href.match(/#.+/)||[])[0]||"/"):location.hash}())};return data};Layui.prototype.data=function(table,settings,storage){table=table||"layui";storage=storage||localStorage;if(!win.JSON||!win.JSON.parse){return}if(settings===null){return delete storage[table]}settings=typeof settings==="object"?settings:{key:settings};try{var data=JSON.parse(storage[table])}catch(e){var data={}}if("value" in settings){data[settings.key]=settings.value}if(settings.remove){delete data[settings.key]}storage[table]=JSON.stringify(data);return settings.key?data[settings.key]:data};Layui.prototype.sessionData=function(table,settings){return this.data(table,settings,sessionStorage)};Layui.prototype.device=function(key){var agent=navigator.userAgent.toLowerCase(),getVersion=function(label){var exp=new RegExp(label+"/([^\\s\\_\\-]+)");label=(agent.match(exp)||[])[1];return label||false},result={os:function(){if(/windows/.test(agent)){return"windows"}else{if(/linux/.test(agent)){return"linux"}else{if(/iphone|ipod|ipad|ios/.test(agent)){return"ios"}else{if(/mac/.test(agent)){return"mac"}}}}}(),ie:function(){return(!!win.ActiveXObject||"ActiveXObject" in win)?((agent.match(/msie\s(\d+)/)||[])[1]||"11"):false}(),weixin:getVersion("micromessenger")};if(key&&!result[key]){result[key]=getVersion(key)}result.android=/android/.test(agent);result.ios=result.os==="ios";result.mobile=(result.android||result.ios)?true:false;return result};Layui.prototype.hint=function(){return{error:error}};Layui.prototype._typeof=function(operand){if(operand===null){return String(operand)}return(typeof operand==="object"||typeof operand==="function")?function(){var type=Object.prototype.toString.call(operand).match(/\s(.+)\]$/)||[],classType="Function|Array|Date|RegExp|Object|Error|Symbol";type=type[1]||"Object";return new RegExp("\\b("+classType+")\\b").test(type)?type.toLowerCase():"object"}():typeof operand};Layui.prototype._isArray=function(obj){var that=this,len,type=that._typeof(obj);if(!obj||(typeof obj!=="object")||obj===win){return false}len="length" in obj&&obj.length;return type==="array"||len===0||(typeof len==="number"&&len>0&&(len-1) in obj)};Layui.prototype.each=function(obj,fn){var key,that=this,callFn=function(key,obj){return fn.call(obj[key],key,obj[key])};if(typeof fn!=="function"){return that}obj=obj||[];if(that._isArray(obj)){for(key=0;keyv2){return 1}else{if(v10;i--){if(js[i].readyState==="interactive"){src=js[i].src;break}}return src||js[last].src}();return config.dir=GLOBAL.dir||jsPath.substring(0,jsPath.lastIndexOf("/")+1)}(),error=function(msg,type){type=type||"log";win.console&&console[type]&&console[type]("layui error hint: "+msg)},isOpera=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",modules=config.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",all:"all","layui.all":"layui.all"};Layui.prototype.cache=config;Layui.prototype.define=function(deps,factory){var that=this,type=typeof deps==="function",callback=function(){var setApp=function(app,exports){layui[app]=exports;config.status[app]=true};typeof factory==="function"&&factory(function(app,exports){setApp(app,exports);config.callback[app]=function(){factory(setApp)}});return this};type&&(factory=deps,deps=[]);that.use(deps,callback,null,"define");return that};Layui.prototype.use=function(apps,callback,exports,from){var that=this,dir=config.dir=config.dir?config.dir:getPath,head=doc.getElementsByTagName("head")[0];apps=function(){if(typeof apps==="string"){return[apps]}else{if(typeof apps==="function"){callback=apps;return["all"]}}return apps}();if(win.jQuery&&jQuery.fn.on){that.each(apps,function(index,item){if(item==="jquery"){apps.splice(index,1)}});layui.jquery=layui.$=jQuery}var item=apps[0],timeout=0;exports=exports||[];config.host=config.host||(dir.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0];function onScriptLoad(e,url){var readyRegExp=navigator.platform==="PLaySTATION 3"?/^complete$/:/^(complete|loaded)$/;if(e.type==="load"||(readyRegExp.test((e.currentTarget||e.srcElement).readyState))){config.modules[item]=url;head.removeChild(node);(function poll(){if(++timeout>config.timeout*1000/4){return error(item+" is not a valid module","error")}config.status[item]?onCallback():setTimeout(poll,4)}())}}function onCallback(){exports.push(layui[item]);apps.length>1?that.use(apps.slice(1),callback,exports,from):(typeof callback==="function"&&function(){if(layui.jquery&&typeof layui.jquery==="function"&&from!=="define"){return layui.jquery(function(){callback.apply(layui,exports)})}callback.apply(layui,exports)}())}if(apps.length===0||(layui["layui.all"]&&modules[item])){return onCallback(),that}var url=(modules[item]?(dir+"modules/"):(/^\{\/\}/.test(that.modules[item])?"":(config.base||"")))+(that.modules[item]||item)+".js";url=url.replace(/^\{\/\}/,"");if(!config.modules[item]&&layui[item]){config.modules[item]=url}if(!config.modules[item]){var node=doc.createElement("script");node.async=true;node.charset="utf-8";node.src=url+function(){var version=config.version===true?(config.v||(new Date()).getTime()):(config.version||"");return version?("?v="+version):""}();head.appendChild(node);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){node.attachEvent("onreadystatechange",function(e){onScriptLoad(e,url)})}else{node.addEventListener("load",function(e){onScriptLoad(e,url)},false)}config.modules[item]=url}else{(function poll(){if(++timeout>config.timeout*1000/4){return error(item+" is not a valid module","error")}(typeof config.modules[item]==="string"&&config.status[item])?onCallback():setTimeout(poll,4)}())}return that};Layui.prototype.disuse=function(apps){var that=this;apps=that.isArray(apps)?apps:[apps];that.each(apps,function(index,item){if(!config.status[item]){}delete that[item];delete modules[item];delete that.modules[item];delete config.status[item];delete config.modules[item]});return that};Layui.prototype.getStyle=function(node,name){var style=node.currentStyle?node.currentStyle:win.getComputedStyle(node,null);return style[style.getPropertyValue?"getPropertyValue":"getAttribute"](name)};Layui.prototype.link=function(href,fn,cssname){var that=this,head=doc.getElementsByTagName("head")[0],link=doc.createElement("link");if(typeof fn==="string"){cssname=fn}var app=(cssname||href).replace(/\.|\//g,""),id=link.id="layuicss-"+app,STAUTS_NAME="creating",timeout=0;link.rel="stylesheet";link.href=href+(config.debug?"?v="+new Date().getTime():"");link.media="all";if(!doc.getElementById(id)){head.appendChild(link)}if(typeof fn!=="function"){return that}(function poll(status){var delay=100,getLinkElem=doc.getElementById(id);if(++timeout>config.timeout*1000/delay){return error(href+" timeout")}if(parseInt(that.getStyle(getLinkElem,"width"))===1989){if(status===STAUTS_NAME){getLinkElem.removeAttribute("lay-status")}getLinkElem.getAttribute("lay-status")===STAUTS_NAME?setTimeout(poll,delay):fn()}else{getLinkElem.setAttribute("lay-status",STAUTS_NAME);setTimeout(function(){poll(STAUTS_NAME)},delay)}}());return that};Layui.prototype.addcss=function(firename,fn,cssname){return layui.link(config.dir+"css/"+firename,fn,cssname)};config.callback={};Layui.prototype.factory=function(modName){if(layui[modName]){return typeof config.callback[modName]==="function"?config.callback[modName]:null}};Layui.prototype.img=function(url,callback,error){var img=new Image();img.src=url;if(img.complete){return callback(img)}img.onload=function(){img.onload=null;typeof callback==="function"&&callback(img)};img.onerror=function(e){img.onerror=null;typeof error==="function"&&error(e)}};Layui.prototype.config=function(options){options=options||{};for(var key in options){config[key]=options[key]}return this};Layui.prototype.modules=function(){var clone={};for(var o in modules){clone[o]=modules[o]}return clone}();Layui.prototype.extend=function(options){var that=this;options=options||{};for(var o in options){if(that[o]||that.modules[o]){error(o+" Module already exists","error")}else{that.modules[o]=options[o]}}return that};Layui.prototype.router=Layui.prototype.hash=function(hash){var that=this,hash=hash||location.hash,data={path:[],search:{},hash:(hash.match(/[^#](#.*$)/)||[])[1]||""};if(!/^#\//.test(hash)){return data}hash=hash.replace(/^#\//,"");data.href="/"+hash;hash=hash.replace(/([^#])(#.*$)/,"$1").split("/")||[];that.each(hash,function(index,item){/^\w+=/.test(item)?function(){item=item.split("=");data.search[item[0]]=item[1]}():data.path.push(item)});return data};Layui.prototype.url=function(href){var that=this,data={pathname:function(){var pathname=href?function(){var str=(href.match(/\.[^.]+?\/.+/)||[])[0]||"";return str.replace(/^[^\/]+/,"").replace(/\?.+/,"")}():location.pathname;return pathname.replace(/^\//,"").split("/")}(),search:function(){var obj={},search=(href?function(){var str=(href.match(/\?.+/)||[])[0]||"";return str.replace(/\#.+/,"")}():location.search).replace(/^\?+/,"").split("&");that.each(search,function(index,item){var _index=item.indexOf("="),key=function(){if(_index<0){return item.substr(0,item.length)}else{if(_index===0){return false}else{return item.substr(0,_index)}}}();if(key){obj[key]=_index>0?item.substr(_index+1):null}});return obj}(),hash:that.router(function(){return href?((href.match(/#.+/)||[])[0]||"/"):location.hash}())};return data};Layui.prototype.data=function(table,settings,storage){table=table||"layui";storage=storage||localStorage;if(!win.JSON||!win.JSON.parse){return}if(settings===null){return delete storage[table]}settings=typeof settings==="object"?settings:{key:settings};try{var data=JSON.parse(storage[table])}catch(e){var data={}}if("value" in settings){data[settings.key]=settings.value}if(settings.remove){delete data[settings.key]}storage[table]=JSON.stringify(data);return settings.key?data[settings.key]:data};Layui.prototype.sessionData=function(table,settings){return this.data(table,settings,sessionStorage)};Layui.prototype.device=function(key){var agent=navigator.userAgent.toLowerCase(),getVersion=function(label){var exp=new RegExp(label+"/([^\\s\\_\\-]+)");label=(agent.match(exp)||[])[1];return label||false},result={os:function(){if(/windows/.test(agent)){return"windows"}else{if(/linux/.test(agent)){return"linux"}else{if(/iphone|ipod|ipad|ios/.test(agent)){return"ios"}else{if(/mac/.test(agent)){return"mac"}}}}}(),ie:function(){return(!!win.ActiveXObject||"ActiveXObject" in win)?((agent.match(/msie\s(\d+)/)||[])[1]||"11"):false}(),weixin:getVersion("micromessenger")};if(key&&!result[key]){result[key]=getVersion(key)}result.android=/android/.test(agent);result.ios=result.os==="ios";result.mobile=(result.android||result.ios)?true:false;return result};Layui.prototype.hint=function(){return{error:error}};Layui.prototype._typeof=Layui.prototype.type=function(operand){if(operand===null){return String(operand)}return(typeof operand==="object"||typeof operand==="function")?function(){var type=Object.prototype.toString.call(operand).match(/\s(.+)\]$/)||[],classType="Function|Array|Date|RegExp|Object|Error|Symbol";type=type[1]||"Object";return new RegExp("\\b("+classType+")\\b").test(type)?type.toLowerCase():"object"}():typeof operand};Layui.prototype._isArray=Layui.prototype.isArray=function(obj){var that=this,len,type=that.type(obj);if(!obj||(typeof obj!=="object")||obj===win){return false}len="length" in obj&&obj.length;return type==="array"||len===0||(typeof len==="number"&&len>0&&(len-1) in obj)};Layui.prototype.each=function(obj,fn){var key,that=this,callFn=function(key,obj){return fn.call(obj[key],key,obj[key])};if(typeof fn!=="function"){return that}obj=obj||[];if(that.isArray(obj)){for(key=0;keyv2){return 1}else{if(v1(window.innerHeight||document.documentElement.clientHeight)};lay.position=function(elem,elemView,obj){if(!elemView){return}obj=obj||{};if(elem===document||elem===lay("body")[0]){obj.clickType="right"}var rect=obj.clickType==="right"?function(){var e=obj.e||window.event||{};return{left:e.clientX,top:e.clientY,right:e.clientX,bottom:e.clientY}}():elem.getBoundingClientRect(),elemWidth=elemView.offsetWidth,elemHeight=elemView.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()){if(rect.top>elemHeight+margin){top=rect.top-elemHeight-margin*2}else{if(obj.clickType==="right"){top=winArea()-elemHeight-margin*2;if(top<0){top=0}}}}var position=obj.position;if(position){elemView.style.position=position}elemView.style.left=left+(position==="fixed"?0:scrollArea(1))+"px";elemView.style.top=top+(position==="fixed"?0:scrollArea())+"px";if(!lay.hasScrollbar()){var rect1=elemView.getBoundingClientRect();if(!obj.SYSTEM_RELOAD&&(rect1.bottom+margin)>winArea()){obj.SYSTEM_RELOAD=true;setTimeout(function(){lay.position(elem,elemView,obj)},50)}}};lay.options=function(elem,attr){var othis=lay(elem),attrName=attr||"lay-options";try{return new Function("return "+(othis.attr(attrName)||"{}"))()}catch(ev){hint.error("parseerror:"+ev,"error");return{}}};lay.isTopElem=function(elem){var topElems=[document,lay("body")[0]],matched=false;lay.each(topElems,function(index,item){if(item===elem){return matched=true}});return matched};LAY.addStr=function(str,new_str){str=str.replace(/\s+/," ");new_str=new_str.replace(/\s+/," ").split(" ");lay.each(new_str,function(ii,item){if(!new RegExp("\\b"+item+"\\b").test(str)){str=str+" "+item}});return str.replace(/^\s|\s$/,"")};LAY.removeStr=function(str,new_str){str=str.replace(/\s+/," ");new_str=new_str.replace(/\s+/," ").split(" ");lay.each(new_str,function(ii,item){var exp=new RegExp("\\b"+item+"\\b");if(exp.test(str)){str=str.replace(exp,"")}});return str.replace(/\s+/," ").replace(/^\s|\s$/,"")};LAY.prototype.find=function(selector){var that=this;var index=0,arr=[],isObject=typeof selector==="object";this.each(function(i,item){var nativeDOM=isObject?item.contains(selector):item.querySelectorAll(selector||null);for(;index0){return that[0].style[key]}}():that.each(function(index,item){typeof key==="object"?lay.each(key,function(thisKey,thisValue){item.style[thisKey]=parseValue(thisValue)}):item.style[key]=parseValue(value)})};LAY.prototype.width=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].offsetWidth}}():that.each(function(index,item){that.css("width",value)})};LAY.prototype.height=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].offsetHeight}}():that.each(function(index,item){that.css("height",value)})};LAY.prototype.attr=function(key,value){var that=this;return value===undefined?function(){if(that.length>0){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){var that=this;return html===undefined?function(){if(that.length>0){return that[0].innerHTML}}():this.each(function(index,item){item.innerHTML=html})};LAY.prototype.val=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].value}}():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)})};window.lay=lay;if(window.layui&&layui.define){layui.define(function(exports){exports(MOD_NAME,lay)})}}(window,window.document);!function(window,document){var isLayui=window.layui&&layui.define,ready={getPath:(window.lay&&lay.getPath)?lay.getPath:"",link:function(href,fn,cssname){if(!laydate.path){return}if(window.lay&&lay.layui){lay.layui.link(laydate.path+href,fn,cssname)}}},GLOBAL=window.LAYUI_GLOBAL||{},laydate={v:"5.3.1",config:{},index:(window.laydate&&window.laydate.v)?100000:0,path:GLOBAL.laydate_dir||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}},thisModule=function(){var that=this,options=that.config,id=options.id;thisModule.that[id]=that;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",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",ELEM_PREVIEW="layui-laydate-preview",Class=function(options){var that=this;that.index=++laydate.index;that.config=lay.extend({},that.config,laydate.config,options);options=that.config;options.id=("id" in options)?options.id:that.index;laydate.ready(function(){that.init()})},dateType="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s";thisModule.formatArr=function(format){return(format||"").match(new RegExp(dateType+"|.","g"))||[]};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,isInitValue:true,min:"1900-1-1",max:"2099-12-31",trigger:"click",show:false,showBottom:true,isPreview: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:"现在"},timeout:"结束时间不能早于开始时间
请重新选择",invalidDate:"不在有效日期或时间范围内",formatError:["日期格式不合法
必须遵循下述格式:
","
已为你重置"],preview:"当前选中的结果"},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"},timeout:"End time cannot be less than start Time
Please re-select",invalidDate:"Invalid date",formatError:["The date format error
Must be followed:
","
It has been reset"],preview:"The selected result"}};return text[options.lang]||text["cn"]};Class.prototype.init=function(){var that=this,options=that.config,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}that.rangeStr=options.range?(typeof options.range==="string"?options.range:"-"):"";if(options.range&&options.range.constructor===Array){that.rangeElem=[lay(options.range[0]),lay(options.range[1])]}if(!format[options.type]){window.console&&console.error&&console.error("laydate type error:'"+options.type+"' is not supported");options.type="date"}if(options.format===format.date){options.format=format[options.type]||format.date}that.format=thisModule.formatArr(options.format);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_ONE=new RegExp("^"+that.EXP_IF+"$");that.EXP_IF=new RegExp("^"+(options.range?that.EXP_IF+"\\s\\"+that.rangeStr+"\\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+"")}if(!(!options.range&&options.type==="datetime")){html.push('')}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)}laydate.thisId=options.id;that.remove(Class.thisElemDate);isStatic?options.elem.append(elem):(document.body.appendChild(elem),that.position());that.checkDate().calendar(null,0,"init");that.changeEvent();Class.thisElemDate=that.elemID;typeof options.ready==="function"&&options.ready(lay.extend({},options.dateTime,{month:options.dateTime.month+1}));that.preview()};Class.prototype.remove=function(prev){var that=this,options=that.config,elem=lay("#"+(prev||that.elemID));if(!elem[0]){return that}if(!elem.hasClass(ELEM_STATIC)){that.checkDate(function(){elem.remove()})}return that};Class.prototype.position=function(){var that=this,options=that.config;lay.position(that.bindElem||options.elem[0],that.elem,{position:options.position});return that};Class.prototype.hint=function(content){var that=this,options=that.config,div=lay.elem("div",{"class":ELEM_HINT});if(!that.elem){return}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,lang=that.lang(),dateTime=options.dateTime=options.dateTime||that.systemDate(),thisMaxDate,error,elem=that.bindElem||options.elem[0],valType=that.isInput(elem)?"val":"html",value=function(){if(that.rangeElem){var vals=[that.rangeElem[0].val(),that.rangeElem[1].val()];if(vals[0]&&vals[1]){return vals.join(" "+that.rangeStr+" ")}}return that.isInput(elem)?elem.value:(options.position==="static"?"":lay(elem).attr("lay-date"))}(),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].lengthgetDateTime(options.max)||getDateTime(dateTime)getDateTime(options.max)){that.endDate=lay.extend({},options.max)}}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.thisDateTime=function(index){var that=this,options=that.config;return index?that.endDate:options.dateTime};Class.prototype.calendar=function(value,index,type){var that=this,options=that.config,index=index?1:0,dateTime=value||that.thisDateTime(index),thisDate=new Date(),startWeek,prevMaxDate,thisMaxDate,lang=that.lang(),isAlone=options.type!=="date"&&options.type!=="datetime",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(lang.invalidDate)}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]=startEnd==="startTime"?dateTime:that.endDate}}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;that.limit(lay(that.footer).find(ELEM_CONFIRM),null,0)}else{that.endDate[type]=ym}var isYearOrMonth=options.type==="year"||options.type==="month";if(isYearOrMonth){lay(ul).find("."+THIS).removeClass(THIS);lay(this).addClass(THIS);if(options.type==="month"&&type==="year"){that.listYM[index][0]=ym;isAlone&&((index?that.endDate:dateTime).year=ym);that.list("month",index)}}else{that.checkDate("limit").calendar(null,index);that.closeList()}that.setBtnStatus();if(!options.range){if((options.type==="month"&&type==="month")||(options.type==="year"&&type==="year")){that.setValue(that.parse()).remove().done()}}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,lang=that.lang(),isOut,elemBtn=lay(that.footer).find(ELEM_CONFIRM);if(options.range&&options.type!=="time"){start=start||options.dateTime;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"?lang.timeout.replace(/日期/g,tips):lang.timeout)}}};Class.prototype.parse=function(state,date){var that=this,options=that.config,dateTime=date||(state=="end"?lay.extend({},that.endDate,that.endTime):(options.range?lay.extend({},options.dateTime,that.startTime):options.dateTime)),format=laydate.parse(dateTime,that.format,1);if(options.range&&state===undefined){return format+" "+that.rangeStr+" "+that.parse("end")}return format};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];if(options.position==="static"){return that}value=value||"";if(that.isInput(elem)){lay(elem).val(value)}else{if(that.rangeElem){that.rangeElem[0].val(value?that.parse("start"):"");that.rangeElem[1].val(value?that.parse("end"):"")}else{if(lay(elem).find("*").length===0){lay(elem).html(value)}lay(elem).attr("lay-date",value)}}return that};Class.prototype.preview=function(){var that=this,options=that.config;if(!options.isPreview){return}var elemPreview=lay(that.elem).find("."+ELEM_PREVIEW),value=options.range?(that.endDate?that.parse():""):that.parse();elemPreview.html(value).css({"color":"#5FB878","font-size":"14px;"});setTimeout(function(){elemPreview.css({"color":"#666","font-size":"12px;"})},300)};Class.prototype.done=function(param,type){var that=this,options=that.config,start=lay.extend({},lay.extend(options.dateTime,that.startTime)),end=lay.extend({},lay.extend(that.endDate,that.endTime));lay.each([start,end],function(i,item){if(!("month" in item)){return}lay.extend(item,{month:item.month+1})});that.preview();param=param||[that.parse(),start,end];typeof options[type||"done"]==="function"&&options[type||"done"].apply(options,param);return that};Class.prototype.choose=function(td,index){var that=this,options=that.config,dateTime=that.thisDateTime(index),tds=lay(that.elem).find("td"),YMD=td.attr("lay-ymd").split("-");YMD={year:YMD[0]|0,month:(YMD[1]|0)-1,date:YMD[2]|0};if(td.hasClass(DISABLED)){return}lay.extend(dateTime,YMD);if(options.range){lay.each(["startTime","endTime"],function(i,item){that[item]=that[item]||{hours:0,minutes:0,seconds:0}});that.calendar(null,index).done(null,"change")}else{if(options.position==="static"){that.calendar().done().done(null,"change")}else{if(options.type==="date"){that.setValue(that.parse()).remove().done()}else{if(options.type==="datetime"){that.calendar().done(null,"change")}}}}};Class.prototype.tool=function(btn,type){var that=this,options=that.config,lang=that.lang(),dateTime=options.dateTime,isStatic=options.position==="static",active={datetime:function(){if(lay(btn).hasClass(DISABLED)){return}that.list("time",0);options.range&&that.list("time",1);lay(btn).attr("lay-type","date").html(that.lang().dateTips)},date:function(){that.closeList();lay(btn).attr("lay-type","datetime").html(that.lang().timeTips)},clear:function(){isStatic&&(lay.extend(dateTime,that.firstDate),that.calendar());options.range&&(delete options.dateTime,delete that.endDate,delete that.startTime,delete that.endTime);that.setValue("").remove();that.done(["",{},{}])},now:function(){var thisDate=new Date();lay.extend(dateTime,that.systemDate(),{hours:thisDate.getHours(),minutes:thisDate.getMinutes(),seconds:thisDate.getSeconds()});that.setValue(that.parse()).remove();isStatic&&that.calendar();that.done()},confirm:function(){if(options.range){if(lay(btn).hasClass(DISABLED)){return that.hint(options.type==="time"?lang.timeout.replace(/日期/g,"时间"):lang.timeout)}}else{if(lay(btn).hasClass(DISABLED)){return that.hint(lang.invalidDate)}}that.done();that.setValue(that.parse()).remove()}};active[type]&&active[type]()};Class.prototype.change=function(index){var that=this,options=that.config,dateTime=that.thisDateTime(index),isAlone=options.range&&(options.type==="year"||options.type==="month"),elemCont=that.elemCont[index||0],listYM=that.listYM[index],addSubYeay=function(type){var isYear=lay(elemCont).find(".laydate-year-list")[0],isMonth=lay(elemCont).find(".laydate-month-list")[0];if(isYear){listYM[0]=type?listYM[0]-15:listYM[0]+15;that.list("year",index)}if(isMonth){type?listYM[0]--:listYM[0]++;that.list("month",index)}if(isYear||isMonth){lay.extend(dateTime,{year:listYM[0]});if(isAlone){dateTime.year=listYM[0]}options.range||that.done(null,"change");options.range||that.limit(lay(that.footer).find(ELEM_CONFIRM),{year:listYM[0]})}that.setBtnStatus();return isYear||isMonth};return{prevYear:function(){if(addSubYeay("sub")){return}dateTime.year--;that.checkDate("limit").calendar(null,index);that.done(null,"change")},prevMonth:function(){var YM=that.getAsYM(dateTime.year,dateTime.month,"sub");lay.extend(dateTime,{year:YM[0],month:YM[1]});that.checkDate("limit").calendar(null,index);that.done(null,"change")},nextMonth:function(){var YM=that.getAsYM(dateTime.year,dateTime.month);lay.extend(dateTime,{year:YM[0],month:YM[1]});that.checkDate("limit").calendar(null,index);that.done(null,"change")},nextYear:function(){if(addSubYeay()){return}dateTime.year++;that.checkDate("limit").calendar(null,index);that.done(null,"change")}}};Class.prototype.changeEvent=function(){var that=this,options=that.config;lay(that.elem).on("click",function(e){lay.stope(e)}).on("mousedown",function(e){lay.stope(e)});lay.each(that.elemHeader,function(i,header){lay(header[0]).on("click",function(e){that.change(i).prevYear()});lay(header[1]).on("click",function(e){that.change(i).prevMonth()});lay(header[2]).find("span").on("click",function(e){var othis=lay(this),layYM=othis.attr("lay-ym"),layType=othis.attr("lay-type");if(!layYM){return}layYM=layYM.split("-");that.listYM[i]=[layYM[0]|0,layYM[1]|0];that.list(layType,i);lay(that.footer).find("."+ELEM_TIME_BTN).addClass(DISABLED)});lay(header[3]).on("click",function(e){that.change(i).nextMonth()});lay(header[4]).on("click",function(e){that.change(i).nextYear()})});lay.each(that.table,function(i,table){var tds=lay(table).find("td");tds.on("click",function(){that.choose(lay(this),i)})});lay(that.footer).find("span").on("click",function(){var type=lay(this).attr("lay-type");that.tool(this,type)})};Class.prototype.isInput=function(elem){return/input|textarea/.test(elem.tagName.toLocaleLowerCase())};Class.prototype.events=function(){var that=this,options=that.config,showEvent=function(elem,bind){elem.on(options.trigger,function(){bind&&(that.bindElem=this);that.render()})};if(!options.elem[0]||options.elem[0].eventHandler){return}showEvent(options.elem,"bind");showEvent(options.eventElem);options.elem[0].eventHandler=true};thisModule.that={};thisModule.getThis=function(id){var that=thisModule.that[id];if(!that){hint.error(id?(MOD_NAME+" instance with ID '"+id+"' not found"):"ID argument required")}return that};ready.run=function(lay){lay(document).on("mousedown",function(e){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}var options=that.config;if(e.target===options.elem[0]||e.target===options.eventElem[0]||e.target===lay(options.closeStop)[0]){return}that.remove()}).on("keydown",function(e){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}if(e.keyCode===13){if(lay("#"+that.elemID)[0]&&that.elemID===Class.thisElemDate){e.preventDefault();lay(that.footer).find(ELEM_CONFIRM)[0].click()}}});lay(window).on("resize",function(){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}if(!that.elem||!lay(ELEM)[0]){return false}that.position()})};laydate.render=function(options){var inst=new Class(options);return thisModule.call(inst)};laydate.parse=function(dateTime,format,one){dateTime=dateTime||{};if(typeof format==="string"){format=thisModule.formatArr(format)}format=(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+(one||0),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)}}}}}}});return format.join("")};laydate.getEndDate=function(month,year){var thisDate=new Date();thisDate.setFullYear(year||thisDate.getFullYear(),month||(thisDate.getMonth()+1),1);return new Date(thisDate.getTime()-1000*60*60*24).getDate()};isLayui?(laydate.ready(),layui.define("lay",function(exports){laydate.path=layui.cache.dir;ready.run(lay);exports(MOD_NAME,laydate)})):((typeof define==="function"&&define.amd)?define(function(){ready.run(lay);return laydate}):function(){laydate.ready();ready.run(window.lay);window.laydate=laydate}())}(window,window.document); \ No newline at end of file +/*! laydate 日期与时间组件 */ +!function(window){var MOD_NAME="lay",document=window.document,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(;index(window.innerHeight||document.documentElement.clientHeight)};lay.position=function(elem,elemView,obj){if(!elemView){return}obj=obj||{};if(elem===document||elem===lay("body")[0]){obj.clickType="right"}var rect=obj.clickType==="right"?function(){var e=obj.e||window.event||{};return{left:e.clientX,top:e.clientY,right:e.clientX,bottom:e.clientY}}():elem.getBoundingClientRect(),elemWidth=elemView.offsetWidth,elemHeight=elemView.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(obj.align==="center"){left=left-(elemWidth-elem.offsetWidth)/2}else{if(obj.align==="right"){left=left-elemWidth+elem.offsetWidth}}if(left+elemWidth+margin>winArea("width")){left=winArea("width")-elemWidth-margin}if(leftwinArea()){if(rect.top>elemHeight+margin){top=rect.top-elemHeight-margin*2}else{if(obj.clickType==="right"){top=winArea()-elemHeight-margin*2;if(top<0){top=0}}else{top=margin}}}var position=obj.position;if(position){elemView.style.position=position}elemView.style.left=left+(position==="fixed"?0:scrollArea(1))+"px";elemView.style.top=top+(position==="fixed"?0:scrollArea())+"px";if(!lay.hasScrollbar()){var rect1=elemView.getBoundingClientRect();if(!obj.SYSTEM_RELOAD&&(rect1.bottom+margin)>winArea()){obj.SYSTEM_RELOAD=true;setTimeout(function(){lay.position(elem,elemView,obj)},50)}}};lay.options=function(elem,attr){var othis=lay(elem),attrName=attr||"lay-options";try{return new Function("return "+(othis.attr(attrName)||"{}"))()}catch(ev){hint.error("parseerror:"+ev,"error");return{}}};lay.isTopElem=function(elem){var topElems=[document,lay("body")[0]],matched=false;lay.each(topElems,function(index,item){if(item===elem){return matched=true}});return matched};LAY.addStr=function(str,new_str){str=str.replace(/\s+/," ");new_str=new_str.replace(/\s+/," ").split(" ");lay.each(new_str,function(ii,item){if(!new RegExp("\\b"+item+"\\b").test(str)){str=str+" "+item}});return str.replace(/^\s|\s$/,"")};LAY.removeStr=function(str,new_str){str=str.replace(/\s+/," ");new_str=new_str.replace(/\s+/," ").split(" ");lay.each(new_str,function(ii,item){var exp=new RegExp("\\b"+item+"\\b");if(exp.test(str)){str=str.replace(exp,"")}});return str.replace(/\s+/," ").replace(/^\s|\s$/,"")};LAY.prototype.find=function(selector){var that=this;var index=0,arr=[],isObject=typeof selector==="object";this.each(function(i,item){var nativeDOM=isObject?item.contains(selector):item.querySelectorAll(selector||null);for(;index0){return that[0].style[key]}}():that.each(function(index,item){typeof key==="object"?lay.each(key,function(thisKey,thisValue){item.style[thisKey]=parseValue(thisValue)}):item.style[key]=parseValue(value)})};LAY.prototype.width=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].offsetWidth}}():that.each(function(index,item){that.css("width",value)})};LAY.prototype.height=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].offsetHeight}}():that.each(function(index,item){that.css("height",value)})};LAY.prototype.attr=function(key,value){var that=this;return value===undefined?function(){if(that.length>0){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){var that=this;return html===undefined?function(){if(that.length>0){return that[0].innerHTML}}():this.each(function(index,item){item.innerHTML=html})};LAY.prototype.val=function(value){var that=this;return value===undefined?function(){if(that.length>0){return that[0].value}}():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)})};window.lay=lay;if(window.layui&&layui.define){layui.define(function(exports){exports(MOD_NAME,lay)})}}(window,window.document);!function(window,document){var isLayui=window.layui&&layui.define,ready={getPath:(window.lay&&lay.getPath)?lay.getPath:"",link:function(href,fn,cssname){if(!laydate.path){return}if(window.lay&&lay.layui){lay.layui.link(laydate.path+href,fn,cssname)}}},GLOBAL=window.LAYUI_GLOBAL||{},laydate={v:"5.3.1",config:{weekStart:0,},index:(window.laydate&&window.laydate.v)?100000:0,path:GLOBAL.laydate_dir||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}},thisModule=function(){var that=this,options=that.config,id=options.id;thisModule.that[id]=that;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",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",ELEM_PREVIEW="layui-laydate-preview",Class=function(options){var that=this;that.index=++laydate.index;that.config=lay.extend({},that.config,laydate.config,options);var elem=lay(options.elem||that.config.elem);if(elem.length>1){layui.each(elem,function(){laydate.render(lay.extend({},that.config,{elem:this}))});return that}options=that.config;options.id=("id" in options)?options.id:that.index;laydate.ready(function(){that.init()})},dateType="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s";thisModule.formatArr=function(format){return(format||"").match(new RegExp(dateType+"|.","g"))||[]};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,isInitValue:true,min:"1900-1-1",max:"2099-12-31",trigger:"click",show:false,showBottom:true,isPreview:true,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:false,mark:{},holidays:null,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:"现在"},timeout:"结束时间不能早于开始时间
请重新选择",invalidDate:"不在有效日期或时间范围内",formatError:["日期格式不合法
必须遵循下述格式:
","
已为你重置"],preview:"当前选中的结果"},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"},timeout:"End time cannot be less than start Time
Please re-select",invalidDate:"Invalid date",formatError:["The date format error
Must be followed:
","
It has been reset"],preview:"The selected result"}};return text[options.lang]||text["cn"]};Class.prototype.init=function(){var that=this,options=that.config,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}that.rangeStr=options.range?(typeof options.range==="string"?options.range:"-"):"";if(layui.type(options.range)==="array"){that.rangeElem=[lay(options.range[0]),lay(options.range[1])]}if(!format[options.type]){window.console&&console.error&&console.error("laydate type error:'"+options.type+"' is not supported");options.type="date"}if(options.format===format.date){options.format=format[options.type]||format.date}that.format=thisModule.formatArr(options.format);if(options.weekStart){if(!/^[0-6]$/.test(options.weekStart)){var lang=that.lang();options.weekStart=lang.weeks.indexOf(options.weekStart);if(options.weekStart===-1){options.weekStart=0}}}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_ONE=new RegExp("^"+that.EXP_IF+"$");that.EXP_IF=new RegExp("^"+(options.range?that.EXP_IF+"\\s\\"+that.rangeStr+"\\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-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],tDate=new Date(),time=that.newDate({year:tDate.getFullYear(),month:tDate.getMonth(),date:tDate.getDate(),hours:i?23:0,minutes:i?59:0,seconds:i?59:0}).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+options.weekStart)%7];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+"")}if(!(!options.range&&options.type==="datetime")){html.push('')}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);laydate.thisId=options.id;isStatic?options.elem.append(elem):(document.body.appendChild(elem),that.position());that.checkDate().calendar(null,0,"init");that.changeEvent();Class.thisElemDate=that.elemID;typeof options.ready==="function"&&options.ready(lay.extend({},options.dateTime,{month:options.dateTime.month+1}));that.preview()};Class.prototype.remove=function(prev){var that=this,options=that.config,elem=lay("#"+(prev||that.elemID));if(!elem[0]){return that}if(!elem.hasClass(ELEM_STATIC)){that.checkDate(function(){elem.remove();delete laydate.thisId;typeof options.close==="function"&&options.close(that)})}return that};Class.prototype.position=function(){var that=this,options=that.config;lay.position(that.bindElem||options.elem[0],that.elem,{position:options.position});return that};Class.prototype.hint=function(content){var that=this,options=that.config,div=lay.elem("div",{"class":ELEM_HINT});if(!that.elem){return}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,lang=that.lang(),dateTime=options.dateTime=options.dateTime||that.systemDate(),thisMaxDate,error,elem=that.bindElem||options.elem[0],valType=that.isInput(elem)?"val":"html",value=function(){if(that.rangeElem){var vals=[that.rangeElem[0].val(),that.rangeElem[1].val()];if(vals[0]&&vals[1]){return vals.join(" "+that.rangeStr+" ")}}return that.isInput(elem)?elem.value:(options.position==="static"?"":lay(elem).attr("lay-date"))}(),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.seconds>59){dateTime.seconds=0,dateTime.minutes++,error=true}if(dateTime.minutes>59){dateTime.minutes=0,dateTime.hours++,error=true}if(dateTime.hours>23){dateTime.hours=0,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].length23){thisv=23,error=true}dateTime.hours=thisv;options.range&&(that[startEnd[index]].hours=thisv)}else{if(/mm|m/.test(item)){if(thisv<0){thisv=0,error=true}if(thisv>59){thisv=59,error=true}dateTime.minutes=thisv;options.range&&(that[startEnd[index]].minutes=thisv)}else{if(/ss|s/.test(item)){if(thisv<0){thisv=0,error=true}if(thisv>59){thisv=59,error=true}dateTime.seconds=thisv;options.range&&(that[startEnd[index]].seconds=thisv)}}}}}}});checkValid(dateTime)};if(fn==="limit"){return checkValid(dateTime),that}value=value||options.value;if(typeof value==="string"){value=value.replace(/\s+/g," ").replace(/^\s|\s$/g,"")}var getEndDate=function(){if(options.range){that.endDate=that.endDate||lay.extend({},options.dateTime,function(){var obj={},dateTime=options.dateTime,EYM=that.getAsYM(dateTime.year,dateTime.month);if(options.type==="year"){obj.year=dateTime.year+1}else{if(options.type!=="time"){obj.year=EYM[0];obj.month=EYM[1]}}if(options.type==="datetime"||options.type==="time"){obj.hours=23;obj.minutes=obj.seconds=59}return obj}())}};getEndDate();if(typeof value==="string"&&value){if(that.EXP_IF.test(value)){if(options.range){value=value.split(" "+that.rangeStr+" ");lay.each([options.dateTime,that.endDate],function(i,item){initDate(item,value[i],i)})}else{initDate(dateTime,value)}}else{that.hint(lang.formatError[0]+(options.range?(options.format+" "+that.rangeStr+" "+options.format):options.format)+lang.formatError[1]);error=true}}else{if(value&&layui.type(value)==="date"){options.dateTime=that.systemDate(value)}else{options.dateTime=that.systemDate();delete that.startTime;delete that.endDate;getEndDate();delete that.endTime}}(function(){if(that.rangeElem){var vals=[that.rangeElem[0].val(),that.rangeElem[1].val()],arrDate=[options.dateTime,that.endDate];lay.each(vals,function(_i,_v){if(that.EXP_IF_ONE.test(_v)){initDate(arrDate[_i],_v,_i)}})}})();checkValid(dateTime);if(options.range){checkValid(that.endDate)}if(error&&value){that.setValue(options.range?(that.endDate?that.parse():""):that.parse())}var minMaxError;if(that.getDateTime(dateTime)>that.getDateTime(options.max)){dateTime=options.dateTime=lay.extend({},options.max);minMaxError=true}else{if(that.getDateTime(dateTime)that.getDateTime(options.max)){that.endDate=lay.extend({},options.max);minMaxError=true}that.startTime={hours:options.dateTime.hours,minutes:options.dateTime.minutes,seconds:options.dateTime.seconds,};that.endTime={hours:that.endDate.hours,minutes:that.endDate.minutes,seconds:that.endDate.seconds,}}minMaxError&&that.setValue(that.parse()).hint("初始值"+lang.invalidDate+lang.formatError[1]);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.holidays=function(td,YMD){var that=this;var options=that.config;var type=["","work"];if(layui.type(options.holidays)!=="array"){return that}lay.each(options.holidays,function(idx,item){lay.each(item,function(i,dayStr){if(dayStr===td.attr("lay-ymd")){td.html('"+YMD[2]+"")}})});return that};Class.prototype.limit=function(elem,date,index,time){var that=this,options=that.config,timestrap={},dateTime=index>(time?0:41)?that.endDate:options.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.thisDateTime=function(index){var that=this,options=that.config;return index?that.endDate:options.dateTime};Class.prototype.calendar=function(value,index,type){var that=this,options=that.config,index=index?1:0,dateTime=value||that.thisDateTime(index),thisDate=new Date(),startWeek,prevMaxDate,thisMaxDate,lang=that.lang(),isAlone=options.type!=="date"&&options.type!=="datetime",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(lang.invalidDate)}if(!that.firstDate){that.firstDate=lay.extend({},dateTime)}thisDate.setFullYear(dateTime.year,dateTime.month,1);startWeek=(thisDate.getDay()+(7-options.weekStart))%7;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_"+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;that.limit(lay(that.footer).find(ELEM_CONFIRM),null,0)}else{that.endDate[type]=ym}var isYearOrMonth=options.type==="year"||options.type==="month";if(isYearOrMonth){lay(ul).find("."+THIS).removeClass(THIS);lay(this).addClass(THIS);if(options.type==="month"&&type==="year"){that.listYM[index][0]=ym;isAlone&&((index?that.endDate:dateTime).year=ym);that.list("month",index)}}else{that.checkDate("limit").calendar(null,index);that.closeList()}that.setBtnStatus();if(!options.range){if((options.type==="month"&&type==="month")||(options.type==="year"&&type==="year")){that.setValue(that.parse()).remove().done()}}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,lang=that.lang(),isOut,elemBtn=lay(that.footer).find(ELEM_CONFIRM);if(options.range&&options.type!=="time"){start=start||options.dateTime;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"?lang.timeout.replace(/日期/g,tips):lang.timeout)}}};Class.prototype.parse=function(state,date){var that=this,options=that.config,dateTime=date||(state=="end"?lay.extend({},that.endDate,that.endTime):(options.range?lay.extend({},options.dateTime,that.startTime):options.dateTime)),format=laydate.parse(dateTime,that.format,1);if(options.range&&state===undefined){return format+" "+that.rangeStr+" "+that.parse("end")}return format};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.getDateTime=function(obj){return this.newDate(obj).getTime()};Class.prototype.setValue=function(value){var that=this,options=that.config,elem=that.bindElem||options.elem[0];if(options.position==="static"){return that}value=value||"";if(that.isInput(elem)){lay(elem).val(value)}else{var rangeElem=that.rangeElem;if(rangeElem){if(layui.type(value)!=="array"){value=value.split(" "+that.rangeStr+" ")}rangeElem[0].val(value[0]||"");rangeElem[1].val(value[1]||"")}else{if(lay(elem).find("*").length===0){lay(elem).html(value)}lay(elem).attr("lay-date",value)}}return that};Class.prototype.preview=function(){var that=this,options=that.config;if(!options.isPreview){return}var elemPreview=lay(that.elem).find("."+ELEM_PREVIEW),value=options.range?(that.endDate?that.parse():""):that.parse();elemPreview.html(value).css({"color":"#5FB878"});setTimeout(function(){elemPreview.css({"color":"#666"})},300)};Class.prototype.done=function(param,type){var that=this,options=that.config,start=lay.extend({},lay.extend(options.dateTime,that.startTime)),end=lay.extend({},lay.extend(that.endDate,that.endTime));lay.each([start,end],function(i,item){if(!("month" in item)){return}lay.extend(item,{month:item.month+1})});that.preview();param=param||[that.parse(),start,end];typeof options[type||"done"]==="function"&&options[type||"done"].apply(options,param);return that};Class.prototype.choose=function(td,index){var that=this,options=that.config,dateTime=that.thisDateTime(index),tds=lay(that.elem).find("td"),YMD=td.attr("lay-ymd").split("-");YMD={year:YMD[0]|0,month:(YMD[1]|0)-1,date:YMD[2]|0};if(td.hasClass(DISABLED)){return}lay.extend(dateTime,YMD);if(options.range){lay.each(["startTime","endTime"],function(i,item){that[item]=that[item]||{hours:i?23:0,minutes:i?59:0,seconds:i?59:0};if(index===i){if(that.getDateTime(lay.extend({},dateTime,that[item]))that.getDateTime(options.max)){that[item]={hours:options.max.hours,minutes:options.max.minutes,seconds:options.max.seconds};lay.extend(dateTime,that[item])}}}});that.calendar(null,index).done(null,"change")}else{if(options.position==="static"){that.calendar().done().done(null,"change")}else{if(options.type==="date"){that.setValue(that.parse()).remove().done()}else{if(options.type==="datetime"){that.calendar().done(null,"change")}}}}};Class.prototype.tool=function(btn,type){var that=this,options=that.config,lang=that.lang(),dateTime=options.dateTime,isStatic=options.position==="static",active={datetime:function(){if(lay(btn).hasClass(DISABLED)){return}that.list("time",0);options.range&&that.list("time",1);lay(btn).attr("lay-type","date").html(that.lang().dateTips)},date:function(){that.closeList();lay(btn).attr("lay-type","datetime").html(that.lang().timeTips)},clear:function(){isStatic&&(lay.extend(dateTime,that.firstDate),that.calendar());options.range&&(delete options.dateTime,delete that.endDate,delete that.startTime,delete that.endTime);that.setValue("").remove();that.done(["",{},{}])},now:function(){var thisDate=new Date();lay.extend(dateTime,that.systemDate(),{hours:thisDate.getHours(),minutes:thisDate.getMinutes(),seconds:thisDate.getSeconds()});that.setValue(that.parse()).remove();isStatic&&that.calendar();that.done()},confirm:function(){if(options.range){if(lay(btn).hasClass(DISABLED)){return that.hint(options.type==="time"?lang.timeout.replace(/日期/g,"时间"):lang.timeout)}}else{if(lay(btn).hasClass(DISABLED)){return that.hint(lang.invalidDate)}}that.setValue(that.parse()).remove();that.done()}};active[type]&&active[type]()};Class.prototype.change=function(index){var that=this,options=that.config,dateTime=that.thisDateTime(index),isAlone=options.range&&(options.type==="year"||options.type==="month"),elemCont=that.elemCont[index||0],listYM=that.listYM[index],addSubYeay=function(type){var isYear=lay(elemCont).find(".laydate-year-list")[0],isMonth=lay(elemCont).find(".laydate-month-list")[0];if(isYear){listYM[0]=type?listYM[0]-15:listYM[0]+15;that.list("year",index)}if(isMonth){type?listYM[0]--:listYM[0]++;that.list("month",index)}if(isYear||isMonth){lay.extend(dateTime,{year:listYM[0]});if(isAlone){dateTime.year=listYM[0]}options.range||that.done(null,"change");options.range||that.limit(lay(that.footer).find(ELEM_CONFIRM),{year:listYM[0]})}that.setBtnStatus();return isYear||isMonth};return{prevYear:function(){if(addSubYeay("sub")){return}dateTime.year--;that.checkDate("limit").calendar(null,index);that.done(null,"change")},prevMonth:function(){var YM=that.getAsYM(dateTime.year,dateTime.month,"sub");lay.extend(dateTime,{year:YM[0],month:YM[1]});that.checkDate("limit").calendar(null,index);that.done(null,"change")},nextMonth:function(){var YM=that.getAsYM(dateTime.year,dateTime.month);lay.extend(dateTime,{year:YM[0],month:YM[1]});that.checkDate("limit").calendar(null,index);that.done(null,"change")},nextYear:function(){if(addSubYeay()){return}dateTime.year++;that.checkDate("limit").calendar(null,index);that.done(null,"change")}}};Class.prototype.changeEvent=function(){var that=this,options=that.config;lay(that.elem).on("click",function(e){lay.stope(e)}).on("mousedown",function(e){lay.stope(e)});lay.each(that.elemHeader,function(i,header){lay(header[0]).on("click",function(e){that.change(i).prevYear()});lay(header[1]).on("click",function(e){that.change(i).prevMonth()});lay(header[2]).find("span").on("click",function(e){var othis=lay(this),layYM=othis.attr("lay-ym"),layType=othis.attr("lay-type");if(!layYM){return}layYM=layYM.split("-");that.listYM[i]=[layYM[0]|0,layYM[1]|0];that.list(layType,i);lay(that.footer).find("."+ELEM_TIME_BTN).addClass(DISABLED)});lay(header[3]).on("click",function(e){that.change(i).nextMonth()});lay(header[4]).on("click",function(e){that.change(i).nextYear()})});lay.each(that.table,function(i,table){var tds=lay(table).find("td");tds.on("click",function(){that.choose(lay(this),i)})});lay(that.footer).find("span").on("click",function(){var type=lay(this).attr("lay-type");that.tool(this,type)})};Class.prototype.isInput=function(elem){return/input|textarea/.test(elem.tagName.toLocaleLowerCase())||/INPUT|TEXTAREA/.test(elem.tagName)};Class.prototype.events=function(){var that=this,options=that.config,showEvent=function(elem,bind){elem.on(options.trigger,function(){if(laydate.thisId===options.id){return}bind&&(that.bindElem=this);that.render()})};if(!options.elem[0]||options.elem[0].eventHandler){return}showEvent(options.elem,"bind");showEvent(options.eventElem);options.elem[0].eventHandler=true};thisModule.that={};thisModule.getThis=function(id){var that=thisModule.that[id];if(!that&&isLayui){layui.hint().error(id?(MOD_NAME+" instance with ID '"+id+"' not found"):"ID argument required")}return that};ready.run=function(lay){lay(document).on("mousedown",function(e){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}var options=that.config;if(e.target===options.elem[0]||e.target===options.eventElem[0]||e.target===lay(options.closeStop)[0]){return}that.remove()}).on("keydown",function(e){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}if(that.config.position==="static"){return}if(e.keyCode===13){if(lay("#"+that.elemID)[0]&&that.elemID===Class.thisElemDate){e.preventDefault();lay(that.footer).find(ELEM_CONFIRM)[0].click()}}});lay(window).on("resize",function(){if(!laydate.thisId){return}var that=thisModule.getThis(laydate.thisId);if(!that){return}if(!that.elem||!lay(ELEM)[0]){return false}that.position()})};laydate.render=function(options){var inst=new Class(options);return thisModule.call(inst)};laydate.parse=function(dateTime,format,one){dateTime=dateTime||{};if(typeof format==="string"){format=thisModule.formatArr(format)}format=(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+(one||0),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)}}}}}}});return format.join("")};laydate.getEndDate=function(month,year){var thisDate=new Date();thisDate.setFullYear(year||thisDate.getFullYear(),month||(thisDate.getMonth()+1),1);return new Date(thisDate.getTime()-1000*60*60*24).getDate()};laydate.close=function(id){var that=thisModule.getThis(id||laydate.thisId);if(!that){return}return that.remove()};isLayui?(laydate.ready(),layui.define("lay",function(exports){laydate.path=layui.cache.dir;ready.run(lay);exports(MOD_NAME,laydate)})):((typeof define==="function"&&define.amd)?define(function(){ready.run(lay);return laydate}):function(){laydate.ready();ready.run(window.lay);window.laydate=laydate}())}(window,window.document); \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index 2cdb0498d..2dc750741 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -35,7 +35,7 @@ - +