layui.zip layui.zip form.js /** layui-v2.2.3 MIT License By http://www.layui.com */ ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",s=".layui-form",r="layui-this",o="layui-
/** layui-v2.2.3 MIT License By http://www.layui.com */ ;layui.define("layer",function(e){"use strict";var t=layui.$,i=layui.layer,a=layui.hint(),n=layui.device(),l="form",s=".layui-form",r="layui-this",o="layui-hide",c="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var i=this;return t.extend(!0,i.config,e),i},u.prototype.verify=function(e){var i=this;return t.extend(!0,i.config.verify,e),i},u.prototype.on=function(e,t){return layui.onevent.call(this,l,e,t)},u.prototype.render=function(e,i){var n=this,u=t(s+function(){return i?'[lay-filter="'+i+'"]':""}()),d={select:function(){var e,i="请选择",a="layui-form-select",n="layui-select-title",s="layui-select-none",d="",f=u.find("select"),y=function(i,l){t(i.target).parent().hasClass(n)&&!l||(t("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},v=function(i,u,f){var v=t(this),p=i.find("."+n),m=p.find("input"),k=i.find("dl"),x=k.children("dd");if(!u){var b=function(){var e=i.offset().top+i.outerHeight()+5-h.scrollTop(),t=k.outerHeight();i.addClass(a+"ed"),x.removeClass(o),e+t>h.height()&&e>=t&&i.addClass(a+"up")},g=function(e){i.removeClass(a+"ed "+a+"up"),m.blur(),e||C(m.val(),function(e){e&&(d=k.find("."+r).html(),m&&m.val(d))})};p.on("click",function(e){i.hasClass(a+"ed")?g():(y(e,!0),b()),k.find("."+s).remove()}),p.find(".layui-edge").on("click",function(){m.focus()}),m.on("keyup",function(e){var t=e.keyCode;9===t&&b()}).on("keydown",function(e){var t=e.keyCode;9===t?g():13===t&&e.preventDefault()});var C=function(e,i,a){var n=0;layui.each(x,function(){var i=t(this),l=i.text(),s=l.indexOf(e)===-1;(""===e||"blur"===a?e!==l:s)&&n++,"keyup"===a&&i[s?"addClass":"removeClass"](o)});var l=n===x.length;return i(l),l},w=function(e){var t=this.value,i=e.keyCode;return 9!==i&&13!==i&&37!==i&&38!==i&&39!==i&&40!==i&&(C(t,function(e){e?k.find("."+s)[0]||k.append('无匹配项
'):k.find("."+s).remove()},"keyup"),void(""===t&&k.find("."+s).remove()))};f&&m.on("keyup",w).on("blur",function(t){e=m,d=k.find("."+r).html(),setTimeout(function(){C(m.val(),function(e){d||m.val("")},"blur")},200)}),x.on("click",function(){var e=t(this),a=e.attr("lay-value"),n=v.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?m.val(""):(m.val(e.text()),e.addClass(r)),e.siblings().removeClass(r),v.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:v[0],value:a,othis:i}),g(!0),!1)}),i.find("dl>dt").on("click",function(e){return!1}),t(document).off("click",y).on("click",y)}};f.each(function(e,l){var s=t(this),o=s.next("."+a),u=this.disabled,d=l.value,f=t(l.options[l.selectedIndex]),y=l.options[0];if("string"==typeof s.attr("lay-ignore"))return s.show();var h="string"==typeof s.attr("lay-search"),p=y?y.value?i:y.innerHTML||i:i,m=t([' ',' ',' ','
-
'+function(e){var t=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?t.push("
- "+a.label+" "):t.push('
- '+a.innerHTML+" "):t.push('
- '+(a.innerHTML||i)+" ")}),0===t.length&&t.push('
- 没有选项 '),t.join("")}(s.find("*"))+"