/** layui-v2.5.5 MIT License By https://www.layui.com */ ; layui.define("layer", function(e) { "use strict"; var t = layui.$, i = layui.layer, a = layui.hint(), n = layui.device(), l = "form", r = ".layui-form", s = "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.val = function(e, i) { var a = this, n = t(r + '[lay-filter="' + e + '"]'); return n.each(function(e, a) { var n = t(this); layui.each(i, function(e, t) { var i, a = n.find('[name="' + e + '"]'); a[0] && (i = a[0].type, "checkbox" === i ? a[0].checked = t : "radio" === i ? a.each(function() { this.value == t && (this.checked = !0) }) : a.val(t)) }) }), f.render(null, e), a.getValue(e) }, u.prototype.getValue = function(e, i) { i = i || t(r + '[lay-filter="' + e + '"]').eq(0); var a = {}, n = {}, l = i.find("input,select,textarea"); return layui.each(l, function(e, t) { if (t.name = (t.name || "").replace(/^\s*|\s*&/, ""), t.name) { if (/^.*\[\]$/.test(t.name)) { var i = t.name.match(/^(.*)\[\]$/g)[0]; a[i] = 0 | a[i], t.name = t.name.replace(/^(.*)\[\]$/, "$1[" + a[i]++ + "]") } /^checkbox|radio$/.test(t.type) && !t.checked || (n[t.name] = t.value) } }), n }, u.prototype.render = function(e, i) { var n = this, u = t(r + function() { return i ? '[lay-filter="' + i + '"]' : "" }()), d = { select: function() { var e, i = "请选择", a = "layui-form-select", n = "layui-select-title", r = "layui-select-none", d = "", f = u.find("select"), v = function(i, l) { t(i.target).parent().hasClass(n) && !l || (t("." + a).removeClass(a + "ed " + a + "up"), e && d && e.val(d)), e = null }, y = function(i, u, f) { var y, p = t(this), m = i.find("." + n), k = m.find("input"), g = i.find("dl"), x = g.children("dd"), b = this.selectedIndex; if (!u) { var C = function() { var e = i.offset().top + i.outerHeight() + 5 - h.scrollTop(), t = g.outerHeight(); b = p[0].selectedIndex, i.addClass(a + "ed"), x.removeClass(o), y = null, x.eq(b).addClass(s).siblings().removeClass( s), e + t > h.height() && e >= t && i.addClass(a + "up"), T() }, w = function(e) { i.removeClass(a + "ed " + a + "up"), k.blur(), y = null, e || $(k.val(), function(e) { var i = p[0].selectedIndex; e && (d = t(p[0].options[i]).html(), 0 === i && d === k.attr("placeholder") && (d = ""), k.val(d || "")) }) }, T = function() { var e = g.children("dd." + s); if (e[0]) { var t = e.position().top, i = g.height(), a = e.height(); t > i && g.scrollTop(t + g.scrollTop() - i + a - 5), t < 0 && g.scrollTop(t + g.scrollTop() - 5) } }; m.on("click", function(e) { i.hasClass(a + "ed") ? w() : (v(e, !0), C()), g.find("." + r).remove() }), m.find(".layui-edge").on("click", function() { k.focus() }), k.on("keyup", function(e) { var t = e.keyCode; 9 === t && C() }).on("keydown", function(e) { var t = e.keyCode; 9 === t && w(); var i = function(t, a) { var n, l; e.preventDefault(); var r = function() { var e = g.children("dd." + s); if (g.children("dd." + o)[0] && "next" === t) { var i = g.children("dd:not(." + o + ",." + c + ")"), n = i.eq(0).index(); if (n >= 0 && n < e.index() && !i.hasClass(s)) return i.eq(0).prev()[0] ? i.eq(0).prev() : g.children( ":last") } return a && a[0] ? a : y && y[0] ? y : e }(); return l = r[t](), n = r[t]("dd:not(." + o + ")"), l[0] ? (y = r[t](), n[0] && !n.hasClass(c) || !y[0] ? (n.addClass(s).siblings().removeClass(s), void T()) : i(t, y)) : y = null }; 38 === t && i("prev"), 40 === t && i("next"), 13 === t && (e.preventDefault(), g.children("dd." + s).trigger( "click")) }); var $ = function(e, i, a) { var n = 0; layui.each(x, function() { var i = t(this), l = i.text(), r = l.indexOf(e) === -1; ("" === e || "blur" === a ? e !== l : r) && n++, "keyup" === a && i[r ? "addClass" : "removeClass"](o) }); var l = n === x.length; return i(l), l }, q = function(e) { var t = this.value, i = e.keyCode; return 9 !== i && 13 !== i && 37 !== i && 38 !== i && 39 !== i && 40 !== i && ($(t, function(e) { e ? g.find("." + r)[0] || g.append('
无匹配项
') : g.find("." + r).remove() }, "keyup"), "" === t && g.find("." + r).remove(), void T()) }; f && k.on("keyup", q).on("blur", function(i) { var a = p[0].selectedIndex; e = k, d = t(p[0].options[a]).html(), 0 === a && d === k.attr("placeholder") && (d = ""), setTimeout( function() { $(k.val(), function(e) { d || k.val("") }, "blur") }, 200) }), x.on("click", function() { var e = t(this), a = e.attr("lay-value"), n = p.attr("lay-filter"); return !e.hasClass(c) && (e.hasClass("layui-select-tips") ? k.val("") : (k.val(e.text()), e.addClass(s)), e.siblings().removeClass(s), p.val(a).removeClass("layui-form-danger"), layui.event.call(this, l, "select(" + n + ")", { elem: p[0], value: a, othis: i }), w(!0), !1) }), i.find("dl>dt").on("click", function(e) { return !1 }), t(document).off("click", v).on("click", v) } }; f.each(function(e, l) { var r = t(this), o = r.next("." + a), u = this.disabled, d = l.value, f = t(l.options[l.selectedIndex]), v = l.options[0]; if ("string" == typeof r.attr("lay-ignore")) return r.show(); var h = "string" == typeof r.attr("lay-search"), p = v ? v.value ? i : v.innerHTML || i : i, m = t(['