!function (e) { var t = {}; function __webpack_require__(i) { if (t[i]) return t[i].exports; var n = t[i] = { i: i, l: !1, exports: {} }; return e[i].call(n.exports, n, n.exports, __webpack_require__), n.l = !0, n.exports } __webpack_require__.m = e, __webpack_require__.c = t, __webpack_require__.d = function (e, t, i) { __webpack_require__.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: i }) }, __webpack_require__.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, __webpack_require__.t = function (e, t) { if (1 & t && (e = __webpack_require__(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var i = Object.create(null); if (__webpack_require__.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var n in e) __webpack_require__.d(i, n, function (t) { return e[t] }.bind(null, n)); return i }, __webpack_require__.n = function (e) { var t = e && e.__esModule ? function getDefault() { return e.default } : function getModuleExports() { return e }; return __webpack_require__.d(t, "a", t), t }, __webpack_require__.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 0) }([function (e, t, i) { i(1), i(2), i(3), i(4), i(5), i(6), i(7), i(8), i(9), i(10), i(11), i(12), i(14), i(15), i(16), i(17), i(18), i(19), i(20), i(21), i(22), i(23), i(24), e.exports = i(25) }, function (e, t, i) { /*! * jQuery JavaScript Library v1.12.3 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-04-05T19:16Z */var n, o; n = "undefined" != typeof window ? window : this, o = function (e, t) { var i = [], n = e.document, o = i.slice, r = i.concat, s = i.push, c = i.indexOf, d = {}, u = d.toString, h = d.hasOwnProperty, p = {}, jQuery = function (e, t) { return new jQuery.fn.init(e, t) }, y = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, m = /^-ms-/, g = /-([\da-z])/gi, fcamelCase = function (e, t) { return t.toUpperCase() }; function isArrayLike(e) { var t = !!e && "length" in e && e.length, i = jQuery.type(e); return "function" !== i && !jQuery.isWindow(e) && ("array" === i || 0 === t || "number" == typeof t && t > 0 && t - 1 in e) } jQuery.fn = jQuery.prototype = { jquery: "1.12.3", constructor: jQuery, selector: "", length: 0, toArray: function () { return o.call(this) }, get: function (e) { return null != e ? e < 0 ? this[e + this.length] : this[e] : o.call(this) }, pushStack: function (e) { var t = jQuery.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e) { return jQuery.each(this, e) }, map: function (e) { return this.pushStack(jQuery.map(this, (function (t, i) { return e.call(t, i, t) }))) }, slice: function () { return this.pushStack(o.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, i = +e + (e < 0 ? t : 0); return this.pushStack(i >= 0 && i < t ? [this[i]] : []) }, end: function () { return this.prevObject || this.constructor() }, push: s, sort: i.sort, splice: i.splice }, jQuery.extend = jQuery.fn.extend = function () { var e, t, i, n, o, r, s = arguments[0] || {}, c = 1, d = arguments.length, u = !1; for ("boolean" == typeof s && (u = s, s = arguments[c] || {}, c++), "object" == typeof s || jQuery.isFunction(s) || (s = {}), c === d && (s = this, c--); c < d; c++)if (null != (o = arguments[c])) for (n in o) e = s[n], s !== (i = o[n]) && (u && i && (jQuery.isPlainObject(i) || (t = jQuery.isArray(i))) ? (t ? (t = !1, r = e && jQuery.isArray(e) ? e : []) : r = e && jQuery.isPlainObject(e) ? e : {}, s[n] = jQuery.extend(u, r, i)) : void 0 !== i && (s[n] = i)); return s }, jQuery.extend({ expando: "jQuery" + ("1.12.3" + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isFunction: function (e) { return "function" === jQuery.type(e) }, isArray: Array.isArray || function (e) { return "array" === jQuery.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { var t = e && e.toString(); return !jQuery.isArray(e) && t - parseFloat(t) + 1 >= 0 }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, isPlainObject: function (e) { var t; if (!e || "object" !== jQuery.type(e) || e.nodeType || jQuery.isWindow(e)) return !1; try { if (e.constructor && !h.call(e, "constructor") && !h.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (e) { return !1 } if (!p.ownFirst) for (t in e) return h.call(e, t); for (t in e); return void 0 === t || h.call(e, t) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? d[u.call(e)] || "object" : typeof e }, globalEval: function (t) { t && jQuery.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(m, "ms-").replace(g, fcamelCase) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t) { var i, n = 0; if (isArrayLike(e)) for (i = e.length; n < i && !1 !== t.call(e[n], n, e[n]); n++); else for (n in e) if (!1 === t.call(e[n], n, e[n])) break; return e }, trim: function (e) { return null == e ? "" : (e + "").replace(y, "") }, makeArray: function (e, t) { var i = t || []; return null != e && (isArrayLike(Object(e)) ? jQuery.merge(i, "string" == typeof e ? [e] : e) : s.call(i, e)), i }, inArray: function (e, t, i) { var n; if (t) { if (c) return c.call(t, e, i); for (n = t.length, i = i ? i < 0 ? Math.max(0, n + i) : i : 0; i < n; i++)if (i in t && t[i] === e) return i } return -1 }, merge: function (e, t) { for (var i = +t.length, n = 0, o = e.length; n < i;)e[o++] = t[n++]; if (i != i) for (; void 0 !== t[n];)e[o++] = t[n++]; return e.length = o, e }, grep: function (e, t, i) { for (var n = [], o = 0, r = e.length, s = !i; o < r; o++)!t(e[o], o) !== s && n.push(e[o]); return n }, map: function (e, t, i) { var n, o, s = 0, c = []; if (isArrayLike(e)) for (n = e.length; s < n; s++)null != (o = t(e[s], s, i)) && c.push(o); else for (s in e) null != (o = t(e[s], s, i)) && c.push(o); return r.apply([], c) }, guid: 1, proxy: function (e, t) { var i, n, r; if ("string" == typeof t && (r = e[t], t = e, e = r), jQuery.isFunction(e)) return i = o.call(arguments, 2), (n = function () { return e.apply(t || this, i.concat(o.call(arguments))) }).guid = e.guid = e.guid || jQuery.guid++, n }, now: function () { return +new Date }, support: p }), "function" == typeof Symbol && (jQuery.fn[Symbol.iterator] = i[Symbol.iterator]), jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), (function (e, t) { d["[object " + t + "]"] = t.toLowerCase() })); var b = /*! * Sizzle CSS Selector Engine v2.2.1 * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2015-10-17 */ function (e) { var t, i, n, o, r, s, c, d, u, h, p, y, m, g, b, k, w, C, D, E = "sizzle" + 1 * new Date, S = e.document, L = 0, N = 0, A = createCache(), _ = createCache(), F = createCache(), sortOrder = function (e, t) { return e === t && (p = !0), 0 }, I = {}.hasOwnProperty, j = [], H = j.pop, O = j.push, z = j.push, P = j.slice, indexOf = function (e, t) { for (var i = 0, n = e.length; i < n; i++)if (e[i] === t) return i; return -1 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", B = "[\\x20\\t\\r\\n\\f]", W = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", Y = "\\[" + B + "*(" + W + ")(?:" + B + "*([*^$|!~]?=)" + B + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + W + "))|)" + B + "*\\]", X = ":(" + W + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + Y + ")*)|.*)\\)|)", U = new RegExp(B + "+", "g"), K = new RegExp("^" + B + "+|((?:^|[^\\\\])(?:\\\\.)*)" + B + "+$", "g"), V = new RegExp("^" + B + "*," + B + "*"), G = new RegExp("^" + B + "*([>+~]|" + B + ")" + B + "*"), J = new RegExp("=" + B + "*([^\\]'\"]*?)" + B + "*\\]", "g"), Z = new RegExp(X), Q = new RegExp("^" + W + "$"), ee = { ID: new RegExp("^#(" + W + ")"), CLASS: new RegExp("^\\.(" + W + ")"), TAG: new RegExp("^(" + W + "|[*])"), ATTR: new RegExp("^" + Y), PSEUDO: new RegExp("^" + X), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + B + "*(even|odd|(([+-]|)(\\d*)n|)" + B + "*(?:([+-]|)" + B + "*(\\d+)|))" + B + "*\\)|)", "i"), bool: new RegExp("^(?:" + R + ")$", "i"), needsContext: new RegExp("^" + B + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + B + "*((?:-\\d)?\\d*)" + B + "*\\)|)(?=[^-]|$)", "i") }, te = /^(?:input|select|textarea|button)$/i, ie = /^h\d$/i, ae = /^[^{]+\{\s*\[native \w/, ne = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, le = /[+~]/, oe = /'|\\/g, re = new RegExp("\\\\([\\da-f]{1,6}" + B + "?|(" + B + ")|.)", "ig"), funescape = function (e, t, i) { var n = "0x" + t - 65536; return n != n || i ? t : n < 0 ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320) }, unloadHandler = function () { y() }; try { z.apply(j = P.call(S.childNodes), S.childNodes), j[S.childNodes.length].nodeType } catch (e) { z = { apply: j.length ? function (e, t) { O.apply(e, P.call(t)) } : function (e, t) { for (var i = e.length, n = 0; e[i++] = t[n++];); e.length = i - 1 } } } function Sizzle(e, t, n, o) { var r, c, u, h, p, g, w, C, L = t && t.ownerDocument, N = t ? t.nodeType : 9; if (n = n || [], "string" != typeof e || !e || 1 !== N && 9 !== N && 11 !== N) return n; if (!o && ((t ? t.ownerDocument || t : S) !== m && y(t), t = t || m, b)) { if (11 !== N && (g = ne.exec(e))) if (r = g[1]) { if (9 === N) { if (!(u = t.getElementById(r))) return n; if (u.id === r) return n.push(u), n } else if (L && (u = L.getElementById(r)) && D(t, u) && u.id === r) return n.push(u), n } else { if (g[2]) return z.apply(n, t.getElementsByTagName(e)), n; if ((r = g[3]) && i.getElementsByClassName && t.getElementsByClassName) return z.apply(n, t.getElementsByClassName(r)), n } if (i.qsa && !F[e + " "] && (!k || !k.test(e))) { if (1 !== N) L = t, C = e; else if ("object" !== t.nodeName.toLowerCase()) { for ((h = t.getAttribute("id")) ? h = h.replace(oe, "\\$&") : t.setAttribute("id", h = E), c = (w = s(e)).length, p = Q.test(h) ? "#" + h : "[id='" + h + "']"; c--;)w[c] = p + " " + toSelector(w[c]); C = w.join(","), L = le.test(e) && testContext(t.parentNode) || t } if (C) try { return z.apply(n, L.querySelectorAll(C)), n } catch (e) { } finally { h === E && t.removeAttribute("id") } } } return d(e.replace(K, "$1"), t, n, o) } function createCache() { var e = []; return function cache(t, i) { return e.push(t + " ") > n.cacheLength && delete cache[e.shift()], cache[t + " "] = i } } function markFunction(e) { return e[E] = !0, e } function assert(e) { var t = m.createElement("div"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function addHandle(e, t) { for (var i = e.split("|"), o = i.length; o--;)n.attrHandle[i[o]] = t } function siblingCheck(e, t) { var i = t && e, n = i && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || 1 << 31) - (~e.sourceIndex || 1 << 31); if (n) return n; if (i) for (; i = i.nextSibling;)if (i === t) return -1; return e ? 1 : -1 } function createInputPseudo(e) { return function (t) { return "input" === t.nodeName.toLowerCase() && t.type === e } } function createButtonPseudo(e) { return function (t) { var i = t.nodeName.toLowerCase(); return ("input" === i || "button" === i) && t.type === e } } function createPositionalPseudo(e) { return markFunction((function (t) { return t = +t, markFunction((function (i, n) { for (var o, r = e([], i.length, t), s = r.length; s--;)i[o = r[s]] && (i[o] = !(n[o] = i[o])) })) })) } function testContext(e) { return e && void 0 !== e.getElementsByTagName && e } for (t in i = Sizzle.support = {}, r = Sizzle.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return !!t && "HTML" !== t.nodeName }, y = Sizzle.setDocument = function (e) { var t, o, s = e ? e.ownerDocument || e : S; return s !== m && 9 === s.nodeType && s.documentElement ? (g = (m = s).documentElement, b = !r(m), (o = m.defaultView) && o.top !== o && (o.addEventListener ? o.addEventListener("unload", unloadHandler, !1) : o.attachEvent && o.attachEvent("onunload", unloadHandler)), i.attributes = assert((function (e) { return e.className = "i", !e.getAttribute("className") })), i.getElementsByTagName = assert((function (e) { return e.appendChild(m.createComment("")), !e.getElementsByTagName("*").length })), i.getElementsByClassName = ae.test(m.getElementsByClassName), i.getById = assert((function (e) { return g.appendChild(e).id = E, !m.getElementsByName || !m.getElementsByName(E).length })), i.getById ? (n.find.ID = function (e, t) { if (void 0 !== t.getElementById && b) { var i = t.getElementById(e); return i ? [i] : [] } }, n.filter.ID = function (e) { var t = e.replace(re, funescape); return function (e) { return e.getAttribute("id") === t } }) : (delete n.find.ID, n.filter.ID = function (e) { var t = e.replace(re, funescape); return function (e) { var i = void 0 !== e.getAttributeNode && e.getAttributeNode("id"); return i && i.value === t } }), n.find.TAG = i.getElementsByTagName ? function (e, t) { return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : i.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var i, n = [], o = 0, r = t.getElementsByTagName(e); if ("*" === e) { for (; i = r[o++];)1 === i.nodeType && n.push(i); return n } return r }, n.find.CLASS = i.getElementsByClassName && function (e, t) { if (void 0 !== t.getElementsByClassName && b) return t.getElementsByClassName(e) }, w = [], k = [], (i.qsa = ae.test(m.querySelectorAll)) && (assert((function (e) { g.appendChild(e).innerHTML = "", e.querySelectorAll("[msallowcapture^='']").length && k.push("[*^$]=" + B + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || k.push("\\[" + B + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + E + "-]").length || k.push("~="), e.querySelectorAll(":checked").length || k.push(":checked"), e.querySelectorAll("a#" + E + "+*").length || k.push(".#.+[+~]") })), assert((function (e) { var t = m.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && k.push("name" + B + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || k.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), k.push(",.*:") }))), (i.matchesSelector = ae.test(C = g.matches || g.webkitMatchesSelector || g.mozMatchesSelector || g.oMatchesSelector || g.msMatchesSelector)) && assert((function (e) { i.disconnectedMatch = C.call(e, "div"), C.call(e, "[s!='']:x"), w.push("!=", X) })), k = k.length && new RegExp(k.join("|")), w = w.length && new RegExp(w.join("|")), t = ae.test(g.compareDocumentPosition), D = t || ae.test(g.contains) ? function (e, t) { var i = 9 === e.nodeType ? e.documentElement : e, n = t && t.parentNode; return e === n || !(!n || 1 !== n.nodeType || !(i.contains ? i.contains(n) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(n))) } : function (e, t) { if (t) for (; t = t.parentNode;)if (t === e) return !0; return !1 }, sortOrder = t ? function (e, t) { if (e === t) return p = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !i.sortDetached && t.compareDocumentPosition(e) === n ? e === m || e.ownerDocument === S && D(S, e) ? -1 : t === m || t.ownerDocument === S && D(S, t) ? 1 : h ? indexOf(h, e) - indexOf(h, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return p = !0, 0; var i, n = 0, o = e.parentNode, r = t.parentNode, s = [e], c = [t]; if (!o || !r) return e === m ? -1 : t === m ? 1 : o ? -1 : r ? 1 : h ? indexOf(h, e) - indexOf(h, t) : 0; if (o === r) return siblingCheck(e, t); for (i = e; i = i.parentNode;)s.unshift(i); for (i = t; i = i.parentNode;)c.unshift(i); for (; s[n] === c[n];)n++; return n ? siblingCheck(s[n], c[n]) : s[n] === S ? -1 : c[n] === S ? 1 : 0 }, m) : m }, Sizzle.matches = function (e, t) { return Sizzle(e, null, null, t) }, Sizzle.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== m && y(e), t = t.replace(J, "='$1']"), i.matchesSelector && b && !F[t + " "] && (!w || !w.test(t)) && (!k || !k.test(t))) try { var n = C.call(e, t); if (n || i.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (e) { } return Sizzle(t, m, null, [e]).length > 0 }, Sizzle.contains = function (e, t) { return (e.ownerDocument || e) !== m && y(e), D(e, t) }, Sizzle.attr = function (e, t) { (e.ownerDocument || e) !== m && y(e); var o = n.attrHandle[t.toLowerCase()], r = o && I.call(n.attrHandle, t.toLowerCase()) ? o(e, t, !b) : void 0; return void 0 !== r ? r : i.attributes || !b ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, Sizzle.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, Sizzle.uniqueSort = function (e) { var t, n = [], o = 0, r = 0; if (p = !i.detectDuplicates, h = !i.sortStable && e.slice(0), e.sort(sortOrder), p) { for (; t = e[r++];)t === e[r] && (o = n.push(r)); for (; o--;)e.splice(n[o], 1) } return h = null, e }, o = Sizzle.getText = function (e) { var t, i = "", n = 0, r = e.nodeType; if (r) { if (1 === r || 9 === r || 11 === r) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling)i += o(e) } else if (3 === r || 4 === r) return e.nodeValue } else for (; t = e[n++];)i += o(t); return i }, (n = Sizzle.selectors = { cacheLength: 50, createPseudo: markFunction, match: ee, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(re, funescape), e[3] = (e[3] || e[4] || e[5] || "").replace(re, funescape), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || Sizzle.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && Sizzle.error(e[0]), e }, PSEUDO: function (e) { var t, i = !e[6] && e[2]; return ee.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : i && Z.test(i) && (t = s(i, !0)) && (t = i.indexOf(")", i.length - t) - i.length) && (e[0] = e[0].slice(0, t), e[2] = i.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(re, funescape).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = A[e + " "]; return t || (t = new RegExp("(^|" + B + ")" + e + "(" + B + "|$)")) && A(e, (function (e) { return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "") })) }, ATTR: function (e, t, i) { return function (n) { var o = Sizzle.attr(n, e); return null == o ? "!=" === t : !t || (o += "", "=" === t ? o === i : "!=" === t ? o !== i : "^=" === t ? i && 0 === o.indexOf(i) : "*=" === t ? i && o.indexOf(i) > -1 : "$=" === t ? i && o.slice(-i.length) === i : "~=" === t ? (" " + o.replace(U, " ") + " ").indexOf(i) > -1 : "|=" === t && (o === i || o.slice(0, i.length + 1) === i + "-")) } }, CHILD: function (e, t, i, n, o) { var r = "nth" !== e.slice(0, 3), s = "last" !== e.slice(-4), c = "of-type" === t; return 1 === n && 0 === o ? function (e) { return !!e.parentNode } : function (t, i, d) { var u, h, p, y, m, g, b = r !== s ? "nextSibling" : "previousSibling", k = t.parentNode, w = c && t.nodeName.toLowerCase(), C = !d && !c, D = !1; if (k) { if (r) { for (; b;) { for (y = t; y = y[b];)if (c ? y.nodeName.toLowerCase() === w : 1 === y.nodeType) return !1; g = b = "only" === e && !g && "nextSibling" } return !0 } if (g = [s ? k.firstChild : k.lastChild], s && C) { for (D = (m = (u = (h = (p = (y = k)[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] || [])[0] === L && u[1]) && u[2], y = m && k.childNodes[m]; y = ++m && y && y[b] || (D = m = 0) || g.pop();)if (1 === y.nodeType && ++D && y === t) { h[e] = [L, m, D]; break } } else if (C && (D = m = (u = (h = (p = (y = t)[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] || [])[0] === L && u[1]), !1 === D) for (; (y = ++m && y && y[b] || (D = m = 0) || g.pop()) && ((c ? y.nodeName.toLowerCase() !== w : 1 !== y.nodeType) || !++D || (C && ((h = (p = y[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] = [L, D]), y !== t));); return (D -= o) === n || D % n == 0 && D / n >= 0 } } }, PSEUDO: function (e, t) { var i, o = n.pseudos[e] || n.setFilters[e.toLowerCase()] || Sizzle.error("unsupported pseudo: " + e); return o[E] ? o(t) : o.length > 1 ? (i = [e, e, "", t], n.setFilters.hasOwnProperty(e.toLowerCase()) ? markFunction((function (e, i) { for (var n, r = o(e, t), s = r.length; s--;)e[n = indexOf(e, r[s])] = !(i[n] = r[s]) })) : function (e) { return o(e, 0, i) }) : o } }, pseudos: { not: markFunction((function (e) { var t = [], i = [], n = c(e.replace(K, "$1")); return n[E] ? markFunction((function (e, t, i, o) { for (var r, s = n(e, null, o, []), c = e.length; c--;)(r = s[c]) && (e[c] = !(t[c] = r)) })) : function (e, o, r) { return t[0] = e, n(t, null, r, i), t[0] = null, !i.pop() } })), has: markFunction((function (e) { return function (t) { return Sizzle(e, t).length > 0 } })), contains: markFunction((function (e) { return e = e.replace(re, funescape), function (t) { return (t.textContent || t.innerText || o(t)).indexOf(e) > -1 } })), lang: markFunction((function (e) { return Q.test(e || "") || Sizzle.error("unsupported lang: " + e), e = e.replace(re, funescape).toLowerCase(), function (t) { var i; do { if (i = b ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (i = i.toLowerCase()) === e || 0 === i.indexOf(e + "-") } while ((t = t.parentNode) && 1 === t.nodeType); return !1 } })), target: function (t) { var i = e.location && e.location.hash; return i && i.slice(1) === t.id }, root: function (e) { return e === g }, focus: function (e) { return e === m.activeElement && (!m.hasFocus || m.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return !1 === e.disabled }, disabled: function (e) { return !0 === e.disabled }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling)if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !n.pseudos.empty(e) }, header: function (e) { return ie.test(e.nodeName) }, input: function (e) { return te.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: createPositionalPseudo((function () { return [0] })), last: createPositionalPseudo((function (e, t) { return [t - 1] })), eq: createPositionalPseudo((function (e, t, i) { return [i < 0 ? i + t : i] })), even: createPositionalPseudo((function (e, t) { for (var i = 0; i < t; i += 2)e.push(i); return e })), odd: createPositionalPseudo((function (e, t) { for (var i = 1; i < t; i += 2)e.push(i); return e })), lt: createPositionalPseudo((function (e, t, i) { for (var n = i < 0 ? i + t : i; --n >= 0;)e.push(n); return e })), gt: createPositionalPseudo((function (e, t, i) { for (var n = i < 0 ? i + t : i; ++n < t;)e.push(n); return e })) } }).pseudos.nth = n.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) n.pseudos[t] = createInputPseudo(t); for (t in { submit: !0, reset: !0 }) n.pseudos[t] = createButtonPseudo(t); function setFilters() { } function toSelector(e) { for (var t = 0, i = e.length, n = ""; t < i; t++)n += e[t].value; return n } function addCombinator(e, t, i) { var n = t.dir, o = i && "parentNode" === n, r = N++; return t.first ? function (t, i, r) { for (; t = t[n];)if (1 === t.nodeType || o) return e(t, i, r) } : function (t, i, s) { var c, d, u, h = [L, r]; if (s) { for (; t = t[n];)if ((1 === t.nodeType || o) && e(t, i, s)) return !0 } else for (; t = t[n];)if (1 === t.nodeType || o) { if ((c = (d = (u = t[E] || (t[E] = {}))[t.uniqueID] || (u[t.uniqueID] = {}))[n]) && c[0] === L && c[1] === r) return h[2] = c[2]; if (d[n] = h, h[2] = e(t, i, s)) return !0 } } } function elementMatcher(e) { return e.length > 1 ? function (t, i, n) { for (var o = e.length; o--;)if (!e[o](t, i, n)) return !1; return !0 } : e[0] } function condense(e, t, i, n, o) { for (var r, s = [], c = 0, d = e.length, u = null != t; c < d; c++)(r = e[c]) && (i && !i(r, n, o) || (s.push(r), u && t.push(c))); return s } function setMatcher(e, t, i, n, o, r) { return n && !n[E] && (n = setMatcher(n)), o && !o[E] && (o = setMatcher(o, r)), markFunction((function (r, s, c, d) { var u, h, p, y = [], m = [], g = s.length, b = r || function multipleContexts(e, t, i) { for (var n = 0, o = t.length; n < o; n++)Sizzle(e, t[n], i); return i }(t || "*", c.nodeType ? [c] : c, []), k = !e || !r && t ? b : condense(b, y, e, c, d), w = i ? o || (r ? e : g || n) ? [] : s : k; if (i && i(k, w, c, d), n) for (u = condense(w, m), n(u, [], c, d), h = u.length; h--;)(p = u[h]) && (w[m[h]] = !(k[m[h]] = p)); if (r) { if (o || e) { if (o) { for (u = [], h = w.length; h--;)(p = w[h]) && u.push(k[h] = p); o(null, w = [], u, d) } for (h = w.length; h--;)(p = w[h]) && (u = o ? indexOf(r, p) : y[h]) > -1 && (r[u] = !(s[u] = p)) } } else w = condense(w === s ? w.splice(g, w.length) : w), o ? o(null, s, w, d) : z.apply(s, w) })) } function matcherFromTokens(e) { for (var t, i, o, r = e.length, s = n.relative[e[0].type], c = s || n.relative[" "], d = s ? 1 : 0, h = addCombinator((function (e) { return e === t }), c, !0), p = addCombinator((function (e) { return indexOf(t, e) > -1 }), c, !0), y = [function (e, i, n) { var o = !s && (n || i !== u) || ((t = i).nodeType ? h(e, i, n) : p(e, i, n)); return t = null, o }]; d < r; d++)if (i = n.relative[e[d].type]) y = [addCombinator(elementMatcher(y), i)]; else { if ((i = n.filter[e[d].type].apply(null, e[d].matches))[E]) { for (o = ++d; o < r && !n.relative[e[o].type]; o++); return setMatcher(d > 1 && elementMatcher(y), d > 1 && toSelector(e.slice(0, d - 1).concat({ value: " " === e[d - 2].type ? "*" : "" })).replace(K, "$1"), i, d < o && matcherFromTokens(e.slice(d, o)), o < r && matcherFromTokens(e = e.slice(o)), o < r && toSelector(e)) } y.push(i) } return elementMatcher(y) } return setFilters.prototype = n.filters = n.pseudos, n.setFilters = new setFilters, s = Sizzle.tokenize = function (e, t) { var i, o, r, s, c, d, u, h = _[e + " "]; if (h) return t ? 0 : h.slice(0); for (c = e, d = [], u = n.preFilter; c;) { for (s in i && !(o = V.exec(c)) || (o && (c = c.slice(o[0].length) || c), d.push(r = [])), i = !1, (o = G.exec(c)) && (i = o.shift(), r.push({ value: i, type: o[0].replace(K, " ") }), c = c.slice(i.length)), n.filter) !(o = ee[s].exec(c)) || u[s] && !(o = u[s](o)) || (i = o.shift(), r.push({ value: i, type: s, matches: o }), c = c.slice(i.length)); if (!i) break } return t ? c.length : c ? Sizzle.error(e) : _(e, d).slice(0) }, c = Sizzle.compile = function (e, t) { var i, o = [], r = [], c = F[e + " "]; if (!c) { for (t || (t = s(e)), i = t.length; i--;)(c = matcherFromTokens(t[i]))[E] ? o.push(c) : r.push(c); (c = F(e, function matcherFromGroupMatchers(e, t) { var i = t.length > 0, o = e.length > 0, superMatcher = function (r, s, c, d, h) { var p, g, k, w = 0, C = "0", D = r && [], E = [], S = u, N = r || o && n.find.TAG("*", h), A = L += null == S ? 1 : Math.random() || .1, _ = N.length; for (h && (u = s === m || s || h); C !== _ && null != (p = N[C]); C++) { if (o && p) { for (g = 0, s || p.ownerDocument === m || (y(p), c = !b); k = e[g++];)if (k(p, s || m, c)) { d.push(p); break } h && (L = A) } i && ((p = !k && p) && w--, r && D.push(p)) } if (w += C, i && C !== w) { for (g = 0; k = t[g++];)k(D, E, s, c); if (r) { if (w > 0) for (; C--;)D[C] || E[C] || (E[C] = H.call(d)); E = condense(E) } z.apply(d, E), h && !r && E.length > 0 && w + t.length > 1 && Sizzle.uniqueSort(d) } return h && (L = A, u = S), D }; return i ? markFunction(superMatcher) : superMatcher }(r, o))).selector = e } return c }, d = Sizzle.select = function (e, t, o, r) { var d, u, h, p, y, m = "function" == typeof e && e, g = !r && s(e = m.selector || e); if (o = o || [], 1 === g.length) { if ((u = g[0] = g[0].slice(0)).length > 2 && "ID" === (h = u[0]).type && i.getById && 9 === t.nodeType && b && n.relative[u[1].type]) { if (!(t = (n.find.ID(h.matches[0].replace(re, funescape), t) || [])[0])) return o; m && (t = t.parentNode), e = e.slice(u.shift().value.length) } for (d = ee.needsContext.test(e) ? 0 : u.length; d-- && (h = u[d], !n.relative[p = h.type]);)if ((y = n.find[p]) && (r = y(h.matches[0].replace(re, funescape), le.test(u[0].type) && testContext(t.parentNode) || t))) { if (u.splice(d, 1), !(e = r.length && toSelector(u))) return z.apply(o, r), o; break } } return (m || c(e, g))(r, t, !b, o, !t || le.test(e) && testContext(t.parentNode) || t), o }, i.sortStable = E.split("").sort(sortOrder).join("") === E, i.detectDuplicates = !!p, y(), i.sortDetached = assert((function (e) { return 1 & e.compareDocumentPosition(m.createElement("div")) })), assert((function (e) { return e.innerHTML = "", "#" === e.firstChild.getAttribute("href") })) || addHandle("type|href|height|width", (function (e, t, i) { if (!i) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) })), i.attributes && assert((function (e) { return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") })) || addHandle("value", (function (e, t, i) { if (!i && "input" === e.nodeName.toLowerCase()) return e.defaultValue })), assert((function (e) { return null == e.getAttribute("disabled") })) || addHandle(R, (function (e, t, i) { var n; if (!i) return !0 === e[t] ? t.toLowerCase() : (n = e.getAttributeNode(t)) && n.specified ? n.value : null })), Sizzle }(e); jQuery.find = b, jQuery.expr = b.selectors, jQuery.expr[":"] = jQuery.expr.pseudos, jQuery.uniqueSort = jQuery.unique = b.uniqueSort, jQuery.text = b.getText, jQuery.isXMLDoc = b.isXML, jQuery.contains = b.contains; var dir = function (e, t, i) { for (var n = [], o = void 0 !== i; (e = e[t]) && 9 !== e.nodeType;)if (1 === e.nodeType) { if (o && jQuery(e).is(i)) break; n.push(e) } return n }, siblings = function (e, t) { for (var i = []; e; e = e.nextSibling)1 === e.nodeType && e !== t && i.push(e); return i }, k = jQuery.expr.match.needsContext, w = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/, C = /^.[^:#\[\.,]*$/; function winnow(e, t, i) { if (jQuery.isFunction(t)) return jQuery.grep(e, (function (e, n) { return !!t.call(e, n, e) !== i })); if (t.nodeType) return jQuery.grep(e, (function (e) { return e === t !== i })); if ("string" == typeof t) { if (C.test(t)) return jQuery.filter(t, e, i); t = jQuery.filter(t, e) } return jQuery.grep(e, (function (e) { return jQuery.inArray(e, t) > -1 !== i })) } jQuery.filter = function (e, t, i) { var n = t[0]; return i && (e = ":not(" + e + ")"), 1 === t.length && 1 === n.nodeType ? jQuery.find.matchesSelector(n, e) ? [n] : [] : jQuery.find.matches(e, jQuery.grep(t, (function (e) { return 1 === e.nodeType }))) }, jQuery.fn.extend({ find: function (e) { var t, i = [], n = this, o = n.length; if ("string" != typeof e) return this.pushStack(jQuery(e).filter((function () { for (t = 0; t < o; t++)if (jQuery.contains(n[t], this)) return !0 }))); for (t = 0; t < o; t++)jQuery.find(e, n[t], i); return (i = this.pushStack(o > 1 ? jQuery.unique(i) : i)).selector = this.selector ? this.selector + " " + e : e, i }, filter: function (e) { return this.pushStack(winnow(this, e || [], !1)) }, not: function (e) { return this.pushStack(winnow(this, e || [], !0)) }, is: function (e) { return !!winnow(this, "string" == typeof e && k.test(e) ? jQuery(e) : e || [], !1).length } }); var D, E = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; (jQuery.fn.init = function (e, t, i) { var o, r; if (!e) return this; if (i = i || D, "string" == typeof e) { if (!(o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : E.exec(e)) || !o[1] && t) return !t || t.jquery ? (t || i).find(e) : this.constructor(t).find(e); if (o[1]) { if (t = t instanceof jQuery ? t[0] : t, jQuery.merge(this, jQuery.parseHTML(o[1], t && t.nodeType ? t.ownerDocument || t : n, !0)), w.test(o[1]) && jQuery.isPlainObject(t)) for (o in t) jQuery.isFunction(this[o]) ? this[o](t[o]) : this.attr(o, t[o]); return this } if ((r = n.getElementById(o[2])) && r.parentNode) { if (r.id !== o[2]) return D.find(e); this.length = 1, this[0] = r } return this.context = n, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : jQuery.isFunction(e) ? void 0 !== i.ready ? i.ready(e) : e(jQuery) : (void 0 !== e.selector && (this.selector = e.selector, this.context = e.context), jQuery.makeArray(e, this)) }).prototype = jQuery.fn, D = jQuery(n); var S = /^(?:parents|prev(?:Until|All))/, L = { children: !0, contents: !0, next: !0, prev: !0 }; function sibling(e, t) { do { e = e[t] } while (e && 1 !== e.nodeType); return e } jQuery.fn.extend({ has: function (e) { var t, i = jQuery(e, this), n = i.length; return this.filter((function () { for (t = 0; t < n; t++)if (jQuery.contains(this, i[t])) return !0 })) }, closest: function (e, t) { for (var i, n = 0, o = this.length, r = [], s = k.test(e) || "string" != typeof e ? jQuery(e, t || this.context) : 0; n < o; n++)for (i = this[n]; i && i !== t; i = i.parentNode)if (i.nodeType < 11 && (s ? s.index(i) > -1 : 1 === i.nodeType && jQuery.find.matchesSelector(i, e))) { r.push(i); break } return this.pushStack(r.length > 1 ? jQuery.uniqueSort(r) : r) }, index: function (e) { return e ? "string" == typeof e ? jQuery.inArray(this[0], jQuery(e)) : jQuery.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), jQuery.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return dir(e, "parentNode") }, parentsUntil: function (e, t, i) { return dir(e, "parentNode", i) }, next: function (e) { return sibling(e, "nextSibling") }, prev: function (e) { return sibling(e, "previousSibling") }, nextAll: function (e) { return dir(e, "nextSibling") }, prevAll: function (e) { return dir(e, "previousSibling") }, nextUntil: function (e, t, i) { return dir(e, "nextSibling", i) }, prevUntil: function (e, t, i) { return dir(e, "previousSibling", i) }, siblings: function (e) { return siblings((e.parentNode || {}).firstChild, e) }, children: function (e) { return siblings(e.firstChild) }, contents: function (e) { return jQuery.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : jQuery.merge([], e.childNodes) } }, (function (e, t) { jQuery.fn[e] = function (i, n) { var o = jQuery.map(this, t, i); return "Until" !== e.slice(-5) && (n = i), n && "string" == typeof n && (o = jQuery.filter(n, o)), this.length > 1 && (L[e] || (o = jQuery.uniqueSort(o)), S.test(e) && (o = o.reverse())), this.pushStack(o) } })); var N, A, _ = /\S+/g; function detach() { n.addEventListener ? (n.removeEventListener("DOMContentLoaded", completed), e.removeEventListener("load", completed)) : (n.detachEvent("onreadystatechange", completed), e.detachEvent("onload", completed)) } function completed() { (n.addEventListener || "load" === e.event.type || "complete" === n.readyState) && (detach(), jQuery.ready()) } for (A in jQuery.Callbacks = function (e) { e = "string" == typeof e ? function createOptions(e) { var t = {}; return jQuery.each(e.match(_) || [], (function (e, i) { t[i] = !0 })), t }(e) : jQuery.extend({}, e); var t, i, n, o, r = [], s = [], c = -1, fire = function () { for (o = e.once, n = t = !0; s.length; c = -1)for (i = s.shift(); ++c < r.length;)!1 === r[c].apply(i[0], i[1]) && e.stopOnFalse && (c = r.length, i = !1); e.memory || (i = !1), t = !1, o && (r = i ? [] : "") }, d = { add: function () { return r && (i && !t && (c = r.length - 1, s.push(i)), function add(t) { jQuery.each(t, (function (t, i) { jQuery.isFunction(i) ? e.unique && d.has(i) || r.push(i) : i && i.length && "string" !== jQuery.type(i) && add(i) })) }(arguments), i && !t && fire()), this }, remove: function () { return jQuery.each(arguments, (function (e, t) { for (var i; (i = jQuery.inArray(t, r, i)) > -1;)r.splice(i, 1), i <= c && c-- })), this }, has: function (e) { return e ? jQuery.inArray(e, r) > -1 : r.length > 0 }, empty: function () { return r && (r = []), this }, disable: function () { return o = s = [], r = i = "", this }, disabled: function () { return !r }, lock: function () { return o = !0, i || d.disable(), this }, locked: function () { return !!o }, fireWith: function (e, i) { return o || (i = [e, (i = i || []).slice ? i.slice() : i], s.push(i), t || fire()), this }, fire: function () { return d.fireWith(this, arguments), this }, fired: function () { return !!n } }; return d }, jQuery.extend({ Deferred: function (e) { var t = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]], i = "pending", n = { state: function () { return i }, always: function () { return o.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return jQuery.Deferred((function (i) { jQuery.each(t, (function (t, r) { var s = jQuery.isFunction(e[t]) && e[t]; o[r[1]]((function () { var e = s && s.apply(this, arguments); e && jQuery.isFunction(e.promise) ? e.promise().progress(i.notify).done(i.resolve).fail(i.reject) : i[r[0] + "With"](this === n ? i.promise() : this, s ? [e] : arguments) })) })), e = null })).promise() }, promise: function (e) { return null != e ? jQuery.extend(e, n) : n } }, o = {}; return n.pipe = n.then, jQuery.each(t, (function (e, r) { var s = r[2], c = r[3]; n[r[1]] = s.add, c && s.add((function () { i = c }), t[1 ^ e][2].disable, t[2][2].lock), o[r[0]] = function () { return o[r[0] + "With"](this === o ? n : this, arguments), this }, o[r[0] + "With"] = s.fireWith })), n.promise(o), e && e.call(o, o), o }, when: function (e) { var t, i, n, r = 0, s = o.call(arguments), c = s.length, d = 1 !== c || e && jQuery.isFunction(e.promise) ? c : 0, u = 1 === d ? e : jQuery.Deferred(), updateFunc = function (e, i, n) { return function (r) { i[e] = this, n[e] = arguments.length > 1 ? o.call(arguments) : r, n === t ? u.notifyWith(i, n) : --d || u.resolveWith(i, n) } }; if (c > 1) for (t = new Array(c), i = new Array(c), n = new Array(c); r < c; r++)s[r] && jQuery.isFunction(s[r].promise) ? s[r].promise().progress(updateFunc(r, i, t)).done(updateFunc(r, n, s)).fail(u.reject) : --d; return d || u.resolveWith(n, s), u.promise() } }), jQuery.fn.ready = function (e) { return jQuery.ready.promise().done(e), this }, jQuery.extend({ isReady: !1, readyWait: 1, holdReady: function (e) { e ? jQuery.readyWait++ : jQuery.ready(!0) }, ready: function (e) { (!0 === e ? --jQuery.readyWait : jQuery.isReady) || (jQuery.isReady = !0, !0 !== e && --jQuery.readyWait > 0 || (N.resolveWith(n, [jQuery]), jQuery.fn.triggerHandler && (jQuery(n).triggerHandler("ready"), jQuery(n).off("ready")))) } }), jQuery.ready.promise = function (t) { if (!N) if (N = jQuery.Deferred(), "complete" === n.readyState || "loading" !== n.readyState && !n.documentElement.doScroll) e.setTimeout(jQuery.ready); else if (n.addEventListener) n.addEventListener("DOMContentLoaded", completed), e.addEventListener("load", completed); else { n.attachEvent("onreadystatechange", completed), e.attachEvent("onload", completed); var i = !1; try { i = null == e.frameElement && n.documentElement } catch (e) { } i && i.doScroll && function doScrollCheck() { if (!jQuery.isReady) { try { i.doScroll("left") } catch (t) { return e.setTimeout(doScrollCheck, 50) } detach(), jQuery.ready() } }() } return N.promise(t) }, jQuery.ready.promise(), jQuery(p)) break; p.ownFirst = "0" === A, p.inlineBlockNeedsLayout = !1, jQuery((function () { var e, t, i, o; (i = n.getElementsByTagName("body")[0]) && i.style && (t = n.createElement("div"), (o = n.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", i.appendChild(o).appendChild(t), void 0 !== t.style.zoom && (t.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", p.inlineBlockNeedsLayout = e = 3 === t.offsetWidth, e && (i.style.zoom = 1)), i.removeChild(o)) })), function () { var e = n.createElement("div"); p.deleteExpando = !0; try { delete e.test } catch (e) { p.deleteExpando = !1 } e = null }(); var F, acceptData = function (e) { var t = jQuery.noData[(e.nodeName + " ").toLowerCase()], i = +e.nodeType || 1; return (1 === i || 9 === i) && (!t || !0 !== t && e.getAttribute("classid") === t) }, I = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, j = /([A-Z])/g; function dataAttr(e, t, i) { if (void 0 === i && 1 === e.nodeType) { var n = "data-" + t.replace(j, "-$1").toLowerCase(); if ("string" == typeof (i = e.getAttribute(n))) { try { i = "true" === i || "false" !== i && ("null" === i ? null : +i + "" === i ? +i : I.test(i) ? jQuery.parseJSON(i) : i) } catch (e) { } jQuery.data(e, t, i) } else i = void 0 } return i } function isEmptyDataObject(e) { var t; for (t in e) if (("data" !== t || !jQuery.isEmptyObject(e[t])) && "toJSON" !== t) return !1; return !0 } function internalData(e, t, n, o) { if (acceptData(e)) { var r, s, c = jQuery.expando, d = e.nodeType, u = d ? jQuery.cache : e, h = d ? e[c] : e[c] && c; if (h && u[h] && (o || u[h].data) || void 0 !== n || "string" != typeof t) return h || (h = d ? e[c] = i.pop() || jQuery.guid++ : c), u[h] || (u[h] = d ? {} : { toJSON: jQuery.noop }), "object" != typeof t && "function" != typeof t || (o ? u[h] = jQuery.extend(u[h], t) : u[h].data = jQuery.extend(u[h].data, t)), s = u[h], o || (s.data || (s.data = {}), s = s.data), void 0 !== n && (s[jQuery.camelCase(t)] = n), "string" == typeof t ? null == (r = s[t]) && (r = s[jQuery.camelCase(t)]) : r = s, r } } function internalRemoveData(e, t, i) { if (acceptData(e)) { var n, o, r = e.nodeType, s = r ? jQuery.cache : e, c = r ? e[jQuery.expando] : jQuery.expando; if (s[c]) { if (t && (n = i ? s[c] : s[c].data)) { o = (t = jQuery.isArray(t) ? t.concat(jQuery.map(t, jQuery.camelCase)) : t in n || (t = jQuery.camelCase(t)) in n ? [t] : t.split(" ")).length; for (; o--;)delete n[t[o]]; if (i ? !isEmptyDataObject(n) : !jQuery.isEmptyObject(n)) return } (i || (delete s[c].data, isEmptyDataObject(s[c]))) && (r ? jQuery.cleanData([e], !0) : p.deleteExpando || s != s.window ? delete s[c] : s[c] = void 0) } } } jQuery.extend({ cache: {}, noData: { "applet ": !0, "embed ": !0, "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function (e) { return !!(e = e.nodeType ? jQuery.cache[e[jQuery.expando]] : e[jQuery.expando]) && !isEmptyDataObject(e) }, data: function (e, t, i) { return internalData(e, t, i) }, removeData: function (e, t) { return internalRemoveData(e, t) }, _data: function (e, t, i) { return internalData(e, t, i, !0) }, _removeData: function (e, t) { return internalRemoveData(e, t, !0) } }), jQuery.fn.extend({ data: function (e, t) { var i, n, o, r = this[0], s = r && r.attributes; if (void 0 === e) { if (this.length && (o = jQuery.data(r), 1 === r.nodeType && !jQuery._data(r, "parsedAttrs"))) { for (i = s.length; i--;)s[i] && 0 === (n = s[i].name).indexOf("data-") && dataAttr(r, n = jQuery.camelCase(n.slice(5)), o[n]); jQuery._data(r, "parsedAttrs", !0) } return o } return "object" == typeof e ? this.each((function () { jQuery.data(this, e) })) : arguments.length > 1 ? this.each((function () { jQuery.data(this, e, t) })) : r ? dataAttr(r, e, jQuery.data(r, e)) : void 0 }, removeData: function (e) { return this.each((function () { jQuery.removeData(this, e) })) } }), jQuery.extend({ queue: function (e, t, i) { var n; if (e) return t = (t || "fx") + "queue", n = jQuery._data(e, t), i && (!n || jQuery.isArray(i) ? n = jQuery._data(e, t, jQuery.makeArray(i)) : n.push(i)), n || [] }, dequeue: function (e, t) { t = t || "fx"; var i = jQuery.queue(e, t), n = i.length, o = i.shift(), r = jQuery._queueHooks(e, t); "inprogress" === o && (o = i.shift(), n--), o && ("fx" === t && i.unshift("inprogress"), delete r.stop, o.call(e, (function () { jQuery.dequeue(e, t) }), r)), !n && r && r.empty.fire() }, _queueHooks: function (e, t) { var i = t + "queueHooks"; return jQuery._data(e, i) || jQuery._data(e, i, { empty: jQuery.Callbacks("once memory").add((function () { jQuery._removeData(e, t + "queue"), jQuery._removeData(e, i) })) }) } }), jQuery.fn.extend({ queue: function (e, t) { var i = 2; return "string" != typeof e && (t = e, e = "fx", i--), arguments.length < i ? jQuery.queue(this[0], e) : void 0 === t ? this : this.each((function () { var i = jQuery.queue(this, e, t); jQuery._queueHooks(this, e), "fx" === e && "inprogress" !== i[0] && jQuery.dequeue(this, e) })) }, dequeue: function (e) { return this.each((function () { jQuery.dequeue(this, e) })) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var i, n = 1, o = jQuery.Deferred(), r = this, s = this.length, resolve = function () { --n || o.resolveWith(r, [r]) }; for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; s--;)(i = jQuery._data(r[s], e + "queueHooks")) && i.empty && (n++, i.empty.add(resolve)); return resolve(), o.promise(t) } }), p.shrinkWrapBlocks = function () { return null != F ? F : (F = !1, (t = n.getElementsByTagName("body")[0]) && t.style ? (e = n.createElement("div"), (i = n.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", t.appendChild(i).appendChild(e), void 0 !== e.style.zoom && (e.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", e.appendChild(n.createElement("div")).style.width = "5px", F = 3 !== e.offsetWidth), t.removeChild(i), F) : void 0); var e, t, i }; var H = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, O = new RegExp("^(?:([+-])=|)(" + H + ")([a-z%]*)$", "i"), z = ["Top", "Right", "Bottom", "Left"], isHidden = function (e, t) { return e = t || e, "none" === jQuery.css(e, "display") || !jQuery.contains(e.ownerDocument, e) }; function adjustCSS(e, t, i, n) { var o, r = 1, s = 20, c = n ? function () { return n.cur() } : function () { return jQuery.css(e, t, "") }, d = c(), u = i && i[3] || (jQuery.cssNumber[t] ? "" : "px"), h = (jQuery.cssNumber[t] || "px" !== u && +d) && O.exec(jQuery.css(e, t)); if (h && h[3] !== u) { u = u || h[3], i = i || [], h = +d || 1; do { h /= r = r || ".5", jQuery.style(e, t, h + u) } while (r !== (r = c() / d) && 1 !== r && --s) } return i && (h = +h || +d || 0, o = i[1] ? h + (i[1] + 1) * i[2] : +i[2], n && (n.unit = u, n.start = h, n.end = o)), o } var P, R, B, access = function (e, t, i, n, o, r, s) { var c = 0, d = e.length, u = null == i; if ("object" === jQuery.type(i)) for (c in o = !0, i) access(e, t, c, i[c], !0, r, s); else if (void 0 !== n && (o = !0, jQuery.isFunction(n) || (s = !0), u && (s ? (t.call(e, n), t = null) : (u = t, t = function (e, t, i) { return u.call(jQuery(e), i) })), t)) for (; c < d; c++)t(e[c], i, s ? n : n.call(e[c], c, t(e[c], i))); return o ? e : u ? t.call(e) : d ? t(e[0], i) : r }, W = /^(?:checkbox|radio)$/i, Y = /<([\w:-]+)/, X = /^$|\/(?:java|ecma)script/i, U = /^\s+/, K = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video"; function createSafeFragment(e) { var t = K.split("|"), i = e.createDocumentFragment(); if (i.createElement) for (; t.length;)i.createElement(t.pop()); return i } P = n.createElement("div"), R = n.createDocumentFragment(), B = n.createElement("input"), P.innerHTML = "
a", p.leadingWhitespace = 3 === P.firstChild.nodeType, p.tbody = !P.getElementsByTagName("tbody").length, p.htmlSerialize = !!P.getElementsByTagName("link").length, p.html5Clone = "<:nav>" !== n.createElement("nav").cloneNode(!0).outerHTML, B.type = "checkbox", B.checked = !0, R.appendChild(B), p.appendChecked = B.checked, P.innerHTML = "", p.noCloneChecked = !!P.cloneNode(!0).lastChild.defaultValue, R.appendChild(P), (B = n.createElement("input")).setAttribute("type", "radio"), B.setAttribute("checked", "checked"), B.setAttribute("name", "t"), P.appendChild(B), p.checkClone = P.cloneNode(!0).cloneNode(!0).lastChild.checked, p.noCloneEvent = !!P.addEventListener, P[jQuery.expando] = 1, p.attributes = !P.getAttribute(jQuery.expando); var V = { option: [1, ""], legend: [1, "
", "
"], area: [1, "", ""], param: [1, "", ""], thead: [1, "", "
"], tr: [2, "", "
"], col: [2, "", "
"], td: [3, "", "
"], _default: p.htmlSerialize ? [0, "", ""] : [1, "X
", "
"] }; function getAll(e, t) { var i, n, o = 0, r = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : void 0; if (!r) for (r = [], i = e.childNodes || e; null != (n = i[o]); o++)!t || jQuery.nodeName(n, t) ? r.push(n) : jQuery.merge(r, getAll(n, t)); return void 0 === t || t && jQuery.nodeName(e, t) ? jQuery.merge([e], r) : r } function setGlobalEval(e, t) { for (var i, n = 0; null != (i = e[n]); n++)jQuery._data(i, "globalEval", !t || jQuery._data(t[n], "globalEval")) } V.optgroup = V.option, V.tbody = V.tfoot = V.colgroup = V.caption = V.thead, V.th = V.td; var G = /<|&#?\w+;/, J = /" !== y[1] || J.test(s) ? 0 : d : d.firstChild) && s.childNodes.length; r--;)jQuery.nodeName(h = s.childNodes[r], "tbody") && !h.childNodes.length && s.removeChild(h); for (jQuery.merge(b, d.childNodes), d.textContent = ""; d.firstChild;)d.removeChild(d.firstChild); d = g.lastChild } else b.push(t.createTextNode(s)); for (d && g.removeChild(d), p.appendChecked || jQuery.grep(getAll(b, "input"), fixDefaultChecked), k = 0; s = b[k++];)if (n && jQuery.inArray(s, n) > -1) o && o.push(s); else if (c = jQuery.contains(s.ownerDocument, s), d = getAll(g.appendChild(s), "script"), c && setGlobalEval(d), i) for (r = 0; s = d[r++];)X.test(s.type || "") && i.push(s); return d = null, g } !function () { var t, i, o = n.createElement("div"); for (t in { submit: !0, change: !0, focusin: !0 }) i = "on" + t, (p[t] = i in e) || (o.setAttribute(i, "t"), p[t] = !1 === o.attributes[i].expando); o = null }(); var Z = /^(?:input|select|textarea)$/i, Q = /^key/, ee = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, te = /^(?:focusinfocus|focusoutblur)$/, ie = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return !0 } function returnFalse() { return !1 } function safeActiveElement() { try { return n.activeElement } catch (e) { } } function on(e, t, i, n, o, r) { var s, c; if ("object" == typeof t) { for (c in "string" != typeof i && (n = n || i, i = void 0), t) on(e, c, i, n, t[c], r); return e } if (null == n && null == o ? (o = i, n = i = void 0) : null == o && ("string" == typeof i ? (o = n, n = void 0) : (o = n, n = i, i = void 0)), !1 === o) o = returnFalse; else if (!o) return e; return 1 === r && (s = o, (o = function (e) { return jQuery().off(e), s.apply(this, arguments) }).guid = s.guid || (s.guid = jQuery.guid++)), e.each((function () { jQuery.event.add(this, t, o, n, i) })) } jQuery.event = { global: {}, add: function (e, t, i, n, o) { var r, s, c, d, u, h, p, y, m, g, b, k = jQuery._data(e); if (k) { for (i.handler && (i = (d = i).handler, o = d.selector), i.guid || (i.guid = jQuery.guid++), (s = k.events) || (s = k.events = {}), (h = k.handle) || ((h = k.handle = function (e) { return void 0 === jQuery || e && jQuery.event.triggered === e.type ? void 0 : jQuery.event.dispatch.apply(h.elem, arguments) }).elem = e), c = (t = (t || "").match(_) || [""]).length; c--;)m = b = (r = ie.exec(t[c]) || [])[1], g = (r[2] || "").split(".").sort(), m && (u = jQuery.event.special[m] || {}, m = (o ? u.delegateType : u.bindType) || m, u = jQuery.event.special[m] || {}, p = jQuery.extend({ type: m, origType: b, data: n, handler: i, guid: i.guid, selector: o, needsContext: o && jQuery.expr.match.needsContext.test(o), namespace: g.join(".") }, d), (y = s[m]) || ((y = s[m] = []).delegateCount = 0, u.setup && !1 !== u.setup.call(e, n, g, h) || (e.addEventListener ? e.addEventListener(m, h, !1) : e.attachEvent && e.attachEvent("on" + m, h))), u.add && (u.add.call(e, p), p.handler.guid || (p.handler.guid = i.guid)), o ? y.splice(y.delegateCount++, 0, p) : y.push(p), jQuery.event.global[m] = !0); e = null } }, remove: function (e, t, i, n, o) { var r, s, c, d, u, h, p, y, m, g, b, k = jQuery.hasData(e) && jQuery._data(e); if (k && (h = k.events)) { for (u = (t = (t || "").match(_) || [""]).length; u--;)if (m = b = (c = ie.exec(t[u]) || [])[1], g = (c[2] || "").split(".").sort(), m) { for (p = jQuery.event.special[m] || {}, y = h[m = (n ? p.delegateType : p.bindType) || m] || [], c = c[2] && new RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)"), d = r = y.length; r--;)s = y[r], !o && b !== s.origType || i && i.guid !== s.guid || c && !c.test(s.namespace) || n && n !== s.selector && ("**" !== n || !s.selector) || (y.splice(r, 1), s.selector && y.delegateCount--, p.remove && p.remove.call(e, s)); d && !y.length && (p.teardown && !1 !== p.teardown.call(e, g, k.handle) || jQuery.removeEvent(e, m, k.handle), delete h[m]) } else for (m in h) jQuery.event.remove(e, m + t[u], i, n, !0); jQuery.isEmptyObject(h) && (delete k.handle, jQuery._removeData(e, "events")) } }, trigger: function (t, i, o, r) { var s, c, d, u, p, y, m, g = [o || n], b = h.call(t, "type") ? t.type : t, k = h.call(t, "namespace") ? t.namespace.split(".") : []; if (d = y = o = o || n, 3 !== o.nodeType && 8 !== o.nodeType && !te.test(b + jQuery.event.triggered) && (b.indexOf(".") > -1 && (k = b.split("."), b = k.shift(), k.sort()), c = b.indexOf(":") < 0 && "on" + b, (t = t[jQuery.expando] ? t : new jQuery.Event(b, "object" == typeof t && t)).isTrigger = r ? 2 : 3, t.namespace = k.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + k.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), i = null == i ? [t] : jQuery.makeArray(i, [t]), p = jQuery.event.special[b] || {}, r || !p.trigger || !1 !== p.trigger.apply(o, i))) { if (!r && !p.noBubble && !jQuery.isWindow(o)) { for (u = p.delegateType || b, te.test(u + b) || (d = d.parentNode); d; d = d.parentNode)g.push(d), y = d; y === (o.ownerDocument || n) && g.push(y.defaultView || y.parentWindow || e) } for (m = 0; (d = g[m++]) && !t.isPropagationStopped();)t.type = m > 1 ? u : p.bindType || b, (s = (jQuery._data(d, "events") || {})[t.type] && jQuery._data(d, "handle")) && s.apply(d, i), (s = c && d[c]) && s.apply && acceptData(d) && (t.result = s.apply(d, i), !1 === t.result && t.preventDefault()); if (t.type = b, !r && !t.isDefaultPrevented() && (!p._default || !1 === p._default.apply(g.pop(), i)) && acceptData(o) && c && o[b] && !jQuery.isWindow(o)) { (y = o[c]) && (o[c] = null), jQuery.event.triggered = b; try { o[b]() } catch (e) { } jQuery.event.triggered = void 0, y && (o[c] = y) } return t.result } }, dispatch: function (e) { e = jQuery.event.fix(e); var t, i, n, r, s, c = [], d = o.call(arguments), u = (jQuery._data(this, "events") || {})[e.type] || [], h = jQuery.event.special[e.type] || {}; if (d[0] = e, e.delegateTarget = this, !h.preDispatch || !1 !== h.preDispatch.call(this, e)) { for (c = jQuery.event.handlers.call(this, e, u), t = 0; (r = c[t++]) && !e.isPropagationStopped();)for (e.currentTarget = r.elem, i = 0; (s = r.handlers[i++]) && !e.isImmediatePropagationStopped();)e.rnamespace && !e.rnamespace.test(s.namespace) || (e.handleObj = s, e.data = s.data, void 0 !== (n = ((jQuery.event.special[s.origType] || {}).handle || s.handler).apply(r.elem, d)) && !1 === (e.result = n) && (e.preventDefault(), e.stopPropagation())); return h.postDispatch && h.postDispatch.call(this, e), e.result } }, handlers: function (e, t) { var i, n, o, r, s = [], c = t.delegateCount, d = e.target; if (c && d.nodeType && ("click" !== e.type || isNaN(e.button) || e.button < 1)) for (; d != this; d = d.parentNode || this)if (1 === d.nodeType && (!0 !== d.disabled || "click" !== e.type)) { for (n = [], i = 0; i < c; i++)void 0 === n[o = (r = t[i]).selector + " "] && (n[o] = r.needsContext ? jQuery(o, this).index(d) > -1 : jQuery.find(o, this, null, [d]).length), n[o] && n.push(r); n.length && s.push({ elem: d, handlers: n }) } return c < t.length && s.push({ elem: this, handlers: t.slice(c) }), s }, fix: function (e) { if (e[jQuery.expando]) return e; var t, i, o, r = e.type, s = e, c = this.fixHooks[r]; for (c || (this.fixHooks[r] = c = ee.test(r) ? this.mouseHooks : Q.test(r) ? this.keyHooks : {}), o = c.props ? this.props.concat(c.props) : this.props, e = new jQuery.Event(s), t = o.length; t--;)e[i = o[t]] = s[i]; return e.target || (e.target = s.srcElement || n), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, c.filter ? c.filter(e, s) : e }, props: "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, t) { var i, o, r, s = t.button, c = t.fromElement; return null == e.pageX && null != t.clientX && (r = (o = e.target.ownerDocument || n).documentElement, i = o.body, e.pageX = t.clientX + (r && r.scrollLeft || i && i.scrollLeft || 0) - (r && r.clientLeft || i && i.clientLeft || 0), e.pageY = t.clientY + (r && r.scrollTop || i && i.scrollTop || 0) - (r && r.clientTop || i && i.clientTop || 0)), !e.relatedTarget && c && (e.relatedTarget = c === e.target ? t.toElement : c), e.which || void 0 === s || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e } }, special: { load: { noBubble: !0 }, focus: { trigger: function () { if (this !== safeActiveElement() && this.focus) try { return this.focus(), !1 } catch (e) { } }, delegateType: "focusin" }, blur: { trigger: function () { if (this === safeActiveElement() && this.blur) return this.blur(), !1 }, delegateType: "focusout" }, click: { trigger: function () { if (jQuery.nodeName(this, "input") && "checkbox" === this.type && this.click) return this.click(), !1 }, _default: function (e) { return jQuery.nodeName(e.target, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, i) { var n = jQuery.extend(new jQuery.Event, i, { type: e, isSimulated: !0 }); jQuery.event.trigger(n, null, t), n.isDefaultPrevented() && i.preventDefault() } }, jQuery.removeEvent = n.removeEventListener ? function (e, t, i) { e.removeEventListener && e.removeEventListener(t, i) } : function (e, t, i) { var n = "on" + t; e.detachEvent && (void 0 === e[n] && (e[n] = null), e.detachEvent(n, i)) }, jQuery.Event = function (e, t) { if (!(this instanceof jQuery.Event)) return new jQuery.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? returnTrue : returnFalse) : this.type = e, t && jQuery.extend(this, t), this.timeStamp = e && e.timeStamp || jQuery.now(), this[jQuery.expando] = !0 }, jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue, e && !this.isSimulated && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation() } }, jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, (function (e, t) { jQuery.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var i, n = this, o = e.relatedTarget, r = e.handleObj; return o && (o === n || jQuery.contains(n, o)) || (e.type = r.origType, i = r.handler.apply(this, arguments), e.type = t), i } } })), p.submit || (jQuery.event.special.submit = { setup: function () { if (jQuery.nodeName(this, "form")) return !1; jQuery.event.add(this, "click._submit keypress._submit", (function (e) { var t = e.target, i = jQuery.nodeName(t, "input") || jQuery.nodeName(t, "button") ? jQuery.prop(t, "form") : void 0; i && !jQuery._data(i, "submit") && (jQuery.event.add(i, "submit._submit", (function (e) { e._submitBubble = !0 })), jQuery._data(i, "submit", !0)) })) }, postDispatch: function (e) { e._submitBubble && (delete e._submitBubble, this.parentNode && !e.isTrigger && jQuery.event.simulate("submit", this.parentNode, e)) }, teardown: function () { if (jQuery.nodeName(this, "form")) return !1; jQuery.event.remove(this, "._submit") } }), p.change || (jQuery.event.special.change = { setup: function () { if (Z.test(this.nodeName)) return "checkbox" !== this.type && "radio" !== this.type || (jQuery.event.add(this, "propertychange._change", (function (e) { "checked" === e.originalEvent.propertyName && (this._justChanged = !0) })), jQuery.event.add(this, "click._change", (function (e) { this._justChanged && !e.isTrigger && (this._justChanged = !1), jQuery.event.simulate("change", this, e) }))), !1; jQuery.event.add(this, "beforeactivate._change", (function (e) { var t = e.target; Z.test(t.nodeName) && !jQuery._data(t, "change") && (jQuery.event.add(t, "change._change", (function (e) { !this.parentNode || e.isSimulated || e.isTrigger || jQuery.event.simulate("change", this.parentNode, e) })), jQuery._data(t, "change", !0)) })) }, handle: function (e) { var t = e.target; if (this !== t || e.isSimulated || e.isTrigger || "radio" !== t.type && "checkbox" !== t.type) return e.handleObj.handler.apply(this, arguments) }, teardown: function () { return jQuery.event.remove(this, "._change"), !Z.test(this.nodeName) } }), p.focusin || jQuery.each({ focus: "focusin", blur: "focusout" }, (function (e, t) { var handler = function (e) { jQuery.event.simulate(t, e.target, jQuery.event.fix(e)) }; jQuery.event.special[t] = { setup: function () { var i = this.ownerDocument || this, n = jQuery._data(i, t); n || i.addEventListener(e, handler, !0), jQuery._data(i, t, (n || 0) + 1) }, teardown: function () { var i = this.ownerDocument || this, n = jQuery._data(i, t) - 1; n ? jQuery._data(i, t, n) : (i.removeEventListener(e, handler, !0), jQuery._removeData(i, t)) } } })), jQuery.fn.extend({ on: function (e, t, i, n) { return on(this, e, t, i, n) }, one: function (e, t, i, n) { return on(this, e, t, i, n, 1) }, off: function (e, t, i) { var n, o; if (e && e.preventDefault && e.handleObj) return n = e.handleObj, jQuery(e.delegateTarget).off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this; if ("object" == typeof e) { for (o in e) this.off(o, t, e[o]); return this } return !1 !== t && "function" != typeof t || (i = t, t = void 0), !1 === i && (i = returnFalse), this.each((function () { jQuery.event.remove(this, e, i, t) })) }, trigger: function (e, t) { return this.each((function () { jQuery.event.trigger(e, t, this) })) }, triggerHandler: function (e, t) { var i = this[0]; if (i) return jQuery.event.trigger(e, t, i, !0) } }); var ae = / jQuery\d+="(?:null|\d+)"/g, ne = new RegExp("<(?:" + K + ")[\\s/>]", "i"), le = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, oe = /\s*$/g, de = createSafeFragment(n).appendChild(n.createElement("div")); function manipulationTarget(e, t) { return jQuery.nodeName(e, "table") && jQuery.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e } function disableScript(e) { return e.type = (null !== jQuery.find.attr(e, "type")) + "/" + e.type, e } function restoreScript(e) { var t = se.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function cloneCopyEvent(e, t) { if (1 === t.nodeType && jQuery.hasData(e)) { var i, n, o, r = jQuery._data(e), s = jQuery._data(t, r), c = r.events; if (c) for (i in delete s.handle, s.events = {}, c) for (n = 0, o = c[i].length; n < o; n++)jQuery.event.add(t, i, c[i][n]); s.data && (s.data = jQuery.extend({}, s.data)) } } function fixCloneNodeIssues(e, t) { var i, n, o; if (1 === t.nodeType) { if (i = t.nodeName.toLowerCase(), !p.noCloneEvent && t[jQuery.expando]) { for (n in (o = jQuery._data(t)).events) jQuery.removeEvent(t, n, o.handle); t.removeAttribute(jQuery.expando) } "script" === i && t.text !== e.text ? (disableScript(t).text = e.text, restoreScript(t)) : "object" === i ? (t.parentNode && (t.outerHTML = e.outerHTML), p.html5Clone && e.innerHTML && !jQuery.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === i && W.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === i ? t.defaultSelected = t.selected = e.defaultSelected : "input" !== i && "textarea" !== i || (t.defaultValue = e.defaultValue) } } function domManip(e, t, i, n) { t = r.apply([], t); var o, s, c, d, u, h, y = 0, m = e.length, g = m - 1, b = t[0], k = jQuery.isFunction(b); if (k || m > 1 && "string" == typeof b && !p.checkClone && re.test(b)) return e.each((function (o) { var r = e.eq(o); k && (t[0] = b.call(this, o, r.html())), domManip(r, t, i, n) })); if (m && (o = (h = buildFragment(t, e[0].ownerDocument, !1, e, n)).firstChild, 1 === h.childNodes.length && (h = o), o || n)) { for (c = (d = jQuery.map(getAll(h, "script"), disableScript)).length; y < m; y++)s = h, y !== g && (s = jQuery.clone(s, !0, !0), c && jQuery.merge(d, getAll(s, "script"))), i.call(e[y], s, y); if (c) for (u = d[d.length - 1].ownerDocument, jQuery.map(d, restoreScript), y = 0; y < c; y++)s = d[y], X.test(s.type || "") && !jQuery._data(s, "globalEval") && jQuery.contains(u, s) && (s.src ? jQuery._evalUrl && jQuery._evalUrl(s.src) : jQuery.globalEval((s.text || s.textContent || s.innerHTML || "").replace(ce, ""))); h = o = null } return e } function remove(e, t, i) { for (var n, o = t ? jQuery.filter(t, e) : e, r = 0; null != (n = o[r]); r++)i || 1 !== n.nodeType || jQuery.cleanData(getAll(n)), n.parentNode && (i && jQuery.contains(n.ownerDocument, n) && setGlobalEval(getAll(n, "script")), n.parentNode.removeChild(n)); return e } jQuery.extend({ htmlPrefilter: function (e) { return e.replace(le, "<$1>") }, clone: function (e, t, i) { var n, o, r, s, c, d = jQuery.contains(e.ownerDocument, e); if (p.html5Clone || jQuery.isXMLDoc(e) || !ne.test("<" + e.nodeName + ">") ? r = e.cloneNode(!0) : (de.innerHTML = e.outerHTML, de.removeChild(r = de.firstChild)), !(p.noCloneEvent && p.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || jQuery.isXMLDoc(e))) for (n = getAll(r), c = getAll(e), s = 0; null != (o = c[s]); ++s)n[s] && fixCloneNodeIssues(o, n[s]); if (t) if (i) for (c = c || getAll(e), n = n || getAll(r), s = 0; null != (o = c[s]); s++)cloneCopyEvent(o, n[s]); else cloneCopyEvent(e, r); return (n = getAll(r, "script")).length > 0 && setGlobalEval(n, !d && getAll(e, "script")), n = c = o = null, r }, cleanData: function (e, t) { for (var n, o, r, s, c = 0, d = jQuery.expando, u = jQuery.cache, h = p.attributes, y = jQuery.event.special; null != (n = e[c]); c++)if ((t || acceptData(n)) && (s = (r = n[d]) && u[r])) { if (s.events) for (o in s.events) y[o] ? jQuery.event.remove(n, o) : jQuery.removeEvent(n, o, s.handle); u[r] && (delete u[r], h || void 0 === n.removeAttribute ? n[d] = void 0 : n.removeAttribute(d), i.push(r)) } } }), jQuery.fn.extend({ domManip: domManip, detach: function (e) { return remove(this, e, !0) }, remove: function (e) { return remove(this, e) }, text: function (e) { return access(this, (function (e) { return void 0 === e ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || n).createTextNode(e)) }), null, e, arguments.length) }, append: function () { return domManip(this, arguments, (function (e) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || manipulationTarget(this, e).appendChild(e) })) }, prepend: function () { return domManip(this, arguments, (function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = manipulationTarget(this, e); t.insertBefore(e, t.firstChild) } })) }, before: function () { return domManip(this, arguments, (function (e) { this.parentNode && this.parentNode.insertBefore(e, this) })) }, after: function () { return domManip(this, arguments, (function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) })) }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++) { for (1 === e.nodeType && jQuery.cleanData(getAll(e, !1)); e.firstChild;)e.removeChild(e.firstChild); e.options && jQuery.nodeName(e, "select") && (e.options.length = 0) } return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map((function () { return jQuery.clone(this, e, t) })) }, html: function (e) { return access(this, (function (e) { var t = this[0] || {}, i = 0, n = this.length; if (void 0 === e) return 1 === t.nodeType ? t.innerHTML.replace(ae, "") : void 0; if ("string" == typeof e && !oe.test(e) && (p.htmlSerialize || !ne.test(e)) && (p.leadingWhitespace || !U.test(e)) && !V[(Y.exec(e) || ["", ""])[1].toLowerCase()]) { e = jQuery.htmlPrefilter(e); try { for (; i < n; i++)1 === (t = this[i] || {}).nodeType && (jQuery.cleanData(getAll(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }), null, e, arguments.length) }, replaceWith: function () { var e = []; return domManip(this, arguments, (function (t) { var i = this.parentNode; jQuery.inArray(this, e) < 0 && (jQuery.cleanData(getAll(this)), i && i.replaceChild(t, this)) }), e) } }), jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, (function (e, t) { jQuery.fn[e] = function (e) { for (var i, n = 0, o = [], r = jQuery(e), c = r.length - 1; n <= c; n++)i = n === c ? this : this.clone(!0), jQuery(r[n])[t](i), s.apply(o, i.get()); return this.pushStack(o) } })); var ue, fe = { HTML: "block", BODY: "block" }; function actualDisplay(e, t) { var i = jQuery(t.createElement(e)).appendTo(t.body), n = jQuery.css(i[0], "display"); return i.detach(), n } function defaultDisplay(e) { var t = n, i = fe[e]; return i || ("none" !== (i = actualDisplay(e, t)) && i || ((t = ((ue = (ue || jQuery("', "", ""].join("")); return o.ie && o.ie < 8 ? u.removeClass("layui-hide").addClass("layui-show") : (p[0] && p.remove(), setIframe.call(this, g, u[0], y), u.addClass("layui-hide").after(g), this.index) }, Edit.prototype.getContent = function (e) { var t = getWin(e); if (t[0]) return toLower(t[0].document.body.innerHTML) }, Edit.prototype.getText = function (e) { var i = getWin(e); if (i[0]) return t(i[0].document.body).text() }, Edit.prototype.setContent = function (e, i, n) { var o = getWin(e); o[0] && (n ? t(o[0].document.body).append(i) : t(o[0].document.body).html(i), layedit.sync(e)) }, Edit.prototype.sync = function (e) { var i = getWin(e); i[0] && t("#" + i[1].attr("textarea")).val(toLower(i[0].document.body.innerHTML)) }, Edit.prototype.getSelection = function (e) { var t = getWin(e); if (t[0]) { var i = Range(t[0].document); return document.selection ? i.text : i.toString() } }; var setIframe = function (e, i, n) { var o = this, r = e.find("iframe"); r.css({ height: n.height }).on("load", (function () { var s = r.contents(), c = r.prop("contentWindow"), d = s.find("head"), u = t([""].join("")), h = s.find("body"); d.append(u), h.attr("contenteditable", "true").css({ "min-height": n.height }).html(i.value || ""), hotkey.apply(o, [c, r, i, n]), toolActive.call(o, c, e, n) })) }, getWin = function (e) { var i = t("#LAY_layedit_" + e); return [i.prop("contentWindow"), i] }, toLower = function (e) { return 8 == o.ie && (e = e.replace(/<.+>/g, (function (e) { return e.toLowerCase() }))), e }, hotkey = function (e, n, r, s) { var c = e.document, d = t(c.body); d.on("keydown", (function (e) { if (13 === e.keyCode) { var t = Range(c); if ("pre" === getContainer(t).parentNode.tagName.toLowerCase()) { if (e.shiftKey) return; return i.msg("请暂时用shift+enter"), !1 } c.execCommand("formatBlock", !1, "

") } })), t(r).parents("form").on("submit", (function () { var e = d.html(); 8 == o.ie && (e = e.replace(/<.+>/g, (function (e) { return e.toLowerCase() }))), r.value = e })), d.on("paste", (function (t) { c.execCommand("formatBlock", !1, "

"), setTimeout((function () { filter.call(e, d), r.value = d.html() }), 100) })) }, filter = function (e) { this.document; e.find("*[style]").each((function () { var e = this.style.textAlign; this.removeAttribute("style"), t(this).css({ "text-align": e || "" }) })), e.find("table").addClass("layui-table"), e.find("script,link").remove() }, Range = function (e) { return e.selection ? e.selection.createRange() : e.getSelection().getRangeAt(0) }, getContainer = function (e) { return e.endContainer || e.parentElement().childNodes[0] }, insertInline = function (e, i, n) { var o = this.document, r = document.createElement(e); for (var s in i) r.setAttribute(s, i[s]); if (r.removeAttribute("text"), o.selection) { var c = n.text || i.text; if ("a" === e && !c) return; c && (r.innerHTML = c), n.pasteHTML(t(r).prop("outerHTML")), n.select() } else { c = n.toString() || i.text; if ("a" === e && !c) return; c && (r.innerHTML = c), n.deleteContents(), n.insertNode(r) } }, toolCheck = function (e, i) { var n = this.document, o = "layedit-tool-active", s = getContainer(Range(n)), item = function (t) { return e.find(".layedit-tool-" + t) }; i && i[i.hasClass(o) ? "removeClass" : "addClass"](o), e.find(">i").removeClass(o), item("unlink").addClass(r), t(s).parents().each((function () { var e = this.tagName.toLowerCase(), t = this.style.textAlign; "b" !== e && "strong" !== e || item("b").addClass(o), "i" !== e && "em" !== e || item("i").addClass(o), "u" === e && item("u").addClass(o), "strike" === e && item("d").addClass(o), "p" === e && ("center" === t ? item("center").addClass(o) : "right" === t ? item("right").addClass(o) : item("left").addClass(o)), "a" === e && (item("link").addClass(o), item("unlink").removeClass(r)) })) }, toolActive = function (e, n, o) { var s = e.document, c = t(s.body), d = { link: function (i) { var n = getContainer(i), o = t(n).parent(); link.call(c, { href: o.attr("href"), target: o.attr("target") }, (function (t) { var n = o[0]; "A" === n.tagName ? n.href = t.url : insertInline.call(e, "a", { target: t.target, href: t.url, text: t.url }, i) })) }, unlink: function (e) { s.execCommand("unlink") }, face: function (t) { face.call(this, (function (i) { insertInline.call(e, "img", { src: i.src, alt: i.alt }, t) })) }, image: function (n) { var r = this; layui.use("upload", (function (s) { var c = o.uploadImage || {}; s.render({ url: c.url, method: c.type, elem: t(r).find("input")[0], done: function (t) { 0 == t.code ? (t.data = t.data || {}, insertInline.call(e, "img", { src: t.data.src, alt: t.data.title }, n)) : i.msg(t.msg || "上传失败") } }) })) }, code: function (t) { code.call(c, (function (i) { insertInline.call(e, "pre", { text: i.code, "lay-lang": i.lang }, t) })) }, help: function () { i.open({ type: 2, title: "帮助", area: ["600px", "380px"], shadeClose: !0, shade: .1, skin: "layui-layer-msg", content: ["http://www.layui.com/about/layedit/help.html", "no"] }) } }, u = n.find(".layui-layedit-tool"), click = function () { var i = t(this), n = i.attr("layedit-event"), o = i.attr("lay-command"); if (!i.hasClass(r)) { c.focus(); var h = Range(s); h.commonAncestorContainer; o ? (s.execCommand(o), /justifyLeft|justifyCenter|justifyRight/.test(o) && s.execCommand("formatBlock", !1, "

"), setTimeout((function () { c.focus() }), 10)) : d[n] && d[n].call(this, h), toolCheck.call(e, u, i) } }, h = /image/; u.find(">i").on("mousedown", (function () { var e = t(this).attr("layedit-event"); h.test(e) || click.call(this) })).on("click", (function () { var e = t(this).attr("layedit-event"); h.test(e) && click.call(this) })), c.on("click", (function () { toolCheck.call(e, u), i.close(face.index) })) }, link = function (e, t) { var o = this, r = i.open({ type: 1, id: "LAY_layedit_link", area: "350px", shade: .05, shadeClose: !0, moveType: 1, title: "超链接", skin: "layui-layer-msg", content: ['

"].join(""), success: function (e, r) { n.render("radio"), e.find(".layui-btn-primary").on("click", (function () { i.close(r), o.focus() })), n.on("submit(layedit-link-yes)", (function (e) { i.close(link.index), t && t(e.field) })) } }); link.index = r }, face = function (e) { var n, o, r = (n = {}, layui.each(["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"], (function (e, t) { n[t] = layui.cache.dir + "images/face/" + e + ".gif" })), n); return face.hide = face.hide || function (e) { "face" !== t(e.target).attr("layedit-event") && i.close(face.index) }, face.index = i.tips((o = [], layui.each(r, (function (e, t) { o.push('
  • ' + e + '
  • ') })), '"), this, { tips: 1, time: 0, skin: "layui-box layui-util-face", maxWidth: 500, success: function (n, o) { n.css({ marginTop: -4, marginLeft: -10 }).find(".layui-clear>li").on("click", (function () { e && e({ src: r[this.title], alt: this.title }), i.close(o) })), t(document).off("click", face.hide).on("click", face.hide) } }) }, code = function (e) { var t = this, o = i.open({ type: 1, id: "LAY_layedit_code", area: "550px", shade: .05, shadeClose: !0, moveType: 1, title: "插入代码", skin: "layui-layer-msg", content: ['"].join(""), success: function (o, r) { n.render("select"), o.find(".layui-btn-primary").on("click", (function () { i.close(r), t.focus() })), n.on("submit(layedit-code-yes)", (function (t) { i.close(code.index), e && e(t.field) })) } }); code.index = o }, s = { html: '', strong: '', italic: '', underline: '', del: '', "|": '', left: '', center: '', right: '', link: '', unlink: '', face: '', image: '', code: '', help: '' }; e("layedit", new Edit) })) }, function (e, t, i) { var n, o; /** @Name:layer v3.1.2 Web弹层组件 @Author:贤心 @Site:http://layer.layui.com @License:MIT */!function (r, s) { "use strict"; var c, d, u, h, p = r.layui && layui.define, y = { getPath: (u = document.currentScript ? document.currentScript.src : function () { for (var e, t = document.scripts, i = t.length - 1, n = i; n > 0; n--)if ("interactive" === t[n].readyState) { e = t[n].src; break } return e || t[i].src }(), u.substring(0, u.lastIndexOf("/") + 1)), config: {}, end: {}, minIndex: 0, minLeft: [], btn: ["确定", "取消"], type: ["dialog", "page", "iframe", "loading", "tips"], getStyle: function (e, t) { var i = e.currentStyle ? e.currentStyle : r.getComputedStyle(e, null); return i[i.getPropertyValue ? "getPropertyValue" : "getAttribute"](t) }, link: function (e, t, i) { if (m.path) { var n = document.getElementsByTagName("head")[0], o = document.createElement("link"); "string" == typeof t && (i = t); var s = "layuicss-" + (i || e).replace(/\.|\//g, ""), c = 0; o.rel = "stylesheet", o.href = m.path + e, o.id = s, document.getElementById(s) || n.appendChild(o), "function" == typeof t && function poll() { if (++c > 80) return r.console && void 0; 1989 === parseInt(y.getStyle(document.getElementById(s), "width")) ? t() : setTimeout(poll, 100) }() } } }, m = { v: "3.1.1", ie: (h = navigator.userAgent.toLowerCase(), !(!r.ActiveXObject && !("ActiveXObject" in r)) && ((h.match(/msie\s(\d+)/) || [])[1] || "11")), index: r.layer && r.layer.v ? 1e5 : 0, path: y.getPath, config: function (e, t) { return e = e || {}, m.cache = y.config = c.extend({}, y.config, e), m.path = y.config.path || m.path, "string" == typeof e.extend && (e.extend = [e.extend]), y.config.path && m.ready(), e.extend ? (p ? layui.addcss("modules/layer/" + e.extend) : y.link("theme/" + e.extend), this) : this }, ready: function (e) { var t = (p ? "modules/layer/" : "theme/") + "default/layer.css?v=" + m.v; return p ? layui.addcss(t, e, "layer") : y.link(t, e, "layer"), this }, alert: function (e, t, i) { var n = "function" == typeof t; return n && (i = t), m.open(c.extend({ content: e, yes: i }, n ? {} : t)) }, confirm: function (e, t, i, n) { var o = "function" == typeof t; return o && (n = i, i = t), m.open(c.extend({ content: e, btn: y.btn, yes: i, btn2: n }, o ? {} : t)) }, msg: function (e, t, i) { var n = "function" == typeof t, o = y.config.skin, r = (o ? o + " " + o + "-msg" : "") || "layui-layer-msg", s = g.anim.length - 1; return n && (i = t), m.open(c.extend({ content: e, time: 3e3, shade: !1, skin: r, title: !1, closeBtn: !1, btn: !1, resize: !1, end: i }, n && !y.config.skin ? { skin: r + " layui-layer-hui", anim: s } : ((-1 === (t = t || {}).icon || void 0 === t.icon && !y.config.skin) && (t.skin = r + " " + (t.skin || "layui-layer-hui")), t))) }, load: function (e, t) { return m.open(c.extend({ type: 3, icon: e || 0, resize: !1, shade: .01 }, t)) }, tips: function (e, t, i) { return m.open(c.extend({ type: 4, content: [e, t], closeBtn: !1, time: 3e3, shade: !1, resize: !1, fixed: !1, maxWidth: 210 }, i)) } }, Class = function (e) { var t = this; t.index = ++m.index, t.config = c.extend({}, t.config, y.config, e), document.body ? t.creat() : setTimeout((function () { t.creat() }), 30) }; Class.pt = Class.prototype; var g = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; g.anim = ["layer-anim-00", "layer-anim-01", "layer-anim-02", "layer-anim-03", "layer-anim-04", "layer-anim-05", "layer-anim-06"], Class.pt.config = { type: 0, shade: .3, fixed: !0, move: g[1], title: "信息", offset: "auto", area: "auto", closeBtn: 1, time: 0, zIndex: 19891014, maxWidth: 360, anim: 0, isOutAnim: !0, icon: -1, moveType: 1, resize: !0, scrollbar: !0, tips: 2 }, Class.pt.vessel = function (e, t) { var i, n = this.index, o = this.config, r = o.zIndex + n, s = "object" == typeof o.title, d = o.maxmin && (1 === o.type || 2 === o.type), u = o.title ? '
    ' + (s ? o.title[0] : o.title) + "
    " : ""; return o.zIndex = r, t([o.shade ? '
    ' : "", '
    ' + (e && 2 != o.type ? "" : u) + '
    ' + (0 == o.type && -1 !== o.icon ? '' : "") + (1 == o.type && e ? "" : o.content || "") + '
    ' + (i = d ? '' : "", o.closeBtn && (i += ''), i + "") + (o.btn ? function () { var e = ""; "string" == typeof o.btn && (o.btn = [o.btn]); for (var t = 0, i = o.btn.length; t < i; t++)e += '' + o.btn[t] + ""; return '
    ' + e + "
    " }() : "") + (o.resize ? '' : "") + "
    "], u, c('
    ')), this }, Class.pt.creat = function () { var e = this, t = e.config, i = e.index, n = t.content, o = "object" == typeof n, r = c("body"), s = t.content; if (!t.id || !c("#" + t.id)[0]) { switch ("string" == typeof t.area && (t.area = "auto" === t.area ? ["", ""] : [t.area, ""]), t.shift && (t.anim = t.shift), 6 == m.ie && (t.fixed = !1), t.type) { case 0: t.btn = "btn" in t ? t.btn : y.btn[0], m.closeAll("dialog"); break; case 2: var u = null == t.method || "get" == t.method && null == t.params ? t.content : ""; t.content = ''; break; case 3: delete t.title, delete t.closeBtn, -1 === t.icon && t.icon, m.closeAll("loading"); break; case 4: o || (t.content = [t.content, "body"]), t.follow = t.content[1], t.content = t.content[0] + '', delete t.title, t.tips = "object" == typeof t.tips ? t.tips : [t.tips, !0], t.tipsMore || m.closeAll("tips") }if (e.vessel(o, (function (d, u, h) { if (r.append(d[0]), o ? 2 == t.type || 4 == t.type ? c("body").append(d[1]) : n.parents("." + g[0])[0] || (n.data("display", n.css("display")).show().addClass("layui-layer-wrap").wrap(d[1]), c("#" + g[0] + i).find("." + g[5]).before(u)) : r.append(d[1]), null != t.params || null != t.method && "get" != t.method) { var p, m = t.params, b = g[4] + "" + i, k = c("#" + t.id), w = t.method ? t.method : "get", C = c("
    "); if (!s) return; if (C.appendTo(k), m) for (var D in C.html(""), m) (p = c("")).val(m[D]), p.appendTo(C); C.attr("action", s), c("body").append(C), C.submit(), C.remove() } c(".layui-layer-move")[0] || r.append(y.moveElem = h), e.layero = c("#" + g[0] + i), t.scrollbar || g.html.css("overflow", "hidden").attr("layer-full", i) })).auto(i), c("#layui-layer-shade" + e.index).css({ "background-color": t.shade[1] || "#000", opacity: t.shade[0] || t.shade }), 2 == t.type && 6 == m.ie && e.layero.find("iframe").attr("src", n[0]), 4 == t.type ? e.tips() : e.offset(), t.fixed && d.on("resize", (function () { e.offset(), (/^\d+%$/.test(t.area[0]) || /^\d+%$/.test(t.area[1])) && e.auto(i), 4 == t.type && e.tips() })), g.anim[t.anim]) { var h = "layer-anim " + g.anim[t.anim]; e.layero.addClass(h).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", (function () { c(this).removeClass(h) })) } t.time <= 0 || setTimeout((function () { m.close(e.index) }), t.time), e.move().callback(), t.isOutAnim && e.layero.data("isOutAnim", !0) } }, Class.pt.auto = function (e) { var t = this.config, i = c("#" + g[0] + e); "" === t.area[0] && t.maxWidth > 0 && (m.ie && m.ie < 8 && t.btn && i.width(i.innerWidth()), i.outerWidth() > t.maxWidth && i.width(t.maxWidth)); var n = [i.innerWidth(), i.innerHeight()], o = i.find(g[1]).outerHeight() || 0, r = i.find("." + g[6]).outerHeight() || 0, setHeight = function (e) { (e = i.find(e)).height(n[1] - o - r - 2 * (0 | parseFloat(e.css("padding-top")))) }; switch (t.type) { case 2: setHeight("iframe"); break; default: "" === t.area[1] ? t.maxHeight > 0 && i.outerHeight() > t.maxHeight ? (n[1] = t.maxHeight, setHeight("." + g[5])) : t.fixed && n[1] >= d.height() && (n[1] = d.height(), setHeight("." + g[5])) : setHeight("." + g[5]) }return this }, Class.pt.offset = function () { var e = this.config, t = this.layero, i = [t.outerWidth(), t.outerHeight()], n = "object" == typeof e.offset; this.offsetTop = (d.height() - i[1]) / 2, this.offsetLeft = (d.width() - i[0]) / 2, n ? (this.offsetTop = e.offset[0], this.offsetLeft = e.offset[1] || this.offsetLeft) : "auto" !== e.offset && ("t" === e.offset ? this.offsetTop = 0 : "r" === e.offset ? this.offsetLeft = d.width() - i[0] : "b" === e.offset ? this.offsetTop = d.height() - i[1] : "l" === e.offset ? this.offsetLeft = 0 : "lt" === e.offset ? (this.offsetTop = 0, this.offsetLeft = 0) : "lb" === e.offset ? (this.offsetTop = d.height() - i[1], this.offsetLeft = 0) : "rt" === e.offset ? (this.offsetTop = 0, this.offsetLeft = d.width() - i[0]) : "rb" === e.offset ? (this.offsetTop = d.height() - i[1], this.offsetLeft = d.width() - i[0]) : this.offsetTop = e.offset), e.fixed || (this.offsetTop = /%$/.test(this.offsetTop) ? d.height() * parseFloat(this.offsetTop) / 100 : parseFloat(this.offsetTop), this.offsetLeft = /%$/.test(this.offsetLeft) ? d.width() * parseFloat(this.offsetLeft) / 100 : parseFloat(this.offsetLeft), this.offsetTop += d.scrollTop(), this.offsetLeft += d.scrollLeft()), t.attr("minLeft") && (this.offsetTop = d.height() - (t.find(g[1]).outerHeight() || 0), this.offsetLeft = t.css("left")), t.css({ top: this.offsetTop, left: this.offsetLeft }) }, Class.pt.tips = function () { var e = this.config, t = this.layero, i = [t.outerWidth(), t.outerHeight()], n = c(e.follow); n[0] || (n = c("body")); var o = { width: n.outerWidth(), height: n.outerHeight(), top: n.offset().top, left: n.offset().left }, r = t.find(".layui-layer-TipsG"), s = e.tips[0]; e.tips[1] || r.remove(), o.autoLeft = function () { o.left + i[0] - d.width() > 0 ? (o.tipLeft = o.left + o.width - i[0], r.css({ right: 12, left: "auto" })) : o.tipLeft = o.left }, o.where = [function () { o.autoLeft(), o.tipTop = o.top - i[1] - 10, r.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color", e.tips[1]) }, function () { o.tipLeft = o.left + o.width + 10, o.tipTop = o.top, r.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color", e.tips[1]) }, function () { o.autoLeft(), o.tipTop = o.top + o.height + 10, r.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color", e.tips[1]) }, function () { o.tipLeft = o.left - i[0] - 10, o.tipTop = o.top, r.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color", e.tips[1]) }], o.where[s - 1](), 1 === s ? o.top - (d.scrollTop() + i[1] + 16) < 0 && o.where[2]() : 2 === s ? d.width() - (o.left + o.width + i[0] + 16) > 0 || o.where[3]() : 3 === s ? o.top - d.scrollTop() + o.height + i[1] + 16 - d.height() > 0 && o.where[0]() : 4 === s && i[0] + 16 - o.left > 0 && o.where[1](), t.find("." + g[5]).css({ "background-color": e.tips[1], "padding-right": e.closeBtn ? "30px" : "" }), t.css({ left: o.tipLeft - (e.fixed ? d.scrollLeft() : 0), top: o.tipTop - (e.fixed ? d.scrollTop() : 0) }) }, Class.pt.move = function () { var e = this, t = e.config, i = c(document), n = e.layero, o = n.find(t.move), r = n.find(".layui-layer-resize"), s = {}; return t.move && o.css("cursor", "move"), o.on("mousedown", (function (e) { e.preventDefault(), t.move && (s.moveStart = !0, s.offset = [e.clientX - parseFloat(n.css("left")), e.clientY - parseFloat(n.css("top"))], y.moveElem.css("cursor", "move").show()) })), r.on("mousedown", (function (e) { e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], s.area = [n.outerWidth(), n.outerHeight()], y.moveElem.css("cursor", "se-resize").show() })), i.on("mousemove", (function (i) { if (s.moveStart) { var o = i.clientX - s.offset[0], r = i.clientY - s.offset[1], c = "fixed" === n.css("position"); if (i.preventDefault(), s.stX = c ? 0 : d.scrollLeft(), s.stY = c ? 0 : d.scrollTop(), !t.moveOut) { var u = d.width() - n.outerWidth() + s.stX, h = d.height() - n.outerHeight() + s.stY; o < s.stX && (o = s.stX), o > u && (o = u), r < s.stY && (r = s.stY), r > h && (r = h) } n.css({ left: o, top: r }) } if (t.resize && s.resizeStart) { o = i.clientX - s.offset[0], r = i.clientY - s.offset[1]; i.preventDefault(), m.style(e.index, { width: s.area[0] + o, height: s.area[1] + r }), s.isResize = !0, t.resizing && t.resizing(n) } })).on("mouseup", (function (e) { s.moveStart && (delete s.moveStart, y.moveElem.hide(), t.moveEnd && t.moveEnd(n)), s.resizeStart && (delete s.resizeStart, y.moveElem.hide()) })), e }, Class.pt.callback = function () { var e = this, t = e.layero, i = e.config; e.openLayer(), i.success && (2 == i.type ? t.find("iframe").on("load", (function () { i.success(t, e.index) })) : i.success(t, e.index)), 6 == m.ie && e.IE6(t), 0 == i.type && (document.onkeydown = function (n) { var o = document.all ? r.event : n; if (27 == o.keyCode) !1 === (i.cancel && i.cancel(e.index, t)) || m.close(e.index); else if (13 == o.keyCode) { if ("TEXTAREA" != o.target.tagName.toUpperCase()) return t.find("." + g[6]).children("a").click(), !1 } }), t.find("." + g[6]).children("a").on("click", (function () { var n = c(this).index(); 0 === n ? i.yes ? i.yes(e.index, t) : i.btn1 ? i.btn1(e.index, t) : m.close(e.index) : !1 === (i["btn" + (n + 1)] && i["btn" + (n + 1)](e.index, t)) || m.close(e.index) })), t.find("." + g[7]).on("click", (function cancel() { !1 === (i.cancel && i.cancel(e.index, t)) || m.close(e.index) })), i.shadeClose && c("#layui-layer-shade" + e.index).on("click", (function () { m.close(e.index) })), t.find(".layui-layer-min").on("click", (function () { !1 === (i.min && i.min(t)) || m.min(e.index, i) })), t.find(".layui-layer-max").on("click", (function () { c(this).hasClass("layui-layer-maxmin") ? (m.restore(e.index), i.restore && i.restore(t)) : (m.full(e.index, i), setTimeout((function () { i.full && i.full(t) }), 100)) })), i.end && (y.end[e.index] = i.end) }, y.reselect = function () { c.each(c("select"), (function (e, t) { var i = c(this); i.parents("." + g[0])[0] || 1 == i.attr("layer") && c("." + g[0]).length < 1 && i.removeAttr("layer").show(), i = null })) }, Class.pt.IE6 = function (e) { c("select").each((function (e, t) { var i = c(this); i.parents("." + g[0])[0] || "none" === i.css("display") || i.attr({ layer: "1" }).hide(), i = null })) }, Class.pt.openLayer = function () { m.zIndex = this.config.zIndex, m.setTop = function (e) { return m.zIndex = parseInt(e[0].style.zIndex), e.on("mousedown", (function () { m.zIndex++, e.css("z-index", m.zIndex + 1) })), m.zIndex } }, y.record = function (e) { var t = [e.width(), e.height(), e.position().top, e.position().left + parseFloat(e.css("margin-left"))]; e.find(".layui-layer-max").addClass("layui-layer-maxmin"), e.attr({ area: t }) }, y.rescollbar = function (e) { g.html.attr("layer-full") == e && (g.html[0].style.removeProperty ? g.html[0].style.removeProperty("overflow") : g.html[0].style.removeAttribute("overflow"), g.html.removeAttr("layer-full")) }, r.layer = m, m.getChildFrame = function (e, t) { return t = t || c("." + g[4]).attr("times"), c("#" + g[0] + t).find("iframe").contents().find(e) }, m.getFrameIndex = function (e) { return c("#" + e).parents("." + g[4]).attr("times") }, m.iframeAuto = function (e) { if (e) { var t = m.getChildFrame("html", e).outerHeight(), i = c("#" + g[0] + e), n = i.find(g[1]).outerHeight() || 0, o = i.find("." + g[6]).outerHeight() || 0; i.css({ height: t + n + o }), i.find("iframe").css({ height: t }) } }, m.iframeSrc = function (e, t) { c("#" + g[0] + e).find("iframe").attr("src", t) }, m.style = function (e, t, i) { var n = c("#" + g[0] + e), o = n.find(".layui-layer-content"), r = n.attr("type"), s = n.find(g[1]).outerHeight() || 0, d = n.find("." + g[6]).outerHeight() || 0; n.attr("minLeft"); r !== y.type[3] && r !== y.type[4] && (i || (parseFloat(t.width) <= 260 && (t.width = 260), parseFloat(t.height) - s - d <= 64 && (t.height = 64 + s + d)), n.css(t), d = n.find("." + g[6]).outerHeight(), r === y.type[2] ? n.find("iframe").css({ height: parseFloat(t.height) - s - d }) : o.css({ height: parseFloat(t.height) - s - d - parseFloat(o.css("padding-top")) - parseFloat(o.css("padding-bottom")) })) }, m.min = function (e, t) { var i = c("#" + g[0] + e), n = i.find(g[1]).outerHeight() || 0, o = i.attr("minLeft") || 181 * y.minIndex + "px", r = i.css("position"); y.record(i), y.minLeft[0] && (o = y.minLeft[0], y.minLeft.shift()), i.attr("position", r), m.style(e, { width: 180, height: n, left: o, top: d.height() - n, position: "fixed", overflow: "hidden" }, !0), i.find(".layui-layer-min").hide(), "page" === i.attr("type") && i.find(g[4]).hide(), y.rescollbar(e), i.attr("minLeft") || y.minIndex++, i.attr("minLeft", o) }, m.restore = function (e) { var t = c("#" + g[0] + e), i = t.attr("area").split(","); t.attr("type"); m.style(e, { width: parseFloat(i[0]), height: parseFloat(i[1]), top: parseFloat(i[2]), left: parseFloat(i[3]), position: t.attr("position"), overflow: "visible" }, !0), t.find(".layui-layer-max").removeClass("layui-layer-maxmin"), t.find(".layui-layer-min").show(), "page" === t.attr("type") && t.find(g[4]).show(), y.rescollbar(e) }, m.full = function (e) { var t, i = c("#" + g[0] + e); y.record(i), g.html.attr("layer-full") || g.html.css("overflow", "hidden").attr("layer-full", e), clearTimeout(t), t = setTimeout((function () { var t = "fixed" === i.css("position"); m.style(e, { top: t ? 0 : d.scrollTop(), left: t ? 0 : d.scrollLeft(), width: d.width(), height: d.height() }, !0), i.find(".layui-layer-min").hide() }), 100) }, m.title = function (e, t) { c("#" + g[0] + (t || m.index)).find(g[1]).html(e) }, m.close = function (e) { var t = c("#" + g[0] + e), i = t.attr("type"); if (t[0]) { var n = "layui-layer-wrap", remove = function () { if (i === y.type[1] && "object" === t.attr("conType")) { t.children(":not(." + g[5] + ")").remove(); for (var o = t.find("." + n), r = 0; r < 2; r++)o.unwrap(); o.css("display", o.data("display")).removeClass(n) } else { if (i === y.type[2]) try { var s = c("#" + g[4] + e)[0]; s.contentWindow.document.write(""), s.contentWindow.close(), t.find("." + g[5])[0].removeChild(s) } catch (e) { } t[0].innerHTML = "", t.remove() } "function" == typeof y.end[e] && y.end[e](), delete y.end[e] }; t.data("isOutAnim") && t.addClass("layer-anim layer-anim-close"), c("#layui-layer-moves, #layui-layer-shade" + e).remove(), 6 == m.ie && y.reselect(), y.rescollbar(e), t.attr("minLeft") && (y.minIndex--, y.minLeft.push(t.attr("minLeft"))), m.ie && m.ie < 10 || !t.data("isOutAnim") ? remove() : setTimeout((function () { remove() }), 200) } }, m.closeAll = function (e) { c.each(c("." + g[0]), (function () { var t = c(this), i = e ? t.attr("type") === e : 1; i && m.close(t.attr("times")), i = null })) }; var b = m.cache || {}, skin = function (e) { return b.skin ? " " + b.skin + " " + b.skin + "-" + e : "" }; m.prompt = function (e, t) { var i = ""; if ("function" == typeof (e = e || {}) && (t = e), e.area) { var n = e.area; i = 'style="width: ' + n[0] + "; height: " + n[1] + ';"', delete e.area } var o, r = 2 == e.formType ? '" : '', s = e.success; return delete e.success, m.open(c.extend({ type: 1, btn: ["确定", "取消"], content: r, skin: "layui-layer-prompt" + skin("prompt"), maxWidth: d.width(), success: function (t) { (o = t.find(".layui-layer-input")).val(e.value || "").focus(), "function" == typeof s && s(t) }, resize: !1, yes: function (i) { var n = o.val(); "" === n ? o.focus() : n.length > (e.maxlength || 500) ? m.tips("最多输入" + (e.maxlength || 500) + "个字数", o, { tips: 1 }) : t && t(n, i, o) } }, e)) }, m.tab = function (e) { var t = (e = e || {}).tab || {}, i = "layui-this", n = e.success; return delete e.success, m.open(c.extend({ type: 1, skin: "layui-layer-tab" + skin("tab"), resize: !1, title: function () { var e = t.length, n = 1, o = ""; if (e > 0) for (o = '' + t[0].title + ""; n < e; n++)o += "" + t[n].title + ""; return o }(), content: '", success: function (t) { var o = t.find(".layui-layer-title").children(), r = t.find(".layui-layer-tabmain").children(); o.on("mousedown", (function (t) { t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0; var n = c(this), o = n.index(); n.addClass(i).siblings().removeClass(i), r.eq(o).show().siblings().hide(), "function" == typeof e.change && e.change(o) })), "function" == typeof n && n(t) } }, e)) }, m.photos = function (e, t, i) { var n = {}; if ((e = e || {}).photos) { var o = e.photos.constructor === Object, s = o ? e.photos : {}, d = s.data || [], u = s.start || 0; n.imgIndex = 1 + (0 | u), e.img = e.img || "img"; var h = e.success; if (delete e.success, o) { if (0 === d.length) return m.msg("没有图片") } else { var p = c(e.photos), pushData = function () { d = [], p.find(e.img).each((function (e) { var t = c(this); t.attr("layer-index", e), d.push({ alt: t.attr("alt"), pid: t.attr("layer-pid"), src: t.attr("layer-src") || t.attr("src"), thumb: t.attr("src") }) })) }; if (pushData(), 0 === d.length) return; if (t || p.on("click", e.img, (function () { var t = c(this).attr("layer-index"); m.photos(c.extend(e, { photos: { start: t, data: d, tab: e.tab }, full: e.full }), !0), pushData() })), !t) return } n.imgprev = function (e) { n.imgIndex--, n.imgIndex < 1 && (n.imgIndex = d.length), n.tabimg(e) }, n.imgnext = function (e, t) { n.imgIndex++, n.imgIndex > d.length && (n.imgIndex = 1, t) || n.tabimg(e) }, n.keyup = function (e) { if (!n.end) { var t = e.keyCode; e.preventDefault(), 37 === t ? n.imgprev(!0) : 39 === t ? n.imgnext(!0) : 27 === t && m.close(n.index) } }, n.tabimg = function (t) { if (!(d.length <= 1)) return s.start = n.imgIndex - 1, m.close(n.index), m.photos(e, !0, t) }, n.event = function () { n.bigimg.hover((function () { n.imgsee.show() }), (function () { n.imgsee.hide() })), n.bigimg.find(".layui-layer-imgprev").on("click", (function (e) { e.preventDefault(), n.imgprev() })), n.bigimg.find(".layui-layer-imgnext").on("click", (function (e) { e.preventDefault(), n.imgnext() })), c(document).on("keyup", n.keyup) }, n.loadi = m.load(1, { shade: !("shade" in e) && .9, scrollbar: !1 }), function loadImage(e, t, i) { var n = new Image; if (n.src = e, n.complete) return t(n); n.onload = function () { n.onload = null, t(n) }, n.onerror = function (e) { n.onerror = null, i(e) } }(d[u].src, (function (t) { m.close(n.loadi), n.index = m.open(c.extend({ type: 1, id: "layui-layer-photos", area: function () { var i = [t.width, t.height], n = [c(r).width() - 100, c(r).height() - 100]; if (!e.full && (i[0] > n[0] || i[1] > n[1])) { var o = [i[0] / n[0], i[1] / n[1]]; o[0] > o[1] ? (i[0] = i[0] / o[0], i[1] = i[1] / o[0]) : o[0] < o[1] && (i[0] = i[0] / o[1], i[1] = i[1] / o[1]) } return [i[0] + "px", i[1] + "px"] }(), title: !1, shade: .9, shadeClose: !0, closeBtn: !1, move: ".layui-layer-phimg img", moveType: 1, scrollbar: !1, moveOut: !0, isOutAnim: !1, skin: "layui-layer-photos" + skin("photos"), content: '
    ' + (d[u].alt ||
    ' + (d.length > 1 ? '' : "") + '
    ' + (d[u].alt || "") + "" + n.imgIndex + "/" + d.length + "
    ", success: function (t, i) { n.bigimg = t.find(".layui-layer-phimg"), n.imgsee = t.find(".layui-layer-imguide,.layui-layer-imgbar"), n.event(t), e.tab && e.tab(d[u], t), "function" == typeof h && h(t) }, end: function () { n.end = !0, c(document).off("keyup", n.keyup) } }, e)) }), (function () { m.close(n.loadi), m.msg("当前图片地址异常
    是否继续查看下一张?", { time: 3e4, btn: ["下一张", "不看了"], yes: function () { d.length > 1 && n.imgnext(!0, !0) } }) })) } }, y.run = function (e) { d = (c = e)(r), g.html = c("html"), m.open = function (e) { return new Class(e).index } }, r.layui && layui.define ? (m.ready(), layui.define("jquery", (function (e) { m.path = layui.cache.dir, y.run(layui.$), r.layer = m, e("layer", m) }))) : (n = [i(13)], void 0 === (o = function () { return y.run(r.jQuery), m }.apply(t, n)) || (e.exports = o)) }(window) }, function (e, t) { e.exports = jQuery }, function (e, t) { /** @Name:layim v3.7.6 Pro 商用版 @Author:贤心 @Site:http://layim.layui.com @License:LGPL */ layui.define(["layer", "laytpl", "upload"], (function (e) { var t = "3.7.6", i = layui.$, n = layui.layer, o = layui.laytpl, r = layui.device(), s = "layui-show", c = "layim-this", d = {}, LAYIM = function () { this.v = t, i("body").on("click", "*[layim-event]", (function (e) { var t = i(this), n = t.attr("layim-event"); F[n] && F[n].call(this, t, e) })) }; LAYIM.prototype.config = function (e) { var t = []; if (layui.each(Array(5), (function (e) { t.push(layui.cache.dir + "css/modules/layim/skin/" + (e + 1) + ".jpg") })), (e = e || {}).skin = e.skin || [], layui.each(e.skin, (function (e, i) { t.unshift(i) })), e.skin = t, e = i.extend({ isfriend: !0, isgroup: !0, voice: "default.mp3" }, e), window.JSON && window.JSON.parse) return init(e), this }, LAYIM.prototype.on = function (e, t) { return "function" == typeof t && (d[e] ? d[e].push(t) : d[e] = [t]), this }, LAYIM.prototype.cache = function () { return S }, LAYIM.prototype.chat = function (e) { if (window.JSON && window.JSON.parse) return popchat(e), this }, LAYIM.prototype.setChatMin = function () { return setChatMin(), this }, LAYIM.prototype.setChatStatus = function (e) { var t = thisChat(); if (t) return t.elem.find(".layim-chat-status").html(e), this }, LAYIM.prototype.getMessage = function (e) { return getMessage(e), this }, LAYIM.prototype.notice = function (e) { return notice(e), this }, LAYIM.prototype.add = function (e) { return popAdd(e), this }, LAYIM.prototype.setFriendGroup = function (e) { return popAdd(e, "setGroup"), this }, LAYIM.prototype.msgbox = function (e) { return msgbox(e), this }, LAYIM.prototype.addList = function (e) { return addList(e), this }, LAYIM.prototype.removeList = function (e) { return removeList(e), this }, LAYIM.prototype.setFriendStatus = function (e, t) { i(".layim-friend" + e)["online" === t ? "removeClass" : "addClass"]("layim-list-gray") }, LAYIM.prototype.content = function (e) { return layui.data.content(e) }; var listTpl = function (e) { return (e = e || {}).item = e.item || "d." + e.type, ["{{# var length = 0; layui.each(" + e.item + ", function(i, data){ length++; }}", '
  • {{ data.username||data.groupname||data.name||"佚名" }}

    {{ data.remark||data.sign||"" }}

    new
  • ', "{{# }); if(length === 0){ }}", '
  • ' + ({ friend: "该分组下暂无好友", group: "暂无群组", history: "暂无历史会话" }[e.type] || "暂无数据") + "
  • ", "{{# } }}"].join("") }, u = ['
    ', '
    ', '
    {{ d.mine.username }}
    ', '
    ', '{{# if(d.mine.status === "online"){ }}', '', '{{# } else if(d.mine.status === "hide") { }}', '', "{{# } }}", '
      ', '
    • 在线
    • ', '
    • 隐身
    • ', "
    ", "
    ", '', "
    ", '
      ', '
    • ', '
    • ', '
    • ', "
    ", '
      ', '{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}', "
    • ", '
      {{# if(spread === "true"){ }}{{# } else { }}{{# } }}{{ item.groupname||"未命名分组"+index }}( {{ (item.list||[]).length }})
      ', '
        ', listTpl({ type: "friend", item: "item.list", index: "index" }), "
      ", "
    • ", "{{# }); if(d.friend.length === 0){ }}", '
      • 暂无联系人
      ', "{{# } }}", "
    ", '
      ', "
    • ", '
        ', listTpl({ type: "group" }), "
      ", "
    • ", "
    ", '
      ', "
    • ", '
        ', listTpl({ type: "history" }), "
      ", "
    • ", "
    ", '
      ', "
    • ", '', "
    • ", "
    ", '
      ', '', "{{# if(d.base.msgbox){ }}", '
    • ', "{{# } }}", "{{# if(d.base.find){ }}", '
    • ', "{{# } }}", '
    • ', "{{# if(!d.base.copyright){ }}", '
    • ', "{{# } }}", "
    ", '', "
    "].join(""), h = ['"].join(""), p = ['
    ', '
    ', '
    ', '{{ d.data.name||"佚名" }} {{d.data.temporary ? "临时会话" : ""}} {{# if(d.data.type==="group"){ }} {{# } }}', '

    ', "
    ", "
    ", '
    ', "
      ", "
      ", '", "
      "].join(""), y = ['
      ', '

      {{ d.data.name||"" }}

      ', '
      ', '{{# if(d.data.type === "friend" && d.type === "setGroup"){ }}', "

      选择分组

      ", '{{# } if(d.data.type === "friend"){ }}', '", "{{# } }}", '{{# if(d.data.type === "group"){ }}', "

      请输入验证信息

      ", '{{# } if(d.type !== "setGroup"){ }}', '', "{{# } }}", "
      ", "
      "].join(""), m = ['
    • ', '
      ', "{{# if(d.mine){ }}", '{{ layui.data.date(d.timestamp) }}{{ d.username||"佚名" }}', "{{# } else { }}", '{{ d.username||"佚名" }}{{ layui.data.date(d.timestamp) }}', "{{# } }}", "
      ", '
      {{ layui.data.content(d.content||" ") }}
      ', "
    • "].join(""), g = '
    • {{ d.data.name||"佚名" }}{{# if(!d.base.brief){ }}{{# } }}
    • ', digit = function (e) { return e < 10 ? "0" + (0 | e) : e }; layui.data.date = function (e) { var t = new Date(e || new Date); return t.getFullYear() + "-" + digit(t.getMonth() + 1) + "-" + digit(t.getDate()) + " " + digit(t.getHours()) + ":" + digit(t.getMinutes()) + ":" + digit(t.getSeconds()) }, layui.data.content = function (e) { var html = function (e) { return new RegExp("\\n*\\[" + (e || "") + "(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\]\\n*", "g") }; return e = (e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """).replace(/@(\S+)(\s+?|$)/g, '@$1$2').replace(/face\[([^\s\[\]]+?)\]/g, (function (e) { var t = e.replace(/^face/g, ""); return '' + t + '' })).replace(/img\[([^\s]+?)\]/g, (function (e) { return '' })).replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g, (function (e) { var t = (e.match(/file\(([\s\S]+?)\)\[/) || [])[1], i = (e.match(/\)\[([\s\S]*?)\]/) || [])[1]; return t ? '' + (i || t) + "" : e })).replace(/audio\[([^\s]+?)\]/g, (function (e) { return '

      音频消息

      ' })).replace(/video\[([^\s]+?)\]/g, (function (e) { return '
      ' })).replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g, (function (e) { var t = (e.match(/a\(([\s\S]+?)\)\[/) || [])[1], i = (e.match(/\)\[([\s\S]*?)\]/) || [])[1]; return t ? '' + (i || t) + "" : e })).replace(html(), "<$1 $2>").replace(html("/"), "").replace(/\n/g, "
      ") }; var b, k, w, C, D, E, post = function (e, t, o) { return e = e || {}, i.ajax({ url: e.url, type: e.type || "get", data: e.data, dataType: e.dataType || "json", cache: !1, success: function (e) { 0 == e.code ? t && t(e.data || {}) : n.msg(e.msg || (o || "Error") + ": LAYIM_NOT_GET_DATA", { time: 5e3 }) }, error: function (e, t) { window.console && console.log } }) }, S = { message: {}, chat: [] }, init = function (e) { var t = e.init || {}, n = t.mine || {}, r = layui.data("layim")[n.id] || {}, s = { base: e, local: r, mine: n, history: r.history || {} }, create = function (t) { var n = t.mine || {}, r = layui.data("layim")[n.id] || {}, s = { base: e, local: r, mine: n, friend: t.friend || [], group: t.group || [], history: r.history || {} }; S = i.extend(S, s), popim(o(u).render(s)), (r.close || e.min) && popmin(), layui.each(d.ready, (function (e, t) { t && t(s) })) }; if (S = i.extend(S, s), e.brief) return layui.each(d.ready, (function (e, t) { t && t(s) })); t.url ? post(t, create, "INIT") : create(t) }, popim = function (e) { return n.open({ type: 1, area: ["260px", "520px"], skin: "layui-box layui-layim", title: "​", offset: "rb", id: "layui-layim", shade: !1, anim: 2, resize: !1, content: e, success: function (e) { b = e, setSkin(e), S.base.right && e.css("margin-left", "-" + S.base.right), k && n.close(k.attr("times")); var t = [], o = e.find(".layim-list-history"); o.find("li").each((function () { t.push(i(this).prop("outerHTML")) })), t.length > 0 && (t.reverse(), o.html(t.join(""))), banRightMenu(), F.sign() }, cancel: function (e) { popmin(); var t = layui.data("layim")[S.mine.id] || {}; return t.close = !0, layui.data("layim", { key: S.mine.id, value: t }), !1 } }) }, banRightMenu = function () { b.on("contextmenu", (function (e) { return e.cancelBubble = !0, e.returnValue = !1, !1 })); var hide = function () { n.closeAll("tips") }; b.find(".layim-list-history").on("contextmenu", "li", (function (e) { var t = i(this), o = ''; t.hasClass("layim-null") || (n.tips(o, this, { tips: 1, time: 0, anim: 5, fixed: !0, skin: "layui-box layui-layim-contextmenu", success: function (e) { var stopmp = function (e) { A(e) }; e.off("mousedown", stopmp).on("mousedown", stopmp) } }), i(document).off("mousedown", hide).on("mousedown", hide), i(window).off("resize", hide).on("resize", hide)) })) }, popmin = function (e) { return k && n.close(k.attr("times")), b && b.hide(), S.mine = S.mine || {}, n.open({ type: 1, title: !1, id: "layui-layim-close", skin: "layui-box layui-layim-min layui-layim-close", shade: !1, closeBtn: !1, anim: 2, offset: "rb", resize: !1, content: '' + (e || S.base.title || "我的LayIM") + "", move: "#layui-layim-close img", success: function (e, t) { k = e, S.base.right && e.css("margin-left", "-" + S.base.right), e.on("click", (function () { n.close(t), b.show(); var e = layui.data("layim")[S.mine.id] || {}; delete e.close, layui.data("layim", { key: S.mine.id, value: e }) })) } }) }, popchat = function (e) { e = e || {}; var t = i("#layui-layim-chat"), r = { data: e, base: S.base, local: S.local }; if (!e.id) return n.msg("非法用户"); if (t[0]) { var s = w.find(".layim-chat-list"), c = s.find(".layim-chatlist-" + e.type + e.id), u = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"), h = t.children(".layim-chat-box"); return "none" === w.css("display") && w.show(), C && n.close(C.attr("times")), 1 !== s.find("li").length || c[0] || (u || w.css("width", 800), s.css({ height: w.height() }).show(), h.css("margin-left", "200px")), c[0] || (s.append(o(g).render(r)), h.append(o(p).render(r)), syncGray(e), resizeChat()), changeChat(s.find(".layim-chatlist-" + e.type + e.id)), c[0] || viewChatlog(), setHistory(e), hotkeySend(), D } r.first = !0; var y = D = n.open({ type: 1, area: "600px", skin: "layui-box layui-layim-chat", id: "layui-layim-chat", title: "​", shade: !1, maxmin: !0, offset: e.offset || "auto", anim: e.anim || 0, closeBtn: !S.base.brief && 1, content: o('
      ' + p + "
      ").render(r), success: function (t) { w = t, t.css({ "min-width": "500px", "min-height": "420px" }), syncGray(e), "function" == typeof e.success && e.success(t), hotkeySend(), setSkin(t), setHistory(e), viewChatlog(), showOffMessage(), layui.each(d.chatChange, (function (e, t) { t && t(thisChat()) })), t.on("dblclick", ".layui-layim-photos", (function () { var e = this.src; n.close(popchat.photosIndex), n.photos({ photos: { data: [{ alt: "大图模式", src: e }] }, shade: .01, closeBtn: 2, anim: 0, resize: !1, success: function (e, t) { popchat.photosIndex = t } }) })) }, full: function (e) { n.style(y, { width: "100%", height: "100%" }, !0), resizeChat() }, resizing: resizeChat, restore: resizeChat, min: function () { return setChatMin(), !1 }, end: function () { n.closeAll("tips"), w = null } }); return y }, syncGray = function (e) { i(".layim-" + e.type + e.id).each((function () { i(this).hasClass("layim-list-gray") && layui.layim.setFriendStatus(e.id, "offline") })) }, resizeChat = function () { var e = w.find(".layim-chat-list"), t = w.find(".layim-chat-main"), i = w.height(); e.css({ height: i }), t.css({ height: i - 20 - 80 - 158 }) }, setChatMin = function (e) { var t = e || thisChat().data, o = layui.layim.cache().base; w && !e && w.hide(), n.close(setChatMin.index), setChatMin.index = n.open({ type: 1, title: !1, skin: "layui-box layui-layim-min", shade: !1, closeBtn: !1, anim: t.anim || 2, offset: "b", move: "#layui-layim-min", resize: !1, area: ["182px", "50px"], content: '' + t.name + "", success: function (t, r) { e || (C = t), o.minRight && n.style(r, { left: i(window).width() - t.outerWidth() - parseFloat(o.minRight) }), t.find(".layui-layer-content span").on("click", (function () { n.close(r), e ? layui.each(S.chat, (function (e, t) { popchat(t) })) : w.show(), e && (S.chat = [], chatListMore()) })), t.find(".layui-layer-content img").on("click", (function (e) { A(e) })) } }) }, popAdd = function (e, t) { return e = e || {}, n.close(popAdd.index), popAdd.index = n.open({ type: 1, area: "430px", title: { friend: "添加好友", group: "加入群组" }[e.type] || "", shade: !1, resize: !1, btn: t ? ["确认", "取消"] : ["发送申请", "关闭"], content: o(y).render({ data: { name: e.username || e.groupname, avatar: e.avatar, group: e.group || parent.layui.layim.cache().friend || [], type: e.type }, type: t }), yes: function (i, n) { var o = n.find("#LAY_layimGroup"), r = n.find("#LAY_layimRemark"); t ? e.submit && e.submit(o.val(), i) : e.submit && e.submit(o.val(), r.val(), i) } }) }, changeChat = function (e, t) { var o = -1 === (e = e || i(".layim-chat-list ." + c)).index() ? 0 : e.index(), r = ".layim-chat", u = w.find(r).eq(o), h = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"); if (t) { e.hasClass(c) && changeChat(0 === o ? e.next() : e.prev()); var p = w.find(r).length; return 1 === p ? n.close(D) : (e.remove(), u.remove(), 2 === p && (w.find(".layim-chat-list").hide(), h || w.css("width", "600px"), w.find(".layim-chat-box").css("margin-left", 0)), !1) } e.addClass(c).siblings().removeClass(c), u.addClass(s).siblings(r).removeClass(s), u.find("textarea").focus(), layui.each(d.chatChange, (function (e, t) { t && t(thisChat()) })), showOffMessage() }, showOffMessage = function () { var e = thisChat(); S.message[e.data.type + e.data.id] && delete S.message[e.data.type + e.data.id] }, thisChat = function () { if (w) { var e = i(".layim-chat-list ." + c).index(), t = w.find(".layim-chat").eq(e), n = JSON.parse(decodeURIComponent(t.find(".layim-chat-tool").data("json"))); return { elem: t, data: n, textarea: t.find("textarea") } } }, setSkin = function (e) { var t = (layui.data("layim")[S.mine.id] || {}).skin; e.css({ "background-image": t ? "url(" + t + ")" : S.base.initSkin ? "url(" + layui.cache.dir + "css/modules/layim/skin/" + S.base.initSkin + ")" : "none" }) }, setHistory = function (e) { var t = layui.data("layim")[S.mine.id] || {}, i = {}, n = t.history || {}, r = n[e.type + e.id]; if (b) { var s = b.find(".layim-list-history"); if (e.historyTime = (new Date).getTime(), n[e.type + e.id] = e, t.history = n, layui.data("layim", { key: S.mine.id, value: t }), !r) { i[e.type + e.id] = e; var c = o(listTpl({ type: "history", item: "d.data" })).render({ data: i }); s.prepend(c), s.find(".layim-null").remove() } } }, sendMessage = function () { var e = { username: S.mine ? S.mine.username : "访客", avatar: S.mine ? S.mine.avatar : layui.cache.dir + "css/pc/layim/skin/logo.jpg", id: S.mine ? S.mine.id : null, mine: !0 }, t = thisChat(), i = t.elem.find(".layim-chat-main ul"), r = S.base.maxLength || 3e3; if (e.content = t.textarea.val(), "" !== e.content.replace(/\s/g, "")) { if (e.content.length > r) return n.msg("内容最长不能超过" + r + "个字符"); i.append(o(m).render(e)); var s = { mine: e, to: t.data }, c = { username: s.mine.username, avatar: s.mine.avatar, id: s.to.id, type: s.to.type, content: s.mine.content, timestamp: (new Date).getTime(), mine: !0 }; pushChatlog(c), layui.each(d.sendMessage, (function (e, t) { t && t(s) })) } chatListMore(), t.textarea.val("").focus() }, notice = function (e) { if (e = e || {}, window.Notification) if ("granted" === Notification.permission) new Notification(e.title || "", { body: e.content || "", icon: e.avatar || "http://tp2.sinaimg.cn/5488749285/50/5719808192/1" }); else Notification.requestPermission() }, getMessage = function (e) { var t = i(".layim-chatlist-" + (e = e || {}).type + e.id), n = {}, s = t.index(); if (e.timestamp = e.timestamp || (new Date).getTime(), e.fromid == S.mine.id && (e.mine = !0), e.system || pushChatlog(e), JSON.parse(JSON.stringify(e)), S.base.voice && function () { if (!(r.ie && r.ie < 9)) { var e = document.createElement("audio"); e.src = layui.cache.dir + "css/modules/layim/voice/" + S.base.voice, e.play() } }(), !w && e.content || -1 === s) { var c; if (S.message[e.type + e.id]) S.message[e.type + e.id].push(e); else if (S.message[e.type + e.id] = [e], "friend" === e.type) layui.each(S.friend, (function (t, i) { if (layui.each(i.list, (function (t, i) { if (i.id == e.id) return i.type = "friend", i.name = i.username, S.chat.push(i), c = !0 })), c) return !0 })), c || (e.name = e.username, e.temporary = !0, S.chat.push(e)); else if ("group" === e.type) { var d; layui.each(S.group, (function (t, i) { if (i.id == e.id) return i.type = "group", i.name = i.groupname, S.chat.push(i), d = !0 })), d || (e.name = e.groupname, S.chat.push(e)) } else e.name = e.name || e.username || e.groupname, S.chat.push(e); if ("group" === e.type && layui.each(S.group, (function (t, i) { if (i.id == e.id) return n.avatar = i.avatar, !0 })), !e.system) return S.base.notice && notice({ title: "来自 " + e.username + " 的消息", content: e.content, avatar: n.avatar || e.avatar }), setChatMin({ name: "收到新消息", avatar: n.avatar || e.avatar, anim: 6 }) } if (w) { var u = thisChat(); u.data.type + u.data.id !== e.type + e.id && (t.addClass("layui-anim layer-anim-06"), setTimeout((function () { t.removeClass("layui-anim layer-anim-06") }), 300)); var h = w.find(".layim-chat").eq(s).find(".layim-chat-main ul"); e.system ? -1 !== s && h.append('
    • ' + e.content + "
    • ") : "" !== e.content.replace(/\s/g, "") && h.append(o(m).render(e)), chatListMore() } }, L = "layui-anim-loop layer-anim-05", msgbox = function (e) { b.find(".layim-tool-msgbox").find("span").addClass(L).html(e) }, pushChatlog = function (e) { var t = layui.data("layim")[S.mine.id] || {}; t.chatlog = t.chatlog || {}; var i, n = t.chatlog[e.type + e.id]; n ? (layui.each(n, (function (t, n) { n.timestamp === e.timestamp && n.type === e.type && n.id === e.id && n.content === e.content && (i = !0) })), i || e.fromid == S.mine.id || n.push(e), n.length > 20 && n.shift()) : t.chatlog[e.type + e.id] = [e]; layui.data("layim", { key: S.mine.id, value: t }) }, viewChatlog = function () { var e = layui.data("layim")[S.mine.id] || {}, t = thisChat(), i = e.chatlog || {}, n = t.elem.find(".layim-chat-main ul"); layui.each(i[t.data.type + t.data.id], (function (e, t) { n.append(o(m).render(t)) })), chatListMore() }, addList = function (e) { var t, i = {}, r = b.find(".layim-list-" + e.type); if (S[e.type]) if ("friend" === e.type) layui.each(S.friend, (function (o, r) { if (e.groupid == r.id) return layui.each(S.friend[o].list, (function (i, n) { if (n.id == e.id) return t = !0 })), t ? n.msg("好友 [" + (e.username || "") + "] 已经存在列表中", { anim: 6 }) : (S.friend[o].list = S.friend[o].list || [], i[S.friend[o].list.length] = e, e.groupIndex = o, S.friend[o].list.push(e), !0) })); else if ("group" === e.type) { if (layui.each(S.group, (function (i, n) { if (n.id == e.id) return t = !0 })), t) return n.msg("您已是 [" + (e.groupname || "") + "] 的群成员", { anim: 6 }); i[S.group.length] = e, S.group.push(e) } if (!t) { var s = o(listTpl({ type: e.type, item: "d.data", index: "friend" === e.type ? "data.groupIndex" : null })).render({ data: i }); if ("friend" === e.type) { var c = r.find(">li").eq(e.groupIndex); c.find(".layui-layim-list").append(s), c.find(".layim-count").html(S.friend[e.groupIndex].list.length), c.find(".layim-null")[0] && c.find(".layim-null").remove() } else "group" === e.type && (r.append(s), r.find(".layim-null")[0] && r.find(".layim-null").remove()) } }, removeList = function (e) { var t = b.find(".layim-list-" + e.type); S[e.type] && ("friend" === e.type ? layui.each(S.friend, (function (i, n) { layui.each(n.list, (function (n, o) { if (e.id == o.id) { var r = t.find(">li").eq(i); r.find(".layui-layim-list>li"); return r.find(".layui-layim-list>li").eq(n).remove(), S.friend[i].list.splice(n, 1), r.find(".layim-count").html(S.friend[i].list.length), 0 === S.friend[i].list.length && r.find(".layui-layim-list").html('
    • 该分组下已无好友了
    • '), !0 } })) })) : "group" === e.type && layui.each(S.group, (function (i, n) { if (e.id == n.id) return t.find(">li").eq(i).remove(), S.group.splice(i, 1), 0 === S.group.length && t.html('
    • 暂无群组
    • '), !0 }))) }, chatListMore = function () { var e = thisChat().elem.find(".layim-chat-main"), t = e.find("ul"), i = t.find("li").length; if (i >= 20) { var n = t.find("li").eq(0); t.prev().hasClass("layim-chat-system") || t.before('
      查看更多记录
      '), i > 20 && n.remove() } e.scrollTop(e[0].scrollHeight + 1e3), e.find("ul li:last").find("img").load((function () { e.scrollTop(e[0].scrollHeight + 1e3) })) }, hotkeySend = function () { var e = thisChat().textarea; e.focus(), e.off("keydown").on("keydown", (function (t) { var i = layui.data("layim")[S.mine.id] || {}, n = t.keyCode; if ("Ctrl+Enter" !== i.sendHotKey) { if (13 === n) { if (t.ctrlKey) return e.val(e.val() + "\n"); if (t.shiftKey) return; t.preventDefault(), sendMessage() } } else t.ctrlKey && 13 === n && sendMessage() })) }, N = (E = {}, layui.each(["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"], (function (e, t) { E[t] = layui.cache.dir + "images/face/" + e + ".gif" })), E), A = layui.stope, focusInsert = function (e, t) { var i, n = e.value; e.focus(), document.selection ? (i = document.selection.createRange(), document.selection.empty(), i.text = t) : (i = [n.substring(0, e.selectionStart), t, n.substr(e.selectionEnd)], e.focus(), e.value = i.join("")) }, _ = "layui-anim-upbit", F = { status: function (e, t) { var hide = function () { e.next().hide().removeClass(_) }, n = e.attr("lay-type"); if ("show" === n) A(t), e.next().show().addClass(_), i(document).off("click", hide).on("click", hide); else { var o = e.parent().prev(); e.addClass(c).siblings().removeClass(c), o.html(e.find("cite").html()), o.removeClass("layim-status-" + ("online" === n ? "hide" : "online")).addClass("layim-status-" + n), layui.each(d.online, (function (e, t) { t && t(n) })) } }, sign: function () { var e = b.find(".layui-layim-remark"); e.on("change", (function () { var e = this.value; layui.each(d.sign, (function (t, i) { i && i(e) })) })), e.on("keyup", (function (e) { 13 === e.keyCode && this.blur() })) }, tab: function (e) { var t, i = ".layim-tab-content", n = b.find(".layui-layim-tab>li"); "number" == typeof e ? (t = e, e = n.eq(t)) : t = e.index(), t > 2 ? n.removeClass(c) : (F.tab.index = t, e.addClass(c).siblings().removeClass(c)), b.find(i).eq(t).addClass(s).siblings(i).removeClass(s) }, spread: function (e) { var t = e.attr("lay-type"), i = "true" === t ? "false" : "true", n = layui.data("layim")[S.mine.id] || {}; e.next()["true" === t ? "removeClass" : "addClass"](s), n["spread" + e.parent().index()] = i, layui.data("layim", { key: S.mine.id, value: n }), e.attr("lay-type", i), e.find(".layui-icon").html("true" === i ? "" : "") }, search: function (e) { var t = b.find(".layui-layim-search"), i = b.find("#layui-layim-search"), n = t.find("input"), find = function (e) { var t = n.val().replace(/\s/); if ("" === t) F.tab(0 | F.tab.index); else { for (var o = [], r = S.friend || [], s = S.group || [], c = "", d = 0; d < r.length; d++)for (var u = 0; u < (r[d].list || []).length; u++)-1 !== r[d].list[u].username.indexOf(t) && (r[d].list[u].type = "friend", r[d].list[u].index = d, r[d].list[u].list = u, o.push(r[d].list[u])); for (var h = 0; h < s.length; h++)-1 !== s[h].groupname.indexOf(t) && (s[h].type = "group", s[h].index = h, s[h].list = h, o.push(s[h])); if (o.length > 0) for (var p = 0; p < o.length; p++)c += '
    • ' + (o[p].username || o[p].groupname || "佚名") + "

      " + (o[p].remark || o[p].sign || "") + "

    • "; else c = '
    • 无搜索结果
    • '; i.html(c), F.tab(3) } }; !S.base.isfriend && S.base.isgroup ? F.tab.index = 1 : S.base.isfriend || S.base.isgroup || (F.tab.index = 2), t.show(), n.focus(), n.off("keyup", find).on("keyup", find) }, closeSearch: function (e) { e.parent().hide(), F.tab(0 | F.tab.index) }, msgbox: function () { var e = b.find(".layim-tool-msgbox"); return n.close(F.msgbox.index), e.find("span").removeClass(L).html(""), F.msgbox.index = n.open({ type: 2, title: "消息盒子", shade: !1, maxmin: !0, area: ["600px", "520px"], skin: "layui-box layui-layer-border", resize: !1, content: S.base.msgbox }) }, find: function () { return n.close(F.find.index), F.find.index = n.open({ type: 2, title: "查找", shade: !1, maxmin: !0, area: ["1000px", "520px"], skin: "layui-box layui-layer-border", resize: !1, content: S.base.find }) }, skin: function () { n.open({ type: 1, title: "更换背景", shade: !1, area: "300px", skin: "layui-box layui-layer-border", id: "layui-layim-skin", zIndex: 66666666, resize: !1, content: o(h).render({ skin: S.base.skin }) }) }, about: function () { n.alert('版本: 3.7.6
      版权所有:上海快搭科技(上海)有限公司', { title: "关于", shade: !1 }) }, setSkin: function (e) { var t = e.attr("src"), i = layui.data("layim")[S.mine.id] || {}; i.skin = t, t || delete i.skin, layui.data("layim", { key: S.mine.id, value: i }); try { b.css({ "background-image": t ? "url(" + t + ")" : "none" }), w.css({ "background-image": t ? "url(" + t + ")" : "none" }) } catch (e) { } layui.each(d.setSkin, (function (e, i) { var n = (t || "").replace(layui.cache.dir + "css/modules/layim/skin/", ""); i && i(n, t) })) }, chat: function (e) { var t = layui.data("layim")[S.mine.id] || {}, i = e.data("type"), n = e.data("index"), o = e.attr("data-list") || e.index(), r = {}; "friend" === i ? r = S[i][n].list[o] : "group" === i ? r = S[i][o] : "history" === i && (r = (t.history || {})[n] || {}), r.name = r.name || r.username || r.groupname, "history" !== i && (r.type = i), popchat(r) }, tabChat: function (e) { changeChat(e) }, closeChat: function (e, t) { changeChat(e.parent(), 1), A(t) }, closeThisChat: function () { changeChat(null, 1) }, groupMembers: function (e, t) { var o = e.find(".layui-icon"), hide = function () { o.html(""), e.data("down", null), n.close(F.groupMembers.index) }, stopmp = function (e) { A(e) }; e.data("down") ? hide() : (o.html(""), e.data("down", !0), F.groupMembers.index = n.tips('', e, { tips: 3, time: 0, anim: 5, fixed: !0, skin: "layui-box layui-layim-members", success: function (t) { var n = S.base.members || {}, o = thisChat(), r = t.find(".layim-members-list"), s = "", c = {}, u = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"), h = "none" === w.find(".layim-chat-list").css("display"); u && r.css({ width: i(window).width() - 22 - (h || 200) }), n.data = i.extend(n.data, { id: o.data.id }), post(n, (function (t) { layui.each(t.list, (function (e, t) { s += '
    • ' + t.username + "
    • ", c[t.id] = t })), r.html(s), e.find(".layim-chat-members").html(t.members || (t.list || []).length + "人"), r.find("li").on("click", (function () { var e = i(this).data("uid"), t = c[e]; popchat({ name: t.username, type: "friend", avatar: t.avatar, id: t.id }), hide() })), layui.each(d.members, (function (e, i) { i && i(t) })) })), t.on("mousedown", (function (e) { A(e) })) } }), i(document).off("mousedown", hide).on("mousedown", hide), i(window).off("resize", hide).on("resize", hide), e.off("mousedown", stopmp).on("mousedown", stopmp)) }, send: function () { sendMessage() }, setSend: function (e, t) { var n = F.setSend.box = e.siblings(".layim-menu-box"), o = e.attr("lay-type"); if ("show" === o) A(t), n.show().addClass(_), i(document).off("click", F.setSendHide).on("click", F.setSendHide); else { e.addClass(c).siblings().removeClass(c); var r = layui.data("layim")[S.mine.id] || {}; r.sendHotKey = o, layui.data("layim", { key: S.mine.id, value: r }), F.setSendHide(t, e.parent()) } }, setSendHide: function (e, t) { (t || F.setSend.box).hide().removeClass(_) }, face: function (e, t) { var o = "", r = thisChat(); for (var s in N) o += '
    • '; o = '", F.face.index = n.tips(o, e, { tips: 1, time: 0, fixed: !0, skin: "layui-box layui-layim-face", success: function (e) { e.find(".layim-face-list>li").on("mousedown", (function (e) { A(e) })).on("click", (function () { focusInsert(r.textarea[0], "face" + this.title + " "), n.close(F.face.index) })) } }), i(document).off("mousedown", F.faceHide).on("mousedown", F.faceHide), i(window).off("resize", F.faceHide).on("resize", F.faceHide), A(t) }, faceHide: function () { n.close(F.face.index) }, image: function (e) { var t = e.data("type") || "images", i = thisChat(), o = S.base[{ images: "uploadImage", file: "uploadFile" }[t]] || {}; layui.upload.render({ url: o.url || "", method: o.type, elem: e.find("input")[0], accept: t, done: function (e) { 0 == e.code ? (e.data = e.data || {}, "images" === t ? focusInsert(i.textarea[0], "img[" + (e.data.src || "") + "]") : "file" === t && focusInsert(i.textarea[0], "file(" + (e.data.src || "") + ")[" + (e.data.name || "下载文件") + "]"), sendMessage()) : n.msg(e.msg || "上传失败") } }) }, media: function (e) { var t = e.data("type"), o = thisChat(); n.prompt({ title: "请输入网络" + { audio: "音频", video: "视频" }[t] + "地址", shade: !1, offset: [e.offset().top - i(window).scrollTop() - 158 + "px", e.offset().left + "px"] }, (function (e, i) { focusInsert(o.textarea[0], t + "[" + e + "]"), sendMessage(), n.close(i) })) }, extend: function (e) { var t = e.attr("lay-filter"), i = thisChat(); layui.each(d["tool(" + t + ")"], (function (t, n) { n && n.call(e, (function (e) { focusInsert(i.textarea[0], e) }), sendMessage, i) })) }, playAudio: function (e) { var t = e.data("audio"), i = t || document.createElement("audio"), pause = function () { i.pause(), e.removeAttr("status"), e.find("i").html("") }; return e.data("error") ? n.msg("播放音频源异常") : i.play ? void (e.attr("status") ? pause() : (t || (i.src = e.data("src")), i.play(), e.attr("status", "pause"), e.data("audio", i), e.find("i").html(""), i.onended = function () { pause() }, i.onerror = function () { n.msg("播放音频源异常"), e.data("error", !0), pause() })) : n.msg("您的浏览器不支持audio") }, playVideo: function (e) { var t = e.data("src"); if (!document.createElement("video").play) return n.msg("您的浏览器不支持video"); n.close(F.playVideo.index), F.playVideo.index = n.open({ type: 1, title: "播放视频", area: ["460px", "300px"], maxmin: !0, shade: !1, content: '
      ' }) }, chatLog: function (e) { var t = thisChat(); return S.base.chatLog ? (n.close(F.chatLog.index), F.chatLog.index = n.open({ type: 2, maxmin: !0, title: "与 " + t.data.name + " 的聊天记录", area: ["450px", "100%"], shade: !1, offset: "rb", skin: "layui-box", anim: 2, id: "layui-layim-chatlog", content: S.base.chatLog + "?id=" + t.data.id + "&type=" + t.data.type })) : n.msg("未开启更多聊天记录") }, menuHistory: function (e, t) { var o = layui.data("layim")[S.mine.id] || {}, r = e.parent(), s = e.data("type"), c = b.find(".layim-list-history"), d = '
    • 暂无历史会话
    • '; if ("one" === s) { var u = o.history; delete u[r.data("index")], o.history = u, layui.data("layim", { key: S.mine.id, value: o }), i("#" + r.data("id")).remove(), 0 === c.find("li").length && c.html(d) } else "all" === s && (delete o.history, layui.data("layim", { key: S.mine.id, value: o }), c.html(d)); n.closeAll("tips") } }; e("layim", new LAYIM) })).addcss("modules/layim/layim.css?v=3.7.6", "skinlayimcss") }, function (e, t) { /** @Name : layui.laypage 分页组件 @Author:贤心 @License:MIT */ layui.define((function (e) { "use strict"; var t = document, i = "getElementById", n = "getElementsByTagName", Class = function (e) { this.config = e || {}, this.config.index = ++o.index, this.render(!0) }; Class.prototype.type = function () { var e = this.config; if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3 }, Class.prototype.view = function () { var e = this.config, t = e.groups = "groups" in e ? 0 | e.groups : 5; e.layout = "object" == typeof e.layout ? e.layout : ["prev", "page", "next"], e.count = 0 | e.count, e.curr = 0 | e.curr || 1, e.limits = "object" == typeof e.limits ? e.limits : [10, 20, 30, 40, 50], e.limit = 0 | e.limit || 10, e.pages = Math.ceil(e.count / e.limit) || 1, e.curr > e.pages && (e.curr = e.pages), t < 0 ? t = 1 : t > e.pages && (t = e.pages), e.prev = "prev" in e ? e.prev : "上一页", e.next = "next" in e ? e.next : "下一页"; var i, n = e.pages > t ? Math.ceil((e.curr + (t > 1 ? 1 : 0)) / (t > 0 ? t : 1)) : 1, o = { prev: e.prev ? '' + e.prev + "" : "", page: function () { var i = []; if (e.count < 1) return ""; n > 1 && !1 !== e.first && 0 !== t && i.push('' + (e.first || 1) + ""); var o, r = Math.floor((t - 1) / 2), s = n > 1 ? e.curr - r : 1, c = n > 1 ? (o = e.curr + (t - r - 1)) > e.pages ? e.pages : o : t; for (c - s < t - 1 && (s = c - t + 1), !1 !== e.first && s > 2 && i.push(''); s <= c; s++)s === e.curr ? i.push('" + s + "") : i.push('' + s + ""); return e.pages > t && e.pages > c && !1 !== e.last && (c + 1 < e.pages && i.push(''), 0 !== t && i.push('' + (e.last || e.pages) + "")), i.join("") }(), next: e.next ? '' + e.next + "" : "", count: '共 ' + e.count + " 条", limit: function () { var t = ['" }(), refresh: ['', '', ""].join(""), skip: ['到第', '', '页', ""].join("") }; return ['
      ', (i = [], layui.each(e.layout, (function (e, t) { o[t] && i.push(o[t]) })), i.join("")), "
      "].join("") }, Class.prototype.jump = function (e, t) { if (e) { var i = this, r = i.config, s = e.children, c = e[n]("button")[0], d = e[n]("input")[0], u = e[n]("select")[0], skip = function () { var e = 0 | d.value.replace(/\s|\D/g, ""); e && (r.curr = e, i.render()) }; if (t) return skip(); for (var h = 0, p = s.length; h < p; h++)"a" === s[h].nodeName.toLowerCase() && o.on(s[h], "click", (function () { var e = 0 | this.getAttribute("data-page"); e < 1 || e > r.pages || (r.curr = e, i.render()) })); u && o.on(u, "change", (function () { var e = this.value; r.curr * e > r.count && (r.curr = Math.ceil(r.count / e)), r.limit = e, i.render() })), c && o.on(c, "click", (function () { skip() })) } }, Class.prototype.skip = function (e) { if (e) { var t = this, i = e[n]("input")[0]; i && o.on(i, "keyup", (function (i) { var n = this.value, o = i.keyCode; /^(37|38|39|40)$/.test(o) || (/\D/.test(n) && (this.value = n.replace(/\D/, "")), 13 === o && t.jump(e, !0)) })) } }, Class.prototype.render = function (e) { var n = this.config, o = this.type(), r = this.view(); 2 === o ? n.elem && (n.elem.innerHTML = r) : 3 === o ? n.elem.html(r) : t[i](n.elem) && (t[i](n.elem).innerHTML = r), n.jump && n.jump(n, e); var s = t[i]("layui-laypage-" + n.index); this.jump(s), n.hash && !e && (location.hash = "!" + n.hash + "=" + n.curr), this.skip(s) }; var o = { render: function (e) { return new Class(e).index }, index: layui.laypage ? layui.laypage.index + 1e4 : 0, on: function (e, t, i) { return e.attachEvent ? e.attachEvent("on" + t, (function (t) { t.target = t.srcElement, i.call(e, t) })) : e.addEventListener(t, i, !1), this } }; e("laypage", o) })) }, function (e, t) { /** @Name : layui.laytpl 模板引擎 @Author:贤心 @License:MIT */ layui.define((function (e) { "use strict"; var t = { open: "{{", close: "}}" }, tool_query = function (e, i, n) { var o = ["#([\\s\\S])+?", "([^{#}])*?"][e || 0]; return exp((i || "") + t.open + o + t.close + (n || "")) }, tool_escape = function (e) { return String(e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """) }, tool_error = function (e, t) { return "Laytpl Error:" + e }, exp = function (e) { return new RegExp(e, "g") }, Tpl = function (e) { this.tpl = e }; Tpl.pt = Tpl.prototype, window.errors = 0, Tpl.pt.parse = function (e, i) { var n = e, o = exp("^" + t.open + "#", ""), r = exp(t.close + "$", ""); e = '"use strict";var view = "' + (e = e.replace(/\s+|\r|\t|\n/g, " ").replace(exp(t.open + "#"), t.open + "# ").replace(exp(t.close + "}"), "} " + t.close).replace(/\\/g, "\\\\").replace(exp(t.open + "!(.+?)!" + t.close), (function (e) { return e = e.replace(exp("^" + t.open + "!"), "").replace(exp("!" + t.close), "").replace(exp(t.open + "|" + t.close), (function (e) { return e.replace(/(.)/g, "\\$1") })) })).replace(/(?="|')/g, "\\").replace(tool_query(), (function (e) { return '";' + (e = e.replace(o, "").replace(r, "")).replace(/\\/g, "") + ';view+="' })).replace(tool_query(1), (function (e) { var i = '"+('; return e.replace(/\s/g, "") === t.open + t.close ? "" : (e = e.replace(exp(t.open + "|" + t.close), ""), /^=/.test(e) && (e = e.replace(/^=/, ""), i = '"+_escape_('), i + e.replace(/\\/g, "") + ')+"') }))) + '";return view;'; try { return this.cache = e = new Function("d, _escape_", e), e(i, tool_escape) } catch (e) { return delete this.cache, tool_error(e, n) } }, Tpl.pt.render = function (e, t) { var i; return e ? (i = this.cache ? this.cache(e, tool_escape) : this.parse(this.tpl, e), t ? void t(i) : i) : tool_error("no data") }; var laytpl = function (e) { return "string" != typeof e ? tool_error("Template not found") : new Tpl(e) }; laytpl.config = function (e) { for (var i in e = e || {}) t[i] = e[i] }, laytpl.v = "1.2.0", e("laytpl", laytpl) })) }, function (e, t) { /** @Name:layui 移动模块入口 | 构建后则为移动模块集合 @Author:贤心 @License:MIT */ layui["layui.mobile"] || layui.config({ base: layui.cache.dir + "lay/modules/mobile/" }).extend({ "layer-mobile": "layer-mobile", zepto: "zepto", "upload-mobile": "upload-mobile", "layim-mobile": "layim-mobile" }), layui.define(["layer-mobile", "zepto", "layim-mobile"], (function (e) { e("mobile", { layer: layui["layer-mobile"], layim: layui["layim-mobile"] }) })) }, function (e, t) { layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.rate ? layui.rate.index + 1e4 : 0, set: function (e) { var i = this; return i.config = t.extend({}, i.config, e), i }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }, l = function () { var e = this; return { setvalue: function (t) { e.setvalue.call(e, t) }, config: e.config } }, n = "rate", o = "layui-icon-rate", r = "layui-icon-rate-solid", s = "layui-icon-rate-half", c = "layui-icon-rate-solid layui-icon-rate-half", d = "layui-icon-rate layui-icon-rate-half", v = function (e) { var n = this; n.index = ++i.index, n.config = t.extend({}, n.config, i.config, e), n.render() }; v.prototype.config = { length: 5, text: !1, readonly: !1, half: !1, value: 0, theme: "" }, v.prototype.render = function () { var e = this, i = e.config, n = i.theme ? 'style="color: ' + i.theme + ';"' : ""; i.elem = t(i.elem), parseInt(i.value) !== i.value && (i.half || (i.value = Math.ceil(i.value) - i.value < .5 ? Math.ceil(i.value) : Math.floor(i.value))); for (var s = '" + (i.text ? '' + i.value + "星" : "") + ""; var u = i.elem, h = u.next(".layui-rate"); h[0] && h.remove(), e.elemTemp = t(s), i.span = e.elemTemp.next("span"), i.setText && i.setText(i.value), u.html(e.elemTemp), u.addClass("layui-inline"), i.readonly || e.action() }, v.prototype.setvalue = function (e) { this.config.value = e, this.render() }, v.prototype.action = function () { var e = this.config, i = this.elemTemp, n = i.find("i").width(); i.children("li").each((function (u) { var h = u + 1, p = t(this); p.on("click", (function (o) { (e.value = h, e.half) && (o.pageX - t(this).offset().left <= n / 2 && (e.value = e.value - .5)); e.text && i.next("span").text(e.value + "星"), e.choose && e.choose(e.value), e.setText && e.setText(e.value) })), p.on("mousemove", (function (u) { (i.find("i").each((function () { t(this).addClass(o).removeClass(c) })), i.find("i:lt(" + h + ")").each((function () { t(this).addClass(r).removeClass(d) })), e.half) && (u.pageX - t(this).offset().left <= n / 2 && p.children("i").addClass(s).removeClass(r)) })), p.on("mouseleave", (function () { i.find("i").each((function () { t(this).addClass(o).removeClass(c) })), i.find("i:lt(" + Math.floor(e.value) + ")").each((function () { t(this).addClass(r).removeClass(d) })), e.half && parseInt(e.value) !== e.value && i.children("li:eq(" + Math.floor(e.value) + ")").children("i").addClass(s).removeClass("layui-icon-rate-solid layui-icon-rate") })) })) }, v.prototype.events = function () { this.config }, i.render = function (e) { var t = new v(e); return l.call(t) }, e(n, i) })) }, function (e, t) { layui.define(["layer"], (function (e) { "use strict"; e("select", { fillData: function (e) { var t = e.attr("dataurl"); t && "SELECT" == e[0].tagName && (e.empty(), $.ajax({ type: "get", async: !1, url: t, dataType: "json", success: function (t) { if ("OK" == t.state) { var i = t.obj; layui.each(i, (function (t, i) { e.append("") })), null == e.val() && e.val(e.attr("default")) } }, error: function (e, t) { } })) } }) })) }, function (e, t) { layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.slider ? layui.slider.index + 1e4 : 0, set: function (e) { var i = this; return i.config = t.extend({}, i.config, e), i }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }, a = function () { var e = this; return { setValue: function (t, i) { return e.slide("set", t, i || 0) }, config: e.config } }, n = "slider", o = "layui-disabled", r = "layui-slider-bar", s = "layui-slider-wrap", c = "layui-slider-wrap-btn", d = "layui-slider-tips", u = "layui-slider-input-txt", h = "layui-slider-input-btn", p = "layui-slider-hover", f = function (e) { var n = this; n.index = ++i.index, n.config = t.extend({}, n.config, i.config, e), n.render() }; f.prototype.config = { type: "default", min: 0, max: 100, value: 0, step: 1, showstep: !1, tips: !0, input: !1, range: !1, height: 200, disabled: !1, theme: "#009688" }, f.prototype.render = function () { var e = this, i = e.config; if (i.step < 1 && (i.step = 1), i.max < i.min && (i.max = i.min + i.step), i.range) { i.value = "object" == typeof i.value ? i.value : [i.min, i.value]; var n = Math.min(i.value[0], i.value[1]), r = Math.max(i.value[0], i.value[1]); i.value[0] = n > i.min ? n : i.min, i.value[1] = r > i.min ? r : i.min, i.value[0] = i.value[0] > i.max ? i.max : i.value[0], i.value[1] = i.value[1] > i.max ? i.max : i.value[1]; var h = Math.floor((i.value[0] - i.min) / (i.max - i.min) * 100), p = Math.floor((i.value[1] - i.min) / (i.max - i.min) * 100), y = p - h + "%"; h += "%", p += "%" } else { "object" == typeof i.value && (i.value = Math.min.apply(null, i.value)), i.value < i.min && (i.value = i.min), i.value > i.max && (i.value = i.max); y = Math.floor((i.value - i.min) / (i.max - i.min) * 100) + "%" } var m = i.disabled ? "#c2c2c2" : i.theme, g = '
      ' + (i.tips ? '
      ' : "") + '
      ' + (i.range ? '
      ' : "") + "
      ", b = t(i.elem), k = b.next(".layui-slider"); if (k[0] && k.remove(), e.elemTemp = t(g), i.range ? (e.elemTemp.find("." + s).eq(0).data("value", i.value[0]), e.elemTemp.find("." + s).eq(1).data("value", i.value[1])) : e.elemTemp.find("." + s).data("value", i.value), b.html(e.elemTemp), "vertical" === i.type && e.elemTemp.height(i.height + "px"), i.showstep) { for (var w = (i.max - i.min) / i.step, C = "", D = 1; D < w + 1; D++) { var E = 100 * D / w; E < 100 && (C += '
      ') } e.elemTemp.append(C) } if (i.input && !i.range) { var S = t('
      '); b.css("position", "relative"), b.append(S), b.find("." + u).children("input").val(i.value), "vertical" === i.type ? S.css({ left: 0, top: -48 }) : e.elemTemp.css("margin-right", S.outerWidth() + 15) } i.disabled ? (e.elemTemp.addClass(o), e.elemTemp.find("." + c).addClass(o)) : e.slide(), e.elemTemp.find("." + c).on("mouseover", (function () { var n = "vertical" === i.type ? i.height : e.elemTemp[0].offsetWidth, o = e.elemTemp.find("." + s), r = ("vertical" === i.type ? n - t(this).parent()[0].offsetTop - o.height() : t(this).parent()[0].offsetLeft) / n * 100, c = t(this).parent().data("value"), u = i.setTips ? i.setTips(c) : c; e.elemTemp.find("." + d).html(u), "vertical" === i.type ? e.elemTemp.find("." + d).css({ bottom: r + "%", "margin-bottom": "20px", display: "inline-block" }) : e.elemTemp.find("." + d).css({ left: r + "%", display: "inline-block" }) })).on("mouseout", (function () { e.elemTemp.find("." + d).css("display", "none") })) }, f.prototype.slide = function (e, i, n) { var o = this.config, y = this.elemTemp, f = function () { return "vertical" === o.type ? o.height : y[0].offsetWidth }, m = y.find("." + s), g = y.next(".layui-slider-input"), b = g.children("." + u).children("input").val(), k = 100 / ((o.max - o.min) / Math.ceil(o.step)), x = function (e, t) { e = (e = Math.ceil(e) * k > 100 ? Math.ceil(e) * k : Math.round(e) * k) > 100 ? 100 : e, m.eq(t).css("vertical" === o.type ? "bottom" : "left", e + "%"); var i = T(m[0].offsetLeft), n = o.range ? T(m[1].offsetLeft) : 0; "vertical" === o.type ? (y.find("." + d).css({ bottom: e + "%", "margin-bottom": "20px" }), i = T(f() - m[0].offsetTop - m.height()), n = o.range ? T(f() - m[1].offsetTop - m.height()) : 0) : y.find("." + d).css("left", e + "%"), i = i > 100 ? 100 : i, n = n > 100 ? 100 : n; var s = Math.min(i, n), c = Math.abs(i - n); "vertical" === o.type ? y.find("." + r).css({ height: c + "%", bottom: s + "%" }) : y.find("." + r).css({ width: c + "%", left: s + "%" }); var h = o.min + Math.round((o.max - o.min) * e / 100); if (b = h, g.children("." + u).children("input").val(b), m.eq(t).data("value", h), h = o.setTips ? o.setTips(h) : h, y.find("." + d).html(h), o.range) { var p = [m.eq(0).data("value"), m.eq(1).data("value")]; p[0] > p[1] && p.reverse() } o.change && o.change(o.range ? p : h) }, T = function (e) { var t = e / f() * 100 / k, i = Math.round(t) * k; return e == f() && (i = Math.ceil(t) * k), i }, w = t(['
      f() && (s = f()); var c = s / f() * 100 / k; x(c, e), i.addClass(p), y.find("." + d).show(), t.preventDefault() }), (function () { i.removeClass(p), y.find("." + d).hide() })) })) })), y.on("click", (function (e) { var i = t("." + c); if (!i.is(event.target) && 0 === i.has(event.target).length && i.length) { var n, r = "vertical" === o.type ? f() - e.clientY + t(this).offset().top : e.clientX - t(this).offset().left; r < 0 && (r = 0), r > f() && (r = f()); var s = r / f() * 100 / k; n = o.range ? "vertical" === o.type ? Math.abs(r - parseInt(t(m[0]).css("bottom"))) > Math.abs(r - parseInt(t(m[1]).css("bottom"))) ? 1 : 0 : Math.abs(r - m[0].offsetLeft) > Math.abs(r - m[1].offsetLeft) ? 1 : 0 : 0, x(s, n), e.preventDefault() } })), g.hover((function () { t(this).children("." + h).fadeIn("fast") }), (function () { t(this).children("." + h).fadeOut("fast") })), g.children("." + h).children("i").each((function (e) { t(this).on("click", (function () { var t = ((b = 1 == e ? b - o.step < o.min ? o.min : Number(b) - o.step : Number(b) + o.step > o.max ? o.max : Number(b) + o.step) - o.min) / (o.max - o.min) * 100 / k; x(t, 0) })) })); var q = function () { var e = this.value; e = (e = (e = isNaN(e) ? 0 : e) < o.min ? o.min : e) > o.max ? o.max : e, this.value = e; var t = (e - o.min) / (o.max - o.min) * 100 / k; x(t, 0) }; g.children("." + u).children("input").on("keydown", (function (e) { 13 === e.keyCode && (e.preventDefault(), q.call(this)) })).on("change", q) }, f.prototype.events = function () { this.config }, i.render = function (e) { var t = new f(e); return a.call(t) }, e(n, i) })) }, function (module, exports) { /** @Name:layui.table 表格操作 @Author:贤心 @License:MIT @version:2.4.5 */ layui.define(["laytpl", "laypage", "layer", "form", "util"], (function (exports) { "use strict"; var $ = layui.$, laytpl = layui.laytpl, laypage = layui.laypage, layer = layui.layer, form = layui.form, util = layui.util, hint = layui.hint(), device = layui.device(), table = { config: { checkName: "LAY_CHECKED", indexName: "LAY_TABLE_INDEX" }, cache: {}, checkedMultiList: [], index: layui.table ? layui.table.index + 1e4 : 0, set: function (e) { return this.config = $.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, MOD_NAME, e, t) } }, thisTable = function () { var e = this, t = e.config, i = t.id || t.index; return i && (thisTable.config[i] = t), { reload: function (t) { return e.reload.call(e, t), e.getSortcols(), thisTable.config[i] = $.extend({}, e.config, t) }, setColsWidth: function () { e.setColsWidth.call(e) }, resize: function () { e.resize.call(e) }, config: t } }, MOD_NAME = "table", ELEM = ".layui-table", THIS = "layui-this", SHOW = "layui-show", HIDE = "layui-hide", DISABLED = "layui-disabled", NONE = "layui-none", ELEM_VIEW = "layui-table-view", ELEM_TOOL = ".layui-table-tool", ELEM_BOX = ".layui-table-box", ELEM_INIT = ".layui-table-init", ELEM_HEADER = ".layui-table-header", ELEM_BODY = ".layui-table-body", ELEM_MAIN = ".layui-table-main", ELEM_FIXED = ".layui-table-fixed", ELEM_FIXL = ".layui-table-fixed-l", ELEM_FIXR = ".layui-table-fixed-r", ELEM_TOTAL = ".layui-table-total", ELEM_PAGE = ".layui-table-page", ELEM_SORT = ".layui-table-sort", ELEM_EDIT = "layui-table-edit", ELEM_HOVER = "layui-table-hover", TPL_HEADER = function (e, t) { return t = t || {}, "cardListMode" == e ? ['
        ', "{{# layui.each(d.data.sortcols, function(i1, item1){ }}", "{{# layui.each(item1, function(i2, item2){ }}", '
      • ', '
        ', '{{# if(item2.type === "checkbox"){ }}', '', "{{# } }}", '{{item2.title||""}}', '{{# if(item2.type != "checkbox"){ }}', '', "{{# } }}", "
        ", "
      • ", "{{# }); }}", "{{# }); }}", "
      "].join("") : ['', "", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "", "{{# layui.each(item1, function(i2, item2){ }}", '{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}', '{{# if(item2.fixed === "right"){ right = true; } }}', t.fixed && "right" !== t.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === t.fixed ? '{{# if(item2.fixed === "right"){ }}' : "", "{{# var isSort = !(item2.colGroup) && item2.sort; }}", '", t.fixed ? "{{# }; }}" : "", "{{# }); }}", "", "{{# }); }}", "", "
      ', '
      ', '{{# if(item2.type === "checkbox"){ }}', '', "{{# } else { }}", '{{item2.title||""}}', "{{# if(isSort){ }}", '', "{{# } }}", "{{# } }}", "
      ", "
      "].join("") }, TPL_BODY = function (e) { return "cardListMode" == e ? ['
      ', "
      "].join("") : ['', "", "
      "].join("") }, TPL_MAIN = function (e) { return "cardListMode" == e ? ['
      ', "{{# if(d.data.toolbar){ }}", '
      ', '
      ', '
      ', "
      ", "{{# } }}", '
      ', "{{# if(d.data.loading){ }}", '
      ', '', "
      ", "{{# } }}", "{{# var left, right; }}", '
      ', TPL_HEADER(e), "
      ", '
      ', TPL_BODY(e), "
      ", "
      ", "{{# if(d.data.totalRow){ }}", '
      ', '
      ', '', "
      ", "
      ", "{{# } }}", "{{# if(d.data.page){ }}", '
      ', '
      ', "
      ", "{{# } }}", "", "
      "].join("") : ['
      ', "{{# if(d.data.toolbar){ }}", '
      ', '
      ', '
      ', "
      ", "{{# } }}", '
      ', "{{# if(d.loading){ }}", '
      ', '', "
      ", "{{# } }}", "{{# var left, right; }}", '
      ', TPL_HEADER(e), "
      ", '
      ', TPL_BODY(e), "
      ", "{{# if(left){ }}", '
      ', '
      ', TPL_HEADER(e, { fixed: !0 }), "
      ", '
      ', TPL_BODY(e), "
      ", "
      ", "{{# }; }}", "{{# if(right){ }}", '
      ', '
      ', TPL_HEADER(e, { fixed: "right" }), '
      ', "
      ", '
      ', TPL_BODY(e), "
      ", "
      ", "{{# }; }}", "
      ", '{{# if(d.data.totalRow && d.data.mode!="cardListMode"){ }}', '
      ', '', '', "
      ", "
      ", "{{# } }}", "{{# if(d.data.page){ }}", '
      ', '
      ', "
      ", "{{# } }}", "", "
      "].join("") }, _WIN = $(window), _DOC = $(document), Class = function (e) { if (this.index = ++table.index, e.response = $.extend({ statusName: "code", statusCode: 0, msgName: "msg", dataName: "data", countName: "count" }, e.response), !e.sortcols && "cardListMode" == e.mode) { var t = []; layui.each(e.cols, (function (e, i) { layui.each(i, (function (e, i) { i.field && "image" != i.type && t.push(i) })) })), this.config.sortcols = this.config.sortcols.concat([t]) } this.config = $.extend({}, this.config, table.config, e); var i = this.getUserPdata(); i && this.setUserPdata(i), this.render() }; Class.prototype.config = { limit: 20, loading: !0, cellMinWidth: 60, defaultToolbar: ["filter", "exports", "print"], mode: "listMode", sortcols: [[{ type: "checkbox", title: "全选" }]], vertical: !1, text: { none: "无数据" }, flipCheck: !1, onlyKey: "RWID", attachFieldsName: [] }, Class.prototype.render = function () { var e = this.config; if (e.elem = $(e.elem), e.where = e.where || {}, e.id = e.id || e.elem.attr("id") || e.index, e.sortload = null == e.sortload || e.sortload, e.request = $.extend({ pageName: "page", limitName: "limit" }, e.request), "object" == typeof e.page && (e.limit = e.page.limit || e.limit, e.limits = e.page.limits || e.limits, this.page = e.page.curr = e.page.curr || 1, delete e.page.elem, delete e.page.jump), !e.elem[0]) return this; e.height && /^full-\d+$/.test(e.height) && (this.fullHeightGap = e.height.split("-")[1], e.height = _WIN.height() - this.fullHeightGap), this.setInit(); var t = e.elem, i = "listMode" == e.mode ? ELEM_VIEW : ELEM_VIEW + " layui-table-ext", n = t.next("." + ELEM_VIEW), o = this.elem = $(laytpl(TPL_MAIN(e.mode)).render({ VIEW_CLASS: i, data: e, index: this.index })); if (e.index = this.index, n[0] && n.remove(), t.after(o), this.layTool = o.find(ELEM_TOOL), this.layBox = o.find(ELEM_BOX), this.layHeader = o.find(ELEM_HEADER), this.layMain = o.find(ELEM_MAIN), this.layBody = o.find(ELEM_BODY), this.layFixed = o.find(ELEM_FIXED), this.layFixLeft = o.find(ELEM_FIXL), this.layFixRight = o.find(ELEM_FIXR), this.layTotal = o.find(ELEM_TOTAL), this.layPage = o.find(ELEM_PAGE), this.renderToolbar(), this.fullSize(), e.cols.length > 1) { var r = this.layFixed.find(ELEM_HEADER).find("th"); r.height(this.layHeader.height() - 1 - parseFloat(r.css("padding-top")) - parseFloat(r.css("padding-bottom"))) } this.pullData(this.page), this.events() }, Class.prototype.getSortcols = function (e) { var t = this.config; if (1 == t.sortcols[0].length && "cardListMode" == t.mode) { var i = []; this.eachCols((function (e, t) { if (t.field && "normal" == t.type) { var n = { field: t.field, title: t.title, hide: t.hide, key: t.key }; i.push(n) } })); var n = [], o = function (e) { for (var t = [], i = [], n = e.length, o = 0; o < n; o++) { for (var r = o + 1; r < n; r++)e[o].field === e[r].field && (r = ++o); t.push(e[o]), i.push(o) } return t }(this.config.sortcols[0].concat(i)); n.push(o), this.config.sortcols = n } }, Class.prototype.getUserPdata = function () { var e = this.config; if (e && e.updId) { var t, i = { updId: e.updId }; if ($.ajax({ type: "post", url: layui.cache.contentPath + "/admin/coreupd/query", async: !1, data: i, dataType: "json", success: function (i) { i && i[e.response.statusName] == e.response.statusCode && (t = i[e.response.dataName] || []) }, error: function (e, t) { } }), t) return t } }, Class.prototype.setUserPdata = function (updColumns) { var that = this, options = that.config; if (options && options.updId && updColumns) { var datas = {}; layui.each(updColumns, (function (i1, data1) { data1 && data1.UPD_CONTENT && (data1 = eval("(" + data1.UPD_CONTENT + ")"), layui.each(data1, (function (e, t) { t && t.field && (datas[t.field] = t) }))) })), that.config.userPdatas || $.extend(that.config, { userPdatas: {} }), $.extend(that.config.userPdatas, datas), layui.each(options.cols, (function (e, t) { layui.each(t, (function (e, t) { t.field && datas[t.field] && (t.hide = datas[t.field].hide) })) })) } }, Class.prototype.saveUserPdata = function (e) { var t = this.config; if (t && t.updId && e) { var i = {}; layui.each(e, (function (e, t) { t && t.field && (i[t.field] = t) })), this.config.userPdatas || $.extend(this.config, { userPdatas: {} }), $.extend(this.config.userPdatas, i); var n = []; $.each(this.config.userPdatas, (function (e, t) { n.push(t) })); var o = { UPD_CONTENT: JSON.stringify(n), UPD_SHIYCJID: t.updId, UPD_SHIFQY: 1 }; $.ajax({ type: "post", url: layui.cache.contentPath + "/admin/coreupd/modify", data: o, dataType: "json", success: function (e) { }, error: function (e, t) { } }) } }, Class.prototype.initOpts = function (e) { this.config; e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || { checkbox: 48, radio: 48, space: 15, numbers: 40 }[e.type]) }, Class.prototype.setInit = function (e) { var t, i = this, n = i.config; if (n.clientWidth = n.width || (t = function (e) { var i, o; i = (e = e || n.elem.parent()).width(); try { o = "none" === e.css("display") } catch (e) { } return !e[0] || i && !o ? i : t(e.parent()) })(), "width" === e) return n.clientWidth; layui.each(n.cols, (function (e, t) { layui.each(t, (function (o, r) { if (r) { if (r.key = e + "-" + o, r.hide = r.hide || !1, r.colGroup || r.colspan > 1) { var s = 0; layui.each(n.cols[e + 1], (function (t, i) { i.HAS_PARENT || s > 1 && s == r.colspan || (i.HAS_PARENT = !0, i.parentKey = e + "-" + o, s += parseInt(i.colspan > 1 ? i.colspan : 1)) })), r.colGroup = !0 } i.initOpts(r) } else t.splice(o, 1) })) })) }, Class.prototype.renderToolbar = function () { var e = this.config, t = ['
      ', '
      ', '
      '].join(""), i = this.layTool.find(".layui-table-tool-temp"); if ("default" === e.toolbar) i.html(t); else if (e.toolbar) { var n = $(e.toolbar).html() || ""; n && i.html(laytpl(n).render(e)) } var o = { filter: { title: "筛选列", layEvent: "LAYTABLE_COLS", icon: "layui-icon-cols" }, exports: { title: "导出", layEvent: "LAYTABLE_EXPORT", icon: "layui-icon-export" }, print: { title: "打印", layEvent: "LAYTABLE_PRINT", icon: "layui-icon-print" } }, r = []; "object" == typeof e.defaultToolbar && layui.each(e.defaultToolbar, (function (e, t) { var i = o[t]; i && r.push('
      ') })), this.layTool.find(".layui-table-tool-self").html(r.join("")); var s = this.layTool.find(".layui-table-tool-self"); i.css("padding-right", s.width() + 17 + "px") }, Class.prototype.setParentCol = function (e, t) { var i = this.config, n = this.layHeader.find('th[data-key="' + i.index + "-" + t + '"]'), o = parseInt(n.attr("colspan")) || 0; if (n[0]) { var r = t.split("-"), s = i.cols[r[0]][r[1]]; e ? o-- : o++, n.attr("colspan", o), n[o < 1 ? "addClass" : "removeClass"](HIDE), s.colspan = o, s.hide = o < 1; var c = n.data("parentkey"); c && this.setParentCol(e, c) } }, Class.prototype.setColsPatch = function () { var e = this, t = e.config; layui.each(t.cols, (function (t, i) { layui.each(i, (function (t, i) { i.hide && e.setParentCol(i.hide, i.parentKey) })) })) }, Class.prototype.setColsWidth = function () { var e = this, t = e.config, i = 0, n = 0, o = 0, r = 0, s = e.setInit("width"); e.eachCols((function (e, t) { t.hide || i++ })), s = s - ("line" === t.skin || "nob" === t.skin ? 2 : i + 1) - e.getScrollWidth(e.layMain[0]) - 1; var getAutoWidth = function (e) { layui.each(t.cols, (function (i, c) { layui.each(c, (function (i, d) { var u = 0, h = d.minWidth || t.cellMinWidth; d ? d.colGroup || d.hide || (e ? o && o < h && (n--, u = h) : (u = d.width || 0, /\d+%$/.test(u) ? (u = Math.floor(parseFloat(u) / 100 * s)) < h && (u = h) : u || (d.width = u = 0, n++)), d.hide && (u = 0), r += u) : c.splice(i, 1) })) })), s > r && n && (o = (s - r) / n) }; getAutoWidth(), getAutoWidth(!0), e.autoColNums = n, e.eachCols((function (i, n) { var r = n.minWidth || t.cellMinWidth; n.colGroup || n.hide || (0 === n.width ? e.getCssRule(t.index + "-" + n.key, (function (e) { e.style.width = Math.floor(o >= r ? o : r) + "px" })) : /\d+%$/.test(n.width) && e.getCssRule(t.index + "-" + n.key, (function (e) { e.style.width = Math.floor(parseFloat(n.width) / 100 * s) + "px" }))) })); var c = e.layMain.width() - e.getScrollWidth(e.layMain[0]) - e.layMain.children("table").outerWidth(); if (e.autoColNums && c >= -i && c <= i) { var getEndTh = function (t) { return !(t = t || e.layHeader.eq(0).find("thead th:last-child")).data("field") && t.prev()[0] ? getEndTh(t.prev()) : t }, d = getEndTh(), u = d.data("key"); e.getCssRule(u, (function (t) { var i = t.style.width || d.outerWidth(); t.style.width = parseFloat(i) + c + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px") })) } e.loading(!0) }, Class.prototype.resize = function () { this.fullSize(), this.setColsWidth(), this.scrollPatch() }, Class.prototype.reload = function (e) { var t = this.config; this.config.data && this.config.data.constructor === Array && delete this.config.data; var i = !1; if (t.updId && t.mode && e.mode && t.mode != e.mode && (i = !0), this.config = $.extend({}, this.config, e), i) { var n = this.getUserPdata(); n && this.setUserPdata(n) } this.render() }, Class.prototype.page = 1, Class.prototype.pullData = function (e) { var t = this, i = t.config, n = i.request, o = i.response, sort = function () { if ("object" == typeof i.initSort) if (i.dataSource && i.initSort) for (var e in i.initSort) t.sort(e, i.initSort[e]); else t.sort(i.initSort.field, i.initSort.type) }; if (t.startTime = (new Date).getTime(), i.url) { var r = {}; i.page && (r[n.pageName] = String(e), r[n.limitName] = String(i.limit)); var s = $.extend(r, i.where); i.contentType && 0 == i.contentType.indexOf("application/json") && (s = JSON.stringify(s)), $.ajax({ type: i.method || "get", url: i.url, contentType: i.contentType, traditional: i.traditional, data: s, dataType: "json", headers: i.headers || {}, success: function (n) { "function" == typeof i.parseData && (n = i.parseData(n) || n), n[o.statusName] != o.statusCode ? (t.renderForm(), t.layMain.html('
      ' + (n[o.msgName] || "返回的数据不符合规范,正确的成功状态码 (" + o.statusName + ") 应为:" + o.statusCode) + "
      ")) : (t.renderData(n, e, n[o.countName]), sort(), i.time = (new Date).getTime() - t.startTime + " ms"), t.setColsWidth(), "function" == typeof i.done && i.done(n, e, n[o.countName]) }, error: function (e, i) { t.layMain.html('
      数据接口请求异常:' + i + "
      "), t.renderForm(), t.setColsWidth() } }) } else if (i.dataSource) { var c = {}, d = e * i.limit - i.limit; "function" == typeof i.parseData && (c = i.parseData(c) || c), c[o.dataName] = i.data, c[o.countName] = i.count, t.renderData(c, e, c[o.countName]), sort(), i.time = (new Date).getTime() - t.startTime + " ms", t.setColsWidth(), "function" == typeof i.done && i.done(c, e, c[o.countName]) } else if (i.data && i.data.constructor === Array) { c = {}, d = e * i.limit - i.limit; c[o.dataName] = i.data.concat().splice(d, i.limit), c[o.countName] = i.data.length, t.renderData(c, e, i.data.length), sort(), t.setColsWidth(), "function" == typeof i.done && i.done(c, e, c[o.countName]) } }, Class.prototype.eachCols = function (e) { return table.eachCols(null, e, this.config.cols), this }, Class.prototype.eachTotalCols = function (e) { return table.eachTotalCols(null, e, this.config.totalcols), this }, Class.prototype.renderData = function (e, t, i, n) { var o = this, r = o.config, s = e[r.response.dataName] || [], c = [], d = [], u = [], render = function () { var e; if (!n && o.sortKey) return o.sort(o.sortKey.field, o.sortKey.sort, !0); if (layui.each(s, (function (i, s) { var h = [], p = [], y = [], m = [], g = [], b = i + r.limit * (t - 1) + 1; if (n || (s[table.config.indexName] = i), o.eachCols((function (t, n) { var c = n.field || t, d = r.index + "-" + n.key, u = s[c], k = n.title; if (null == u && (u = ""), !n.colGroup) { if ("imgListMode" == r.mode) { if ("checkbox" == n.type || "radio" == n.type || "numbers" == n.type) { var w = []; w = [''), '
      ' + function () { var t = $.extend(!0, { LAY_INDEX: b }, s), c = table.config.checkName; switch (n.type) { case "checkbox": var d = s[o.config.onlyKey]; return '"; case "radio": return t[c] && (e = i), ''; case "numbers": return b } }(), "
      "].join("") } else { var C = []; C = ['
    • ', '
      ' + function () { var e = $.extend(!0, { LAY_INDEX: b }, s); return n.toolbar ? laytpl($(n.toolbar).html() || "").render(e) : n.templet ? "function" == typeof n.templet ? n.templet(e) : laytpl($(n.templet).html() || String(u)).render(e) : u }(), "
    • "].join("") } m.push(C) } else if ("cardListMode" == r.mode) { var D = $.extend(!0, { LAY_INDEX: b }, s), E = table.config.checkName, S = (w = [], []); switch (n.type) { case "checkbox": var L = s[o.config.onlyKey]; w = ['
      "].join(""); break; case "radio": D[E] && (e = i), w = ['
      '].join(""); break; case "image": w = ['"].join(""); break; default: S = ['
      ' + function () { var e = $.extend(!0, { LAY_INDEX: b }, s); return n.toolbar ? laytpl($(n.toolbar).html() || "").render(e) : n.templet ? "function" == typeof n.templet ? n.templet(e) : laytpl($(n.templet).html() || String(u)).render(e) : k + ":" + u }(), "
      "].join("") }0 != S.length && g.push(S) } else w = ['', '
      ' + function () { var t = $.extend(!0, { LAY_INDEX: b }, s), c = table.config.checkName; switch (n.type) { case "checkbox": var d = s[o.config.onlyKey]; return '"; case "radio": return t[c] && (e = i), ''; case "numbers": return b; case "currency": if (!n.templet) return n.tofix ? table.formatNumberByPermil(parseFloat(s[n.field]).toFixed(parseInt(n.tofix))) : table.formatNumberByPermil(s[n.field]) }return n.toolbar ? laytpl($(n.toolbar).html() || "").render(t) : n.templet ? "function" == typeof n.templet ? n.templet(t) : laytpl($(n.templet).html() || String(u)).render(t) : n.tofix ? parseFloat(u).toFixed(parseInt(n.tofix)) : u }(), "
      "].join(""); var N, A; h.push(w), "cardListMode" != r.mode && (n.fixed && "right" !== n.fixed && p.push(w), "right" === n.fixed && y.push(w)) } })), "imgListMode" == r.mode) { var k = r.setsing, w = ""; if (k) { for (var C = [], D = 0, E = k.length; D < E; D++)s && C.push("
    • " + k[D].title + ":" + s[k[D].field] + "
    • "); w = '
        ' + C.join("") + "
      " } c.push('' + h.join("") + '' + w + '
        ' + m.join("") + "
      ") } else "cardListMode" == r.mode ? r.vertical ? c.push('
      ' + h.join("") + '
      ' + g.join("") + "
      ") : c.push('
      ' + h.join("") + '
      ' + g.join("") + "
      ") : (c.push('' + h.join("") + ""), d.push('' + p.join("") + ""), u.push('' + y.join("") + "")) })), o.layBody.scrollTop(0), o.layMain.find("." + NONE).remove(), "cardListMode" == r.mode) var i = ".layui-table"; else i = "tbody"; if (o.layMain.find(i).html(c.join("")), "listMode" == r.mode && (o.layFixLeft.find("tbody").html(d.join("")), o.layFixRight.find("tbody").html(u.join(""))), $(".imgbox a").length > 0) { var h = $(".imgbox a").height(); h && $(".imgbox a").css("line-height", h + "px") } $(".layui-table-cell").find("select").length > 0 && ($(".layui-table-cell").find("select").parent(".layui-table-cell").css("overflow", "visible"), $(".layui-table-cell").find("select").parent(".layui-table-cell").addClass("layui-table-cell-active")), o.renderForm(), "number" == typeof e && o.setThisRowChecked(e), o.syncCheckAll(), o.scrollPatch(), layer.close(o.tipsIndex), o.loadingnews(!0), r.HAS_SET_COLS_PATCH || o.setColsPatch(), r.HAS_SET_COLS_PATCH = !0 }; if (o.key = r.id || r.index, table.cache[o.key] = s, o.config.flipCheck && null == table.checkedMultiList[o.key] && (table.checkedMultiList[o.key] = []), o.layPage[0 == i || 0 === s.length && 1 == t ? "addClass" : "removeClass"](HIDE), n) return render(); if (0 === s.length) { o.renderForm(), o.layFixed.remove(), o.layMain.find("tbody").html(""), o.layMain.find("." + NONE).remove(); var h = 0, p = 0, y = 0, m = 0; return o.layMain.height() > 150 ? (h = "40px", p = "80px", y = "22px", m = "10px") : (h = "10px", p = "40px", y = "14px", m = "5px"), o.layMain.append('
      ' + r.text.none + "
      ") } render(), o.renderTotal(s), r.page && (r.page = $.extend({ elem: "layui-table-page" + r.index, count: i, limit: r.limit, limits: r.limits || [20, 50, 100, 200, 500, 1e3], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '', next: '', jump: function (e, t) { t || (r.limit = e.limit, o.loadingnews(), r.dataSource ? r.dataSource.reload({ params: { page: e.curr, limit: e.limit } }) : o.pullData(e.curr)) } }, r.page), r.page.count = i, laypage.render(r.page)) }, Class.prototype.renderTotal = function (e) { var t = this, i = t.config, n = {}; if (i.totalRow) { layui.each(e, (function (e, o) { 0 !== o.length && ("cardListMode" == i.mode ? t.eachTotalCols((function (e, i) { var r = i.field || e, s = o[r]; i.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) })) : t.eachCols((function (e, i) { var r = i.field || e, s = o[r]; i.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) }))) })); var o = []; "cardListMode" == i.mode ? (t.eachTotalCols((function (e, t) { var i = t.field || e; if (!t.hide) { var r, s, c, d, u, h, p = ['
      ') + (r = t.totalRowText || "", s = t.unit || "", c = parseFloat(t.total) || 0, d = t.classname || "total" + e, u = t.decimal, t.totalRow && !t.checkstate ? t.totalRow ? r + '' + (u ? n[i].toFixed(2) : n[i]) + "" + s : r : r + '' + (u ? c.toFixed(2) : c) + "" + s), "
      "].join(""); o.push(p) } })), t.layTotal.find(".layui-table-total-box").html(o.join(""))) : (t.eachCols((function (e, t) { var r = t.field || e; if (!t.hide) { t.tofix && (n[r] = parseFloat(n[r]).toFixed(parseInt(t.tofix))); var s, c, d, u = ['"), '
      ') + (s = t.totalRowText || "", t.totalRow ? "currency" === t.type ? table.formatNumberByPermil(n[r] || s) : n[r] || s : s), "
      "].join(""); o.push(u) } })), t.layTotal.find("tbody").html("" + o.join("") + "")) } }, Class.prototype.renderCheckTotal = function (e) { var t = this, i = t.config, n = {}; i.totalRow && (layui.each(e, (function (e, i) { 0 !== i.length && t.eachTotalCols((function (e, o) { var r = o.field || e, s = i[r]; o.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) })) })), t.eachTotalCols((function (i, o) { var r = o.field || i; if (!o.hide) { o.totalRowText, o.unit; var s = o.classname || "total" + i, c = o.decimal, d = n[r] ? n[r] : 0; o.checkstate && (o.field ? t.layTotal.find(".layui-table-total-box ." + s).text(c ? d.toFixed(2) : d) : t.layTotal.find(".layui-table-total-box ." + s).text(e.length)) } }))) }, Class.prototype.add = function (e, t) { var i, n, o, r; try { i = e.toString().split(".")[1].length } catch (e) { i = 0 } try { n = t.toString().split(".")[1].length } catch (e) { n = 0 } if (r = Math.abs(i - n), o = Math.pow(10, Math.max(i, n)), r > 0) { var s = Math.pow(10, r); i > n ? (e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")) * s) : (e = Number(e.toString().replace(".", "")) * s, t = Number(t.toString().replace(".", ""))) } else e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")); return (e + t) / o }, Class.prototype.getColElem = function (e, t) { var i = this.config; return e.eq(0).find(".laytable-cell-" + i.index + "-" + t + ":eq(0)") }, Class.prototype.renderForm = function (e) { form.render(e, "LAY-table-" + this.index) }, Class.prototype.setThisRowChecked = function (e) { var t = "cardListMode" == this.config.mode ? ".card-item" : "tr"; this.layBody.find(t + '[data-index="' + e + '"]').addClass("layui-table-click").siblings("tr").removeClass("layui-table-click") }, Class.prototype.sort = function (e, t, i, n) { var o, r = {}, s = this.config, c = "cardListMode" == s.mode ? "li" : "th", d = s.elem.attr("lay-filter"), u = table.cache[this.key]; "string" == typeof e && this.layHeader.find(c).each((function (t, i) { var n = $(this), o = n.data("field"); if (o === e) return e = n, h = o, !1 })); try { var h = h || e.data("field"), p = e.data("key"); if (this.sortKey && !i && h === this.sortKey.field && t === this.sortKey.sort) return; var y = this.layHeader.find(c + " .laytable-cell-" + p).find(ELEM_SORT); s.dataSource || this.layHeader.find(c).find(ELEM_SORT).removeAttr("lay-sort"), y.attr("lay-sort", t || null), "cardListMode" != s.mode && this.layFixed.find("th") } catch (e) { return hint.error("Table modules: Did not match to field") } this.sortKey = { field: h, sort: t }, s.sortload || ("asc" === t ? o = layui.sort(u, h) : "desc" === t ? o = layui.sort(u, h, !0) : (o = layui.sort(u, table.config.indexName), delete this.sortKey)), r[s.response.dataName] = o || u, this.renderData(r, this.page, this.count, !0), n && layui.event.call(e, MOD_NAME, "sort(" + d + ")", { field: h, type: t }) }, Class.prototype.loading = function (e) { this.config.loading && (e ? (this.layInit && this.layInit.remove(), delete this.layInit, this.layBox.find(ELEM_INIT).remove()) : (this.layInit = $(['
      ', '', "
      "].join("")), this.layBox.append(this.layInit))) }, Class.prototype.loadingnews = function (e) { var t = layer.msg("数据查询中,请稍候...", { icon: 16, time: !1, shade: .1 }); e && layer.close(t) }, Class.prototype.setCheckData = function (e, t) { var i = this.config, n = table.cache[this.key]; n[e] && n[e].constructor !== Array && (n[e][i.checkName] = t) }, Class.prototype.syncCheckAll = function () { var e = this, t = e.config, i = e.layHeader.find('input[name="layTableCheckbox"]'), syncColsCheck = function (i) { return e.eachCols((function (e, n) { "checkbox" === n.type && (n[t.checkName] = i) })), i }; i[0] && (table.checkStatus(e.key).isAll ? (i[0].checked || (i.prop("checked", !0), e.renderForm("checkbox")), syncColsCheck(!0)) : (i[0].checked && (i.prop("checked", !1), e.renderForm("checkbox")), syncColsCheck(!1))) }, Class.prototype.getCssRule = function (e, t) { var i = this.elem.find("style")[0], n = i.sheet || i.styleSheet || {}, o = n.cssRules || n.rules; layui.each(o, (function (i, n) { if (n.selectorText === ".laytable-cell-" + e) return t(n), !0 })) }, Class.prototype.fullSize = function () { var e, t = this.config, i = t.height; this.fullHeightGap && ((i = _WIN.height() - this.fullHeightGap) < 135 && (i = 135), this.elem.css("height", i)), i && (e = parseFloat(i) - (this.layHeader.outerHeight() || 38), t.toolbar && (e -= this.layTool.outerHeight() || 50), t.totalRow && (e -= this.layTotal.outerHeight() || 40), t.page && (e = e - (this.layPage.outerHeight() || 41) - 2), this.layMain.css("height", e)) }, Class.prototype.getScrollWidth = function (e) { var t = 0; return e ? t = e.offsetWidth - e.clientWidth : ((e = document.createElement("div")).style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t }, Class.prototype.scrollPatch = function () { var e = "cardListMode" == this.config.mode ? ".layui-table" : "table", t = this.layMain.children(e), i = this.layMain.width() - this.layMain.prop("clientWidth"), n = this.layMain.height() - this.layMain.prop("clientHeight"), o = (this.getScrollWidth(this.layMain[0]), t.outerWidth() - this.layMain.width()), addPatch = function (e) { if (i && n) { if (!(e = e.eq(0)).find(".layui-table-patch")[0]) { var t = $('
      '); t.find("div").css({ width: i }), e.find("tr").append(t) } } else e.find(".layui-table-patch").remove() }; addPatch(this.layHeader), addPatch(this.layTotal); var r = this.layMain.height() - n; this.layFixed.find(ELEM_BODY).css("height", t.height() > r ? r : "auto"), this.layFixRight[o > 0 ? "removeClass" : "addClass"](HIDE), this.layFixRight.css("right", i - 1) }, Class.prototype.checkedDefault = function (e, t) { var i = ""; if (this.config.flipCheck) { var n = this.config.onlyKey; if (null != table.checkedMultiList[this.key] && table.checkedMultiList[this.key].length > 0) { var o = table.checkedMultiList[this.key].filter((function (t, i) { return t[n] == e })); null != o && o.length > 0 && (i = "checked", this.setCheckData(t, !0)) } this.syncCheckAll() } return i }, Class.prototype.events = function () { var e, t = this, i = t.config, n = $("body"), o = "cardListMode" == i.mode ? "li" : "th", r = "cardListMode" == i.mode ? ".card-item" : "tr", s = {}, c = t.layHeader.find(o), d = ".layui-table-cell", u = i.elem.attr("lay-filter"); t.layTool.on("click", "*[lay-event]", (function (e) { var n, o = $(this), r = o.attr("lay-event"), openPanel = function (e) { var i = $(e.list), n = $('
        '); n.html(i), o.find(".layui-table-tool-panel")[0] || o.append(n), t.renderForm(), n.on("click", (function (e) { layui.stope(e) })), e.done && e.done(n, i) }; switch (layui.stope(e), _DOC.trigger("table.tool.panel.remove"), layer.close(t.tipsIndex), r) { case "LAYTABLE_COLS": openPanel({ list: (n = [], t.eachCols((function (e, t) { t.field && "normal" == t.type && n.push('
      • ') })), n.join("")), done: function () { form.on("checkbox(LAY_TABLE_TOOL_COLS)", (function (e) { var n = $(e.elem), o = this.checked, r = n.data("key"), s = n.data("parentkey"), c = [], d = { field: n.attr("name"), title: n.attr("title"), hide: !o, key: r }; if (layui.each(i.cols, (function (e, n) { layui.each(n, (function (n, d) { if (e + "-" + n === r) { var u = d.hide; d.hide = !o, t.elem.find('*[data-key="' + i.index + "-" + r + '"]')[o ? "removeClass" : "addClass"](HIDE), u != d.hide && t.setParentCol(!o, s), t.fullSize(), t.scrollPatch(), t.setColsWidth() } d.field && "normal" == d.type && c.push({ field: d.field, hide: d.hide }) })) })), t.saveUserPdata(c), 1 == i.sortcols[0].length && "cardListMode" == i.mode) { for (var u = t.config.sortcols[0], h = 0; h < u.length; h++)u[h].field == d.field && (u[h] = d); var p = []; p.push(u), t.config.sortcols = p } })) } }); break; case "LAYTABLE_EXPORT": device.ie ? layer.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出", this, { tips: 3 }) : openPanel({ list: ['
      • 导出到 Csv 文件
      • ', '
      • 导出到 Excel 文件
      • '].join(""), done: function (e, t) { t.on("click", (function () { var e = $(this).data("type"); table.exportFile(i.id, null, e) })) } }); break; case "LAYTABLE_PRINT": var s = window.open("打印窗口", "_blank"), c = [""].join(""), d = $(t.layHeader.html()); d.append(t.layMain.find("table").html()), d.find("th.layui-table-patch").remove(), d.find(".layui-table-col-special").remove(), s.document.write(c + d.prop("outerHTML")), s.document.close(), s.print(), s.close() }layui.event.call(this, MOD_NAME, "toolbar(" + u + ")", $.extend({ event: r, config: i }, {})) })), c.on("mousemove", (function (e) { var t = $(this), i = t.offset().left, o = e.clientX - i; t.data("unresize") || s.resizeStart || (s.allowResize = t.width() - o <= 10, n.css("cursor", s.allowResize ? "col-resize" : "")) })).on("mouseleave", (function () { $(this); s.resizeStart || n.css("cursor", "") })).on("mousedown", (function (e) { var n = $(this); if (s.allowResize) { var o = n.data("key"); e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], t.getCssRule(o, (function (e) { var t = e.style.width || n.outerWidth(); s.rule = e, s.ruleWidth = parseFloat(t), s.minWidth = n.data("minwidth") || i.cellMinWidth })) } })).on("mouseup", (function (e) { var i = $(this), n = i.data("field"), o = i.data("key"); e.preventDefault(), t.getCssRule(o, (function (e) { var o = e.style.width || i.outerWidth(); layui.each(t.config.cols, (function (e, t) { layui.each(t, (function (e, t) { t.field && t.field == n && (t.width = parseFloat(o)) })) })) })) })), _DOC.on("mousemove", (function (i) { if (s.resizeStart) { if (i.preventDefault(), s.rule) { var n = s.ruleWidth + i.clientX - s.offset[0]; n < s.minWidth && (n = s.minWidth), s.rule.style.width = n + "px", layer.close(t.tipsIndex) } e = 1 } })).on("mouseup", (function (i) { s.resizeStart && (s = {}, n.css("cursor", ""), t.scrollPatch()), 2 === e && (e = null) })), c.on("click", (function (n) { var o, r = $(this), s = r.find(ELEM_SORT), c = s.attr("lay-sort"), d = r.data("field"); if (!s[0] || 1 === e) return e = 2; if (o = "asc" === c ? "desc" : "desc" === c ? null : "asc", t.config.sortload) if (t.loadingnews(), i.dataSource) { var u = i.dataSource, h = {}; t.config.initSort = t.config.initSort || {}; var p = t.config.initSort; for (var y in p) h[y] = p[y]; h[d] = null != o ? o : "", t.config.initSort[d] = o, u.reload({ sort: h }) } else table.reload(t.config.id, { initSort: { field: d, type: o }, where: { FIELD: d, ORDER: o } }); else t.sort(r, o, null, !0) })).find(ELEM_SORT + " .layui-edge ").on("click", (function (e) { var n, o = $(this), r = o.index(), s = o.parents("th").eq(0).data("field"); if (layui.stope(e), n = 0 === r ? "asc" : "desc", t.config.sortload) if (t.loadingnews(), i.dataSource) { var c = i.dataSource, d = {}; t.config.initSort = t.config.initSort || {}; var u = t.config.initSort; for (var h in u) d[h] = u[h]; d[s] = n, t.config.initSort[s] = n, c.reload({ sort: d }) } else table.reload(t.config.id, { initSort: { field: s, type: n }, where: { FIELD: s, ORDER: n } }); else t.sort(s, n, null, !0) })); var commonMember = function (e) { var n = $(this), o = "cardListMode" == i.mode ? "dic" : "td", s = n.parents(r).eq(0).data("index"), c = t.layBody.find(r + '[data-index="' + s + '"]'), u = table.cache[t.key][s]; return $.extend({ tr: c, data: table.clearCacheKey(u), del: function () { table.cache[t.key][s] = [], c.remove(), t.scrollPatch() }, update: function (e) { e = e || {}, layui.each(e, (function (e, i) { if (e in u) { var n, r = c.children(o + '[data-field="' + e + '"]'); u[e] = i, t.eachCols((function (t, i) { i.field == e && i.templet && (n = i.templet) })), r.children(d).html(n ? "function" == typeof n ? n(u) : laytpl($(n).html() || i).render(u) : i), r.data("content", i) } })) } }, e) }; t.elem.on("click", 'input[name="layTableCheckbox"]+', (function () { var e = $(this).prev(), i = t.layBody.find('input[name="layTableCheckbox"]'), n = e.parents(r).eq(0).data("index"), o = e[0].checked, s = "layTableAllChoose" === e.attr("lay-filter"); if (s ? (i.each((function (e, i) { i.checked = o, t.setCheckData(e, o) })), t.syncCheckAll(), t.renderForm("checkbox")) : (t.setCheckData(n, o), t.syncCheckAll()), t.config.flipCheck) { var c = [], d = [], h = t.config.onlyKey; if (o) c = table.checkStatus(t.key).data; else if (s) { d = table.cache[t.key] } else { var p = table.cache[t.key]; if (!p[n]) return; if (p[n].constructor === Array) return; d.push(p[n]) } $.each(d, (function (e, i) { var n = i[t.config.onlyKey]; table.checkedMultiList[t.key] = table.checkedMultiList[t.key].filter((function (e, t) { return e[h] != n })) })), $.each(c, (function (e, i) { var n = i[t.config.onlyKey], o = table.checkedMultiList[t.key].filter((function (e, t) { return e[h] == n })); if (null == o || 0 == o.length) { var r = {}; r[h] = n, t.config.attachFieldsName.length > 0 ? $.each(t.config.attachFieldsName, (function (e, t) { r[t] = i[t] })) : r = i, table.checkedMultiList[t.key].push(r) } })) } layui.event.call(e[0], MOD_NAME, "checkbox(" + u + ")", commonMember.call(e[0], { checked: o, type: s ? "all" : "one" })), t.renderCheckTotal(table.checkStatus(t.key).data) })), t.elem.on("click", 'input[lay-type="layTableRadio"]+', (function () { var e = $(this).prev(), i = e[0].checked, n = table.cache[t.key], o = e.parents("tr").eq(0).data("index"); layui.each(n, (function (e, t) { o === e ? t.LAY_CHECKED = !0 : delete t.LAY_CHECKED })), t.setThisRowChecked(o), layui.event.call(this, MOD_NAME, "radio(" + u + ")", commonMember.call(this, { checked: i })) })), t.layBody.on("mouseenter", r, (function () { var e = $(this).index(); t.layBody.find(r + ":eq(" + e + ")").addClass(ELEM_HOVER) })).on("mouseleave", r, (function () { var e = $(this).index(); t.layBody.find(r + ":eq(" + e + ")").removeClass(ELEM_HOVER) })).on("click", r, (function () { setRowEvent.call(this, "row") })).on("dblclick", r, (function () { setRowEvent.call(this, "rowDouble") })); var setRowEvent = function (e) { var t = $(this), n = "cardListMode" == i.mode ? "dic" : "td"; layui.event.call(this, MOD_NAME, e + "(" + u + ")", commonMember.call(t.children(n)[0])) }; t.layBody.on("change", "." + ELEM_EDIT, (function () { var e = $(this), i = this.value, n = e.parent().data("field"), o = e.parents("tr").eq(0).data("index"); table.cache[t.key][o][n] = i, layui.event.call(this, MOD_NAME, "edit(" + u + ")", commonMember.call(this, { value: i, field: n })) })).on("blur", "." + ELEM_EDIT, (function () { var e, i, n = $(this), o = n.parent().data("field"), r = n.parents("tr").eq(0).data("index"), s = table.cache[t.key][r]; t.eachCols((function (t, i) { i.field == o && i.templet && (e = i.templet) })), n.siblings(d).html((i = this.value, e ? function () { return "function" == typeof e ? e(s) : laytpl($(e).html() || this.value).render(s) }() : i)), n.parent().data("content", this.value), n.remove() })), t.layBody.on("dblclick", "td", (function () { var e = $(this), n = e.data("field"), o = (e.data("edit"), e.children(d), e.parents("tr").eq(0).data("index")), r = table.cache[t.key][o]; i.event && i.event.onRowdbClick && ($('tr[data-index="' + o + '"]').addClass("layui-table-click").siblings().removeClass("layui-table-click"), i.event.onRowdbClick(n, r)) })), t.layBody.on("click", "td", (function () { var e = $(this), n = e.data("field"), o = e.data("edit"), r = e.children(d), s = e.parents("tr").eq(0).data("index"), c = table.cache[t.key][s]; if (i.event && i.event.onRowClick && ($('tr[data-index="' + s + '"]').addClass("layui-table-click").siblings().removeClass("layui-table-click"), i.event.onRowClick(n, c)), layer.close(t.tipsIndex), !e.data("off") && o) { var u = $(''); return u[0].value = e.data("content") || r.text(), e.find("." + ELEM_EDIT)[0] || e.append(u), void u.focus() } })).on("mouseenter", "td", (function () { gridExpand.call(this) })).on("mouseleave", "td", (function () { gridExpand.call(this, "hide") })); var gridExpand = function (e) { var t = $(this), i = t.children(d); if (e) t.find(".layui-table-grid-down").remove(); else if (i.prop("scrollWidth") > i.outerWidth()) { if (i.find(".layui-table-grid-down")[0]) return; t.append('
        ') } }; if (t.layBody.on("click", ".layui-table-grid-down", (function (e) { var n = $(this).parent().children(d); t.tipsIndex = layer.tips(['
        ', n.html(), "
        ", ''].join(""), n[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: device.ios || device.android ? 300 : t.elem.width() / 2, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", (function () { layer.close(t) })) } }), layui.stope(e) })), t.layBody.on("click", "*[lay-event]", (function () { var e = $(this), i = e.parents(r).eq(0).data("index"); layui.event.call(this, MOD_NAME, "tool(" + u + ")", commonMember.call(this, { event: e.attr("lay-event") })), t.setThisRowChecked(i) })), t.layMain.on("scroll", (function () { var e = $(this), i = e.scrollLeft(), n = e.scrollTop(); t.layHeader.scrollLeft(i), t.layTotal.scrollLeft(i), t.layFixed.find(ELEM_BODY).scrollTop(n), layer.close(t.tipsIndex) })), _DOC.on("click", (function () { _DOC.trigger("table.remove.tool.panel") })), _DOC.on("table.remove.tool.panel", (function () { $(".layui-table-tool-panel").remove() })), _WIN.on("resize", (function () { t.fullSize(), t.scrollPatch(), t.setColsWidth() })), void 0 === i.drag || i.drag) { if (i.cols.length > 1) return; var h = (A = $(i.elem)).next().children(".layui-table-box"), p = $.merge(h.children(".layui-table-header").children("table"), h.children(".layui-table-fixed").children(".layui-table-header").children("table")), y = h.children(".layui-table-fixed").children(".layui-table-body").children("table"), m = h.children(".layui-table-body").children("table"), g = $.merge(h.children(".layui-table-body").children("table"), y), b = A.next().children(".layui-table-total").children("table"), k = A.next().children(".layui-table-total").children("table.layui-table-total-fixed"), w = A.next().children(".layui-table-total").children("table:eq(0)"), C = i.id, D = "simple" === i.drag || i.drag && "simple" === i.drag.type, E = i.drag && i.drag.toolbar, S = !1, L = !1; if (!p.attr("drag")) { if (p.attr("drag", !0), E) { h.append('
        左固定
        不固定
        右固定
        '); var N = h.children(".soul-drag-bar"); N.children("div").on("mouseenter", (function () { $(this).addClass("active") })).on("mouseleave", (function () { $(this).removeClass("active") })) } p.find("th").each((function () { var e = $(this), t = e.data("field"), n = e.data("key"); if (n) { var o = n.split("-"), r = i.cols[o[1]][o[2]], s = o[1] + "-" + o[2], c = e.parents(".layui-table-fixed").length > 0; $(this).find("span:first,.laytable-cell-checkbox").css("cursor", "move").on("mousedown", (function (o) { if (0 === o.button) { o.preventDefault(); var d = e.clone().css("visibility", "hidden"), u = e.position().left, A = e.offset().top, _ = o.clientX - u, F = e.parents("tr:eq(0)").css("background-color"), I = e.width(), j = $(this), H = r.fixed; L = !0, $(document).bind("selectstart", (function () { return !1 })), $("body").on("mousemove", (function (o) { if (L && d) { h.removeClass("no-left-border"), S || (E && (N.attr("data-type", H || "none"), N.addClass("active")), e.after(d), e.addClass("isDrag").css({ position: "absolute", "z-index": 1, "border-left": "1px solid #e6e6e6", "background-color": F, width: I + 1 }), D || ((c ? y : g).find('td[data-key="' + n + '"]').each((function () { $(this).after($(this).clone().css("visibility", "hidden").attr("data-clone", "")), $(this).addClass("isDrag").css({ position: "absolute", "z-index": 1, "border-left": "1px solid #e6e6e6", "background-color": $(this).css("background-color"), width: I + 1 }) })), b.length > 0 && (c ? k : b).find('td[data-key="' + n + '"]').each((function () { $(this).after($(this).clone().css("visibility", "hidden").attr("data-clone", "")), $(this).addClass("isDrag").css({ position: "absolute", "z-index": 1, "background-color": $(this).parents("tr:eq(0)").css("background-color"), width: I + 1 }) })))), S = !0; var r, u, p, m, w, j = o.clientX - _, O = d.prev().prev(), z = O.length > 0, P = z ? O.data("key").split("-") : [], R = d.next().hasClass("layui-table-patch") ? [] : d.next(), B = R.length > 0, W = B ? R.data("key").split("-") : [], Y = z && d.position().left - j > O.width() / 2, X = B && j - d.position().left > R.width() / 2; if (Math.abs(d.position().left - j), d.position().left - j > 0 ? !z || !!H != !!i.cols[P[1]][P[2]].fixed : !B || !!H != !!i.cols[W[1]][W[2]].fixed) return e.css("left", d.position().left), g.find('td[data-key="' + n + '"][data-clone]').each((function (e) { $(this).prev().css("left", d.position().left) })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function (e) { $(this).prev().css("left", d.position().left) })), void h.addClass("no-left-border"); if (e.css("left", j), Y) { for (d.after(O), $("#soul-columns" + C + ">li[data-value=" + t + "]").after($("#soul-columns" + C + ">li[data-value=" + t + "]").prev()), p = 0; p < i.cols.length; p++) { for (m = 0; m < i.cols[p].length; m++)if (i.cols[p][m].key === s) { r = p, u = m; break } if (void 0 !== r && void 0 !== u) break } w = i.cols[r][u - 1], i.cols[r][u - 1] = i.cols[r][u], i.cols[r][u] = w, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)) } else if (X) { for (d.prev().before(R), $("#soul-columns" + C + ">li[data-value=" + t + "]").before($("#soul-columns" + C + ">li[data-value=" + t + "]").next()), p = 0; p < i.cols.length; p++) { for (m = 0; m < i.cols[p].length; m++)if (i.cols[p][m].key === s) { r = p, u = m; break } if (void 0 !== r && void 0 !== u) break } w = i.cols[r][u + 1], i.cols[r][u + 1] = i.cols[r][u], i.cols[r][u] = w, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)) } g.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().css("left", j), Y ? 0 !== $(this).prev().prev().length && $(this).after($(this).prev().prev()) : X && 0 !== $(this).next().length && $(this).prev().before($(this).next()) })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().css("left", j), Y ? 0 !== $(this).prev().prev().length && $(this).after($(this).prev().prev()) : X && 0 !== $(this).next().length && $(this).prev().before($(this).next()) })), o.clientY - A < -15 ? (0 === $("#column-remove").length && $("body").append(''), $("#column-remove").css({ top: o.clientY - $("#column-remove").height() / 2, left: o.clientX - $("#column-remove").width() / 2, "font-size": A - o.clientY + "px" }), $("#column-remove").show()) : $("#column-remove").hide() } })).on("mouseup", (function () { if ($(document).unbind("selectstart"), $("body").off("mousemove").off("mouseup"), L && d) { if (L = !1, S) { "checkbox" !== r.type && j.on("click", (function (e) { e.stopPropagation() })), S = !1, h.removeClass("no-left-border"), e.removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", "border-left": "inherit", width: "inherit", "background-color": "inherit" }), e.next().remove(); var o = e.prev().data("key"); if (H) { var u = h.children(".layui-table-header").children("table").find('th[data-key="' + n + '"]'); o ? u.parent().children('th[data-key="' + o + '"]').after(u) : "right" === H ? e.siblings().length > 0 && h.children(".layui-table-header").children("table").find('th[data-key="' + e.next().data("key") + '"]').prev().after(u) : (u.parent().prepend(''), u.parent().children("th:first").after(u), u.parent().children("th:first").remove()) } if (D ? (g.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { if (e.siblings().length > 0) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } } else $(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), b.length > 0 && b.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } else $(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() }))) : c ? (m.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { if (e.siblings().length > 0) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } } else $(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), y.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", "border-left": "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })), b.length > 0 && (w.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } else $(this).parent().prepend(''), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), k.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })))) : (g.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() }))), d = null, E) { if (N.children(".active").length > 0 && N.children(".active").attr("data-type") !== N.attr("data-type")) { var A, _, F, I, O = N.children(".active").attr("data-type"); for (A = 0; A < i.cols.length; A++)for (_ = 0; _ < i.cols[A].length; _++)"right" === O || "none" === O && "right" === N.attr("data-type") ? void 0 === I && ("right" === i.cols[A][_].fixed ? I = { x: A, y: _ } : _ === i.cols[A].length - 1 && (I = { x: A, y: _ + 1 })) : void 0 !== I || i.cols[A][_].fixed && "right" !== i.cols[A][_].fixed || (I = { x: A, y: _ }), i.cols[A][_].key === s && (F = { x: A, y: _ }); r.fixed = "none" !== O && O, F.y !== I.y && (i.cols[F.x].splice(F.y, 1), F.y < I.y && (I.y -= 1), i.cols[I.x].splice(I.y, 0, r), i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols))), table.reload(C) } N.removeClass("active") } } else j.unbind("click"); $("#column-remove").is(":visible") && (p.find("thead>tr>th[data-key=" + n + "]").addClass(HIDE), g.find('tbody>tr>td[data-key="' + n + '"]').addClass(HIDE), b.find('tbody>tr>td[data-key="' + n + '"]').addClass(HIDE), r.hide = !0, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)), $("#soul-columns" + C).find('li[data-value="' + t + '"]>input').prop("checked", !1), tableFilter.resize(i)), $("#column-remove").hide() } })) } })) } })) } } if (i.rowDrag) { var A = $(i.elem), _ = (y = (h = A.next().children(".layui-table-box")).children(".layui-table-fixed").children(".layui-table-body").children("table"), m = h.children(".layui-table-body").children("table"), g = $.merge(h.children(".layui-table-body").children("table"), y), C = i.id, S = !1, i.rowDrag.trigger || "row"), F = "row" === _ ? g.children("tbody").children("tr") : g.find(_); "row" !== _ && g.find(_).css("cursor", "move"), F.on("mousedown", (function (e) { if (0 === e.button) { var n = "row" === _ ? $(this) : $(this).parents("tr:eq(0)"), o = parseInt(n.data("index")), r = m.children("tbody").children("tr[data-index=" + o + "]"), s = r.clone().css("visibility", "hidden"), c = y.children("tbody").children("tr[data-index=" + o + "]"), d = h.children(".layui-table-body").scrollTop(), u = n.position().top, p = e.clientY - u; $("body").on("mousemove", (function (e) { if (!S) { S = !0; var i = A.next().find("style")[0], n = i.sheet || i.styleSheet || {}; t.addCSSRule(n, ".layui-table-view .layui-table td", "cursor: move"), t.addCSSRule(n, ".layui-table tr", "transition: none"), h.addClass("noselect"), r.after(s), r.css({ position: "absolute", "z-index": 1 }), c.each((function () { $(this).after($(this).clone().css("visibility", "hidden")), $(this).css({ position: "absolute", "z-index": 102 }) })) } var o = e.clientY - p + (h.children(".layui-table-body").scrollTop() - d), u = s.position().top, y = r.prev(), m = y.length > 0, g = s.next(), b = g.length > 0, k = m && u - o > y.height() / 2, w = b && o - u > g.height() / 2; if (u - o > 0 ? !m : !b) return r.css("top", u), void c.each((function () { $(this).css("top", u) })); function updateDataIndex(e, t) { var i = parseInt(e.data("index")) + t; return e.data("index", i), e.attr("data-index", i), e } r.css("top", o), c.each((function () { $(this).css("top", o) })), k ? (updateDataIndex(r, -1), s.after(updateDataIndex(y, 1)), c.each((function () { updateDataIndex($(this), -1), $(this).next().after(updateDataIndex($(this).prev(), 1)) }))) : w && (updateDataIndex(r, 1).before(updateDataIndex(g, -1)), c.each((function () { updateDataIndex($(this), 1), $(this).before(updateDataIndex($(this).next().next(), -1)) }))) })).on("mouseup", (function (e) { if ($("body").off("mousemove").off("mouseup"), S) { S = !1, h.removeClass("noselect"), r.css({ position: "inherit", "z-index": "inherit" }), r.next().remove(), c.each((function () { $(this).css({ position: "inherit", "z-index": "inherit" }), $(this).next().remove() })); var t = A.next().find("style")[0], s = t.sheet || t.styleSheet || {}, d = s.cssRules || s.rules; layui.each(d, (function (e, t) { ".layui-table-view .layui-table td" === t.selectorText && (t.style.cursor = "default") })); var u = n.index(); if (u !== o && "function" == typeof i.rowDrag.done) { var p = layui.table.cache[C], y = p.splice(o, 1)[0]; p.splice(u, 0, y), i.rowDrag.done.call(i, { row: y, newIndex: u, oldIndex: o, cache: p }) } } })) } })) } }, Class.prototype.addCSSRule = function (e, t, i, n) { "insertRule" in e ? e.insertRule(t + "{" + i + "}", n) : "addRule" in e && e.addRule(t, i, n) }, table.init = function (e, t) { t = t || {}; var i = $(e ? 'table[lay-filter="' + e + '"]' : ELEM + "[lay-data]"), n = "Table element property lay-data configuration item has a syntax error: "; return i.each((function () { var i = $(this), o = i.attr("lay-data"); try { o = new Function("return " + o)() } catch (e) { hint.error(n + o) } var r = [], s = $.extend({ elem: this, cols: [], data: [], skin: i.attr("lay-skin"), size: i.attr("lay-size"), even: "string" == typeof i.attr("lay-even") }, table.config, t, o); e && i.hide(), i.find("thead>tr").each((function (e) { s.cols[e] = [], $(this).children().each((function (t) { var i = $(this), o = i.attr("lay-data"); try { o = new Function("return " + o)() } catch (e) { return hint.error(n + o) } var c = $.extend({ title: i.text(), colspan: i.attr("colspan") || 0, rowspan: i.attr("rowspan") || 0 }, o); c.colspan < 2 && r.push(c), s.cols[e].push(c) })) })), i.find("tbody>tr").each((function (e) { var t = $(this), i = {}; t.children("td").each((function (e, t) { var n = $(this), o = n.data("field"); if (o) return i[o] = n.html() })), layui.each(r, (function (e, n) { var o = t.children("td").eq(e); i[n.field] = o.html() })), s.data[e] = i })), table.render(s) })), this }, thisTable.config = {}, table.eachCols = function (e, t, i) { var n = thisTable.config[e] || {}, o = [], r = 0; i = $.extend(!0, [], i || n.cols), layui.each(i, (function (e, t) { layui.each(t, (function (t, n) { if (n.colGroup) { var s = 0; r++, n.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL_INDEX || s > 1 && s == n.colspan || (t.PARENT_COL_INDEX = r, n.CHILD_COLS.push(t), s += parseInt(t.colspan > 1 ? t.colspan : 1)) })) } n.PARENT_COL_INDEX || o.push(n) })) })); var eachArrs = function (e) { layui.each(e || o, (function (e, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); "function" == typeof t && t(e, i) })) }; eachArrs() }, table.eachTotalCols = function (e, t, i) { var n = thisTable.config[e] || {}, o = [], r = 0; i = $.extend(!0, [], i || n.totalcols), layui.each(i, (function (e, t) { layui.each(t, (function (t, n) { if (n.colGroup) { var s = 0; r++, n.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL_INDEX || s > 1 && s == n.colspan || (t.PARENT_COL_INDEX = r, n.CHILD_COLS.push(t), s += parseInt(t.colspan > 1 ? t.colspan : 1)) })) } n.PARENT_COL_INDEX || o.push(n) })) })); var eachArrs = function (e) { layui.each(e || o, (function (e, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); "function" == typeof t && t(e, i) })) }; eachArrs() }, table.checkStatus = function (e) { var t = 0, i = 0, n = [], o = table.cache[e] || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[table.config.checkName] && (t++, n.push(table.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, table.exportFileZlDataSource = function (e, t) { var i = thisTable.config[e] || {}, n = layui.cache.contentPath + "/manager/coredatasource/export", o = {}; "0" == t.datalist ? (o[i.request.pageName] = i.page.curr, o[i.request.limitName] = i.limit) : "2" == t.datalist && (o[i.request.pageName] = 1, o[i.request.limitName] = 1e6), o.extraMap = { modelId: t.modelId, dsId: i.dataSource.id }, o.extraMap[i.request.pageName] = o[i.request.pageName], o.extraMap[i.request.limitName] = o[i.request.limitName]; var r = $.extend(o, t), s = $.extend(o, i.where), c = ''; $("#downloadexcelform").length > 0 && $("#downloadexcelform").remove(), r && (r = JSON.stringify(r).replace(/"/g, """).replace(/'/g, "'"), c += '"), s && $.each(s, (function (e, t) { t && (c += '") })), c += "", $("body").append(c), $("#downloadexcelform").prop("action", n), $("#downloadexcelform").submit() }, table.exportFileZl = function (e, t) { var i = thisTable.config[e] || {}; if (i.url) { var n = i.url, o = {}; o[i.request.pageName] = 1, o[i.request.limitName] = 1e6, n.indexOf("?") > -1 ? n = n.substring(0, n.indexOf("?")) + "export" + n.substring(n.indexOf("?"), n.length()) : n += "export"; var r = $.extend(o, i.where), s = '", $("body").append(s), $("#downloadexcelform").prop("action", n), $("#downloadexcelform").submit() } }, table.exportFile = function (e, t, i) { t = t || table.clearCacheKey(table.cache[e]), i = i || "csv"; var n, o, r = thisTable.config[e] || {}, s = { csv: "text/csv", xls: "application/vnd.ms-excel" }[i], c = document.createElement("a"); if (device.ie) return hint.error("IE_NOT_SUPPORT_EXPORTS"); c.href = "data:" + s + ";charset=utf-8,\ufeff" + encodeURIComponent((n = [], o = [], layui.each(t, (function (t, i) { var r = []; "object" == typeof e ? (layui.each(e, (function (e, i) { 0 == t && n.push(i || "") })), layui.each(table.clearCacheKey(i), (function (e, t) { r.push(t) }))) : table.eachCols(e, (function (e, o) { o.field && "normal" == o.type && !o.hide && (0 == t && n.push(o.title || ""), r.push(i[o.field])) })), o.push(r.join(",")) })), n.join(",") + "\r\n" + o.join("\r\n"))), c.download = (r.title || "table_" + (r.index || "")) + "." + i, document.body.appendChild(c), c.click(), document.body.removeChild(c) }, table.resize = function (e) { if (e) { if (!getThisTableConfig(e)) return; thisTable.that[e].resize() } else layui.each(thisTable.that, (function () { this.resize() })) }, table.reload = function (e, t) { var i = thisTable.config[e]; return t = t || {}, i ? (t.data && t.data.constructor === Array && delete i.data, table.render($.extend(!0, {}, i, t))) : hint.error("The ID option was not found in the table instance") }, table.render = function (e) { var t = new Class(e); return thisTable.call(t) }, table.clearCacheKey = function (e) { return delete (e = $.extend({}, e))[table.config.checkName], delete e[table.config.indexName], e }, table.deleteCheckRows = function (e) { var t = table.cache[e] || []; $.each(t, (function (t, i) { if (i.constructor !== Array && i[table.config.checkName]) { var n = "cardListMode" == table.config.mode ? ".card-item" : "table tbody tr", o = (i[table.config.checkName], i[table.config.indexName]); $("#" + e).next().find(n + "[data-index=" + o + "]").remove(), table.cache[e][o] = [] } })) }, table.formatNumberByPermil = function (e) { var t = ""; -1 != (e = e.toString()).indexOf(".") && (t = "." + e.split(".")[1], e = parseInt(e.split(".")[0])); for (var i = e.toString().split(""), n = -3; i.length + n > 0;)i.splice(n, 0, ","), n -= 4; return i.join("") + t }, table.getValue = function (e) { return table.checkedMultiList[e] }, table.setIds = function (e) { var t = { gridId: "", ids: [] }; $.extend(t, e), table.checkedMultiList[t.gridId] = [], $.each(t.ids, (function (e, i) { table.checkedMultiList[t.gridId].push(i) })) }, table.init(), exports(MOD_NAME, table) })) }, function (e, t) { /** @Name:layui.transfer 穿梭框 @Author:贤心 @License:MIT */ layui.define(["laytpl", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.laytpl, n = layui.form, o = { config: {}, index: layui.transfer ? layui.transfer.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, "transfer", e, t) } }, thisModule = function () { var e = this, t = e.config, i = t.id || e.index; return thisModule.that[i] = e, thisModule.config[i] = t, { config: t, reload: function (t) { e.reload.call(e, t) }, getData: function () { return e.getData.call(e) } } }, r = "layui-hide", s = "layui-transfer-box", c = "layui-transfer-data", TPL_BOX = function (e) { return ['
        ', '
        ', '", "
        ", "{{# if(d.data.showSearch){ }}", '", "{{# } }}", '
          ', "
          "].join("") }, d = ['
          ', TPL_BOX({ index: 0, checkAllName: "layTransferLeftCheckAll" }), '
          ', '", '", "
          ", TPL_BOX({ index: 1, checkAllName: "layTransferRightCheckAll" }), "
          "].join(""), Class = function (e) { this.index = ++o.index, this.config = t.extend({}, this.config, o.config, e), this.render() }; Class.prototype.config = { title: ["列表一", "列表二"], width: 200, height: 360, data: [], value: [], showSearch: !1, id: "", text: { none: "无数据", searchNone: "无匹配数据" } }, Class.prototype.reload = function (e) { var i = this; layui.each(e, (function (e, t) { t.constructor === Array && delete i.config[e] })), i.config = t.extend(!0, {}, i.config, e), i.render() }, Class.prototype.render = function () { var e = this, n = e.config, o = e.elem = t(i(d).render({ data: n, index: e.index })), r = n.elem = t(n.elem); r[0] && (n.data = n.data || [], n.value = n.value || [], e.key = n.id || e.index, r.html(e.elem), e.layBox = e.elem.find("." + s), e.layHeader = e.elem.find(".layui-transfer-header"), e.laySearch = e.elem.find(".layui-transfer-search"), e.layData = o.find("." + c), e.layBtn = o.find(".layui-transfer-active .layui-btn"), e.layBox.css({ width: n.width, height: n.height }), e.layData.css({ height: n.height - e.layHeader.outerHeight() - e.laySearch.outerHeight() - 2 }), e.renderData(), e.events()) }, Class.prototype.renderData = function () { var e = this.config, i = [{ checkName: "layTransferLeftCheck", views: [] }, { checkName: "layTransferRightCheck", views: [] }]; this.parseData((function (e) { var t = e.selected ? 1 : 0, n = ["
        • ", '', "
        • "].join(""); i[t].views.push(n), delete e.selected })); var n = []; layui.each(e.value, (function (e, o) { layui.each(i[1].views, (function (e, i) { var r = t(i).find("input").attr("value"); o == r && n.push(i) })) })), this.layData.eq(0).html(i[0].views.join("")), this.layData.eq(1).html(n.join("")), this.renderCheckBtn() }, Class.prototype.renderForm = function (e) { n.render(e, "LAY-transfer-" + this.index) }, Class.prototype.renderCheckBtn = function (e) { var i = this, n = i.config; e = e || {}, i.layBox.each((function (o) { var s = t(this), d = s.find("." + c), u = s.find(".layui-transfer-header").find('input[type="checkbox"]'), h = d.find('input[type="checkbox"]'), p = 0, y = !1; if (h.each((function () { var e = t(this).data("hide"); (this.checked || this.disabled || e) && p++, this.checked && !e && (y = !0) })), u.prop("checked", y && p === h.length), i.layBtn.eq(o)[y ? "removeClass" : "addClass"]("layui-btn-disabled"), !e.stopNone) { var m = d.children("li:not(." + r + ")").length; i.noneView(d, m ? "" : n.text.none) } })), i.renderForm("checkbox") }, Class.prototype.noneView = function (e, i) { var n = t('

          ' + (i || "") + "

          "); e.find(".layui-none")[0] && e.find(".layui-none").remove(), i.replace(/\s/g, "") && e.append(n) }, Class.prototype.setValue = function () { var e = this.config, i = []; return this.layBox.eq(1).find("." + c + ' input[type="checkbox"]').each((function () { t(this).data("hide") || i.push(this.value) })), e.value = i, this }, Class.prototype.parseData = function (e) { var i = this.config, n = []; return layui.each(i.data, (function (o, r) { r = ("function" == typeof i.parseData ? i.parseData(r) : r) || r, n.push(r = t.extend({}, r)), layui.each(i.value, (function (e, t) { t == r.value && (r.selected = !0) })), e && e(r) })), i.data = n, this }, Class.prototype.getData = function (e) { var t = this.config, i = []; return this.setValue(), layui.each(e || t.value, (function (e, n) { layui.each(t.data, (function (e, t) { delete t.selected, n == t.value && i.push(t) })) })), i }, Class.prototype.events = function () { var e = this, i = e.config; e.elem.on("click", 'input[lay-filter="layTransferCheckbox"]+', (function () { var n = t(this).prev(), o = n[0].checked, r = n.parents("." + s).eq(0).find("." + c); if (!n[0].disabled) { if ("all" === n.attr("lay-type") && (null == i.limit || 0 == i.limit || 0 != n.parent().parent().data("index")) && r.find('input[type="checkbox"]').each((function () { this.disabled || (this.checked = o) })), null != i.limit && i.limit > 0 && o) { var d = 0; r.find('input[type="checkbox"]').each((function () { this.checked && d++ })); var u = 0; 0 == n.parent().parent().parent().data("index") && (u = n.parent().parent().parent().next("div").next("div").find("ul li").length), d += u, i.limit < d && (n[0].checked = !1, layer.msg("最多选" + i.limit + "个", { icon: 0, time: 1500, shade: .3 })), u == i.limit && (n[0].checked = !1, layer.msg("最多选" + i.limit + "个", { icon: 0, time: 1500, shade: .3 })) } e.renderCheckBtn({ stopNone: !0 }) } })), e.layBtn.on("click", (function () { var n = t(this), o = n.data("index"), r = e.layBox.eq(o), d = []; if (!n.hasClass("layui-btn-disabled")) { e.layBox.eq(o).each((function (i) { t(this).find("." + c).children("li").each((function () { var i = t(this), n = i.find('input[type="checkbox"]'), o = n.data("hide"); n[0].checked && !o && (n[0].checked = !1, r.siblings("." + s).find("." + c).append(i.clone()), i.remove(), d.push(n[0].value)), e.setValue() })) })), e.renderCheckBtn(); var u = r.siblings("." + s).find(".layui-transfer-search input"); "" === u.val() || u.trigger("keyup"), i.onchange && i.onchange(e.getData(d), o) } })), e.laySearch.find("input").on("keyup", (function () { var n = this.value, o = t(this).parents(".layui-transfer-search").eq(0).siblings("." + c), s = o.children("li"); s.each((function () { var e = t(this), i = e.find('input[type="checkbox"]'), o = -1 !== i[0].title.indexOf(n); e[o ? "removeClass" : "addClass"](r), i.data("hide", !o) })), e.renderCheckBtn(); var d = s.length === o.children("li." + r).length; e.noneView(o, d ? i.text.searchNone : "") })) }, thisModule.that = {}, thisModule.config = {}, o.reload = function (e, t) { var i = thisModule.that[e]; return i.reload(t), thisModule.call(i) }, o.getData = function (e) { return thisModule.that[e].getData() }, o.render = function (e) { var t = new Class(e); return thisModule.call(t) }, e("transfer", o) })) }, function (e, t) { /** @Name:layui.tree 树组件 @Author:贤心 @License:MIT */ layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = layui.hint(), n = "layui-tree-enter", Tree = function (e) { this.options = e }, o = ["", ""], r = ["", ""], s = ["", ""], c = ["", ""], d = ""; Tree.prototype.init = function (e) { e.addClass("layui-box layui-tree"), this.options.skin && e.addClass("layui-tree-skin-" + this.options.skin), this.tree(e), this.on(e) }, Tree.prototype.tree = function (e, i) { var n = this, u = n.options, h = i || u.nodes; layui.each(h, (function (i, h) { var p = h.children && h.children.length > 0, y = t('
            '), m = t(["
          • ", p ? '' + (h.spread ? o[1] : o[0]) + "" : "", u.check ? '' + ("checkbox" === u.check ? r[0] : "radio" === u.check ? s[0] : "") + "" : "", '' + (p ? h.spread ? c[1] : c[0] : d) + "" + (h.name || "未命名") + "", "
          • "].join("")); p && (m.append(y), n.tree(y, h.children)), e.append(m), "function" == typeof u.click && n.click(m, h), n.spread(m, h), u.drag && n.drag(m, h) })) }, Tree.prototype.click = function (e, t) { var i = this.options; e.children("a").on("click", (function (e) { layui.stope(e), i.click(t) })) }, Tree.prototype.spread = function (e, t) { this.options; var i = e.children(".layui-tree-spread"), n = e.children("ul"), r = e.children("a"), open = function () { e.data("spread") ? (e.data("spread", null), n.removeClass("layui-show"), i.html(o[0]), r.find(".layui-icon").html(c[0])) : (e.data("spread", !0), n.addClass("layui-show"), i.html(o[1]), r.find(".layui-icon").html(c[1])) }; n[0] && (i.on("click", open), r.on("dblclick", open)) }, Tree.prototype.on = function (e) { var i = this, o = i.options, r = "layui-tree-drag"; e.find("i").on("selectstart", (function (e) { return !1 })), o.drag && t(document).on("mousemove", (function (e) { var n = i.move; if (n.from) { n.to; var o = t('
            '); e.preventDefault(), t("." + r)[0] || t("body").append(o); var s = t("." + r)[0] ? t("." + r) : o; s.addClass("layui-show").html(n.from.elem.children("a").html()), s.css({ left: e.pageX + 10, top: e.pageY + 10 }) } })).on("mouseup", (function () { var e = i.move; e.from && (e.from.elem.children("a").removeClass(n), e.to && e.to.elem.children("a").removeClass(n), i.move = {}, t("." + r).remove()) })) }, Tree.prototype.move = {}, Tree.prototype.drag = function (e, i) { var o = this, r = (o.options, e.children("a")), mouseenter = function () { var r = t(this), s = o.move; s.from && (s.to = { item: i, elem: e }, r.addClass(n)) }; r.on("mousedown", (function () { o.move.from = { item: i, elem: e } })), r.on("mouseenter", mouseenter).on("mousemove", mouseenter).on("mouseleave", (function () { var e = t(this), i = o.move; i.from && (delete i.to, e.removeClass(n)) })) }, e("tree", (function (e) { var n = new Tree(e = e || {}), o = t(e.elem); if (!o[0]) return i.error("layui.tree 没有找到" + e.elem + "元素"); n.init(o) })) })) }, function (e, t) { layui.config({}).extend({}).define(["laytpl", "laypage", "layer", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.laytpl, n = layui.laypage, o = layui.layer, r = layui.form, s = layui.hint(), c = layui.device(), d = 0, u = { config: { indexName: "lay_table_index", cols: { isCheckName: "lay_is_checked", isRadio: "lay_is_radio", isOpen: "lay_is_open", isShow: "lay_is_show", level: "lay_level", children: "children", cheDisabled: "lay_che_disabled", radDisabled: "lay_rad_disabled", iconOpen: "lay_icon_open", iconClose: "lay_icon_close", icon: "lay_icon" }, initWidth: { checkbox: 48, space: 15, numbers: 40, radio: 48 } }, cache: { tableId: { data: { list: [], map: {}, treeList: [], upIds: [] } }, cla: { claIds: { tableId: !0 }, claObjs: { tableId: {} } }, selectcode: { demokey: [{ key: { value: "" } }] } }, index: layui.table ? layui.table.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, h, e, t) }, getClass: function (e) { return u.cache.cla.claObjs[e] }, pushClass: function (e, t) { u.cache.cla.claObjs[e] = t }, isCalss: function (e) { return (this.cache.cla.claIds || {}).hasOwnProperty(e) || !1 }, isClassYes: function (e) { return (this.cache.cla.claIds || {})[e] || !1 }, pushClassIds: function (e, t) { this.cache.cla.claIds[e] = t }, setObj: function (e, t, i) { this.obj[e] || (this.obj[e] = {}), this.obj[e][t] = i }, getObj: function (e, t) { return this.obj[e] ? this.obj[e][t] : null }, getDataList: function (e) { return u.cache[e] ? u.cache[e].data.list : [] }, setDataList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.list || (u.cache[e].data.list = []), u.cache[e].data.list = t }, getDataMap: function (e) { return u.cache[e] ? u.cache[e].data.map : {} }, setDataMap: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.map || (u.cache[e].data.map = {}), u.cache[e].data.map = t }, getDataTreeList: function (e) { return u.cache[e] ? u.cache[e].data.treeList : [] }, setDataTreeList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.treeList || (u.cache[e].data.treeList = {}), u.cache[e].data.treeList = t }, getDataRootList: function (e) { return u.cache[e] && u.cache[e].data.upIds || [] }, setDataRootList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.upIds || (u.cache[e].data.upIds = []), u.cache[e].data.upIds = t }, init: function (e, i) { i = i || {}; var n = t(e ? 'table[lay-filter="' + e + '"]' : p + "[lay-data]"), o = "Table element property lay-data configuration item has a syntax error: "; return n.each((function () { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { s.error(o + r) } var c = [], d = t.extend({ elem: this, cols: [], data: [], skin: n.attr("lay-skin"), size: n.attr("lay-size"), even: "string" == typeof n.attr("lay-even") }, u.config, i, r); e && n.hide(), n.find("thead>tr").each((function (e) { d.cols[e] = [], t(this).children().each((function (i) { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { return s.error(o + r) } var u = t.extend({ title: n.text(), colspan: n.attr("colspan") || 0, rowspan: n.attr("rowspan") || 0 }, r); u.colspan < 2 && c.push(u), d.cols[e].push(u) })) })), n.find("tbody>tr").each((function (e) { var i = t(this), n = {}; i.children("td").each((function (e, i) { var o = t(this), r = o.data("field"); if (r) return n[r] = o.html() })), layui.each(c, (function (e, t) { var o = i.children("td").eq(e); n[t.field] = o.html() })), d.data[e] = n })), u.render(d) })), this }, render: function (e) { u.pushClassIds(e.id); var t = new Class(e); return thisTable.call(t) }, ready: function (e, t) { var i = !1, n = new Date; e && t && setTimeout((function isReady() { if (e) { var o = u.getClass(e); if (o && o.hasOwnProperty("layBody")) t(o), i = !0; else (new Date).getTime() - n.getTime() <= 1e4 && !i && setTimeout(isReady, 50) } }), 50) }, checkStatus: function (e) { var t = 0, i = 0, n = [], o = u.getDataList(e) || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[u.config.cols.isCheckName] && (t++, n.push(u.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, setCheckStatus: function (e, t, i) { var n = u.getClass(e), o = u.getDataList(e) || []; n.layBody.find('input[name="layTableCheckbox"]'); t && i && (i.split(",").forEach((function (e) { var i = null; if (o.forEach((function (n) { n[t] + "" != e + "" || (i = n) })), i) { var r = i[u.config.indexName]; n.layBody.find('input[name="layTableCheckbox"][value="' + r + '"]').prop("checked", !0), n.setCheckData(r, !0) } })), n.syncCheckAll(), n.renderForm("checkbox")); return null }, radioStatus: function (e) { var i = null, n = u.getDataList(e) || [], o = t("input[name='" + k + e + "']:checked").val(); return o = parseInt(o), n.forEach((function (e) { e[u.config.indexName] == o && (i = e) })), u.clearCacheKey(i) }, setRadioStatus: function (e, i, n) { var o = null, s = u.getDataList(e) || []; if (i && n && (s.forEach((function (e) { e[i] + "" != n + "" || (o = e) })), o)) { var c = o[u.config.indexName]; t("input:radio[name='" + k + e + "'][value='" + c + "']").prop("checked", !0), r.render("radio") } return o }, clearCacheKey: function (e) { return delete (e = t.extend({}, e))[u.config.cols.isCheckName], delete e[u.config.indexName], e }, query: function (e, i) { var n = u.getClass(e); n.renderTdCss(), n.config.data && n.config.data.constructor === Array && delete n.config.data, n.config = t.extend({}, n.config, i), n.pullData(n.page, n.loading()) }, reload: function (e, i) { var n = thisTable.config[e]; return i = i || {}, n ? (i.data && i.data.constructor === Array && delete n.data, u.render(t.extend(!0, {}, n, i))) : s.error("The ID option was not found in the table instance") }, addRow: function (e, i, n) { var o = u.getClass(e), r = o.config, s = (u.getDataMap(e), u.getDataTreeList(e)), c = u.getDataList(e) || [], fa = function (i, n, o, r, s, c) { if (i.resetData(s), r.splice(c, 0, s), u.restNumbers(r), u.setDataMap(e, i.resetDataMap(r)), n.isTree) { var d = i.treeFindUpData(s); if (d) { d.children; d.children.push(s), s[u.config.cols.level] = d[u.config.cols.level] + 1, i.treeNodeOpen(d, !0), i.renderTreeConvertShowName(d) } else s[u.config.cols.level] = 1, o.push(s) } var h = i.renderTr(s, s[u.config.indexName]), p = '" + h.join("") + ""; if (0 == c) { var y = i.layBody.find("table tbody"); t(y).prepend(p), i.layBody.find(".layui-none").remove() } else { var m = i.layBody.find("[data-index=" + (c - 1) + "]"), g = u.getDataList(i.key)[c - 1][n.treeId], b = n.treeUpId, addNewRow = function (e, t) { if (e.next("tr").length > 0) { var n = u.getDataList(i.key)[c + 1][b]; g == n ? addNewRow(e, t) : e.after(t) } else e.after(t) }; addNewRow(t(m), p) } i.renderForm(), n.isAsynchronous || i.renderPage(i.config.page.count + 1), i.restNumbers(), i.events() }; if (n instanceof Array) for (var d = 0; d < n.length; d++)0 != d && (i += 1), fa(o, r, s, c, n[d], i); else fa(o, r, s, c, n) }, delRow: function (e, t) { var i = u.getClass(e), n = i.config, o = u.getDataList(e), r = [], s = {}, c = [], d = []; if (i && t) { u.kit.isArray(t) ? c = t : c[0] = t, c.forEach((function (e) { var t = i.treeFindUpData(e); t && d.push(t) })), (r = n.isTree ? u.treeFindSonList(i.config.id, c) : c).forEach((function (e) { var t = e[u.config.indexName]; s[t] = t, i.layBody.find('tr[data-index="' + t + '"]').remove() })), i.restNumbers(); for (var h = [], p = 0, y = o.length; p < y; p++) { var m = !0; r.forEach((function (e) { e[u.config.indexName] === o[p][u.config.indexName] && (m = !1) })), m && h.push(o[p]) } u.restNumbers(h), d.forEach((function (e) { i.renderTreeConvertShowName(e) })), n.isPage && i.renderPage(i.config.page.count - Object.keys(s).length), u.setDataList(e, h), u.setDataMap(e, i.resetDataMap(h)), u.setDataTreeList(e, i.resetDataTreeList(h, u.getDataRootList(e))), i.events() } }, restNumbers: function (e) { if (e) { var t = 0; e.forEach((function (e) { e[u.config.indexName] = t, t++ })) } }, treeNodeOpen: function (e, t, i) { var n = u.getClass(i); n && e && n.treeNodeOpen(e, t) }, treeOpenAll: function (e, t) { var i = u.getClass(e); if (i) { i.config.isOpenDefault ? i.config.isOpenDefault = !1 : i.config.isOpenDefault = !0, void 0 === t && (t = !0); var n = u.getDataList(e); if (n) if (i.config.isAsynchronous && 1 == d && i.config.isOpenDefault) { var o = options.parentid; i.nodeKeyData = {}, i.nodeKeyData[o] = "1", i.pullData(i.page, i.loading()) } else n.forEach((function (i) { u.treeNodeOpen(i, t, e) })) } }, treeFindSonList: function (e, t) { var i = u.getClass(e); if (!i || !t) return []; var n = [], o = [], r = {}; return u.kit.isArray(t) ? n = t : n[0] = t, n.forEach((function (e) { e.children.length > 0 && i.treeFindSonData(e).forEach((function (e) { r[e[u.config.indexName]] || (o.push(e), r[e[u.config.indexName]] = e[u.config.indexName]) })); o.push(e), r[e[u.config.indexName]] = e[u.config.indexName] })), o }, treeFindUpDatas: function (e, t) { var i = u.getClass(e); return i && t ? i.treeFindUpDatas(t) : [] }, treeFindSonIds: function (e, t) { var i = []; return u.treeFindSonList(e, t).forEach((function (e) { i.push([u.config.indexName]) })), i }, treeFindSonIdFields: function (e, t) { var i = [], n = u.getClass(e); return u.treeFindSonList(e, t).forEach((function (e) { i.push(e[n.config.idField]) })), i }, treeIconRender: function (e, t) { var i = u.getClass(e); return i && t ? i.treeIconRender(t, !1) : [] }, kit: { isArray: function (e) { return "[object Array]" === Object.prototype.toString.call(e) } } }, thisTable = function () { var e = this, t = e.config, i = t.id; return i && (thisTable.config[i] = t), { reload: function (t) { e.reload.call(e, t) }, config: t } }, h = "treeGrid", p = ".layui-table", y = "layui-none", m = "layui-table-view", g = ".layui-table-sort", b = "layui-table-edit", k = "table_radio_", TPL_HEADER = function (e) { return ['', "", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "", "{{# layui.each(item1, function(i2, item2){ }}", '{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}', '{{# if(item2.fixed === "right"){ right = true; } }}', (e = e || {}).fixed && "right" !== e.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === e.fixed ? '{{# if(item2.fixed === "right"){ }}' : "", '", e.fixed ? "{{# }; }}" : "", "{{# }); }}", "", "{{# }); }}", "", "
            ', '
            1){ }}", "group", "{{# } else { }}", "{{d.index}}-{{item2.field || i2}}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", "{{# } }}", '" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '', "{{# } else { }}", '{{item2.title||""}}', "{{# if(!(item2.colspan > 1) && item2.sort){ }}", '', "{{# } }}", "{{# } }}", "
            ", "
            "].join("") }, w = ['', "", "
            "].join(""), C = ['
            ', "{{# if(d.data.toolbar){ }}", '
            ', "{{# } }}", '
            ', "{{# var left, right; }}", '
            ', TPL_HEADER(), "
            ", '
            ', void 0, "
            ", '
            ', w, "
            ", "{{# if(left){ }}", '
            ', '
            ', TPL_HEADER({ fixed: !0 }), "
            ", '
            ', w, "
            ", "
            ", "{{# }; }}", "{{# if(right){ }}", '
            ', '
            ', TPL_HEADER({ fixed: "right" }), '
            ', "
            ", '
            ', w, "
            ", "
            ", "{{# }; }}", "
            ", "{{# if(d.data.isPage){ }}", '
            ', '
            ', "
            ", "{{# } }}", "
            "].join(""), D = t(window), E = t(document), Class = function (e) { this.index = ++u.index, this.config = t.extend({}, this.config, u.config, e), this.render(), u.pushClass(e.id, this) }; Class.prototype.config = { limit: 10, loading: !0, cellMinWidth: 60, text: { none: "无数据" }, isFilter: !1, method: "post", radDisabledNum: 0, cheDisabledNum: 0, branch: ["", ""], leaf: "", iconOpen: !0, isOpenDefault: !0, parseData: null, onClickRow: null, onDblClickRow: null, onBeforeCheck: null, isTree: !0, isPage: !1, chkboxType: { Y: "ps", N: "ps" }, isAsynchronous: !1, sysParentid: "" }, Class.prototype.render = function () { var e = this.config; if (e.elem = t(e.elem), e.where = e.where || {}, e.id = e.id || e.elem.attr("id"), e.request = t.extend({ pageName: "page", limitName: "limit" }, e.request), e.response = t.extend({ statusName: "code", statusCode: 0, msgName: "msg", dataName: "data", countName: "count" }, e.response), "object" == typeof e.page && (e.limit = e.page.limit || e.limit, e.limits = e.page.limits || e.limits, this.page = e.page.curr = e.page.curr || 1, delete e.page.elem, delete e.page.jump), !e.elem[0]) return this; this.setArea(); var n = e.elem, o = n.next("." + m), r = this.elem = t(i(C).render({ VIEW_CLASS: m, data: e, index: this.index })); if (e.index = this.index, o[0] && o.remove(), n.after(r), this.renderTdCss(), this.layHeader = r.find(".layui-table-header"), this.layMain = r.find(".layui-table-main"), this.layBody = r.find(".layui-table-body"), this.layFixed = r.find(".layui-table-fixed"), this.layFixLeft = r.find(".layui-table-fixed-l"), this.layFixRight = r.find(".layui-table-fixed-r"), this.layTool = r.find(".layui-table-tool"), this.layPage = r.find(".layui-table-page"), this.layFilter = r.find(".layui-table-filter"), this.layTool.html(i(t(e.toolbar).html() || "").render(e)), e.height && this.fullSize(), e.cols.length > 1) { var s = this.layFixed.find(".layui-table-header").find("th"); s.height(this.layHeader.height() - 1 - parseFloat(s.css("padding-top")) - parseFloat(s.css("padding-bottom"))) } e.isFilter && this.layFilter.html(this.renderFilter()), this.pullData(this.page), this.renderCss() }, Class.prototype.initOpts = function (e) { var t = this.config; e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || u.config.initWidth[e.type]), t.isFilter && 0 != e.isFilter && (e.isFilter = !0) }, Class.prototype.getParentDivHeight = function (e) { return t("#" + e).parent().height() }, Class.prototype.getCols = function (e) { var t = this.config.cols[0], i = !1; for (var n in /^[0-9]+.?[0-9]*$/.test(e) && (i = !0), t) if (i) { if (n == parseInt(e)) return t[n] } else if (e == t[n].field) return t[n]; return {} }, Class.prototype.reload = function (e) { return this.config.data && this.config.data.constructor === Array && delete this.config.data, u.render(t.extend(!0, {}, this.config, e)) }, Class.prototype.page = 1, Class.prototype.restNumbers = function () { this.config; var e = this.layBody.find("table tbody tr"), i = 0; e.each((function (e) { t(this).attr("data-index", i), t(this).find(".laytable-cell-numbers p").text(i + 1), t(this).data("index", i), i++ })) }, Class.prototype.resetData = function (e) { var t = this.config; t.isTree && (e.hasOwnProperty(u.config.cols.isOpen) || (e[u.config.cols.isOpen] = t.isOpenDefault), e.hasOwnProperty(u.config.cols.isShow) || (e[u.config.cols.isShow] = !!t.isOpenDefault)), e.hasOwnProperty(u.config.cols.cheDisabled) || (e[u.config.cols.cheDisabled] = !1), e[u.config.cols.cheDisabled] && t.cheDisabledNum++, e[u.config.cols.radDisabled] && t.radDisabledNum++, e.children = [] }, Class.prototype.resetDataMap = function (e) { var t = this.config.treeId, i = {}; return e.forEach((function (e) { i[e[t]] = e })), i }, Class.prototype.resetDataresetRoot = !0, Class.prototype.resetDataRoot = function (e) { var t = this.config, i = (t.treeId, t.treeUpId), n = u.getDataMap(this.config.id), o = u.cache[t.id].data.upIds || [], r = {}; u.cache[t.id].data.upIds = [], o = u.cache[t.id].data.upIds; for (var s = 0; s < e.length; s++) { var c = e[s]; if (!n[c[i]]) { if (!r[c[i]]) { var d = !0; o.forEach((function (e) { e === c[i] && (d = !1) })), d && o.push(c[i]) } r[c[i]] = c[i] } } return o }, Class.prototype.resetDataTreeList = function (e, t) { var i = this.config, n = i.treeId, o = i.treeUpId, r = [], fa = function (t) { for (var i = [], r = 0; r < e.length; r++) { var s = e[r]; s[o] === t && (s.children = fa(s[n]), i.push(s)) } return i }; return t.forEach((function (e) { var t = fa(e); t && t.forEach((function (e) { r.push(e) })) })), r }, Class.prototype.resetDataTableList = function (e) { var t = this, i = t.config, n = (i.treeId, i.treeUpId, []), fa2 = function (e, t) { for (var i = 0; i < e.length; i++) { var o = e[i]; o[u.config.cols.level] = t, n.push(o), o.children && o.children.length > 0 && fa2(o.children, 1 + t) } }; return fa2(e, 1), n.forEach((function (e) { var i = t.treeFindUpData(e); !i || i[u.config.cols.isOpen] && i[u.config.cols.isShow] ? e[u.config.cols.isShow] = !0 : e[u.config.cols.isShow] = !1 })), n }, Class.prototype.resetDatas = function (e) { var t = this.config, i = (t.treeId, t.treeUpId, []), n = [], o = e, r = this.resetDataMap(e); if (i.push(o), i.push(n), i.push(r), u.setDataList(this.config.id, o), u.setDataTreeList(this.config.id, n), u.setDataMap(this.config.id, r), null == e || e.length <= 0) return i; for (var s = 0; s < e.length; s++)this.resetData(e[s]); if (t.isTree) { o = [], u.setDataList(this.config.id, o); var c = u.cache[t.id].data.upIds || []; (c.length <= 0 || this.resetDataresetRoot) && (u.cache[t.id].data.upIds = [], c = this.resetDataRoot(e), this.resetDataresetRoot = !1), n = this.resetDataTreeList(e, c), u.setDataTreeList(this.config.id, n), o = this.resetDataTableList(n), u.setDataList(this.config.id, o) } return i }, Class.prototype.treeFindDataById = function (e) { var t = this.config, i = null, n = u.getDataList(this.key), o = t.treeId; return n.forEach((function (t) { t[o] != e || (i = t) })), i }, Class.prototype.treeFindUpData = function (e) { var t = this.config.treeUpId; return u.getDataMap(this.config.id)[e[t]] }, Class.prototype.treeFindUpDatas = function (e) { var t = this, i = (t.config, []), temf = function (e) { var n = t.treeFindUpData(e); n && (i.push(n), temf(n)) }; return temf(e), i }, Class.prototype.treeFindSonData = function (e) { var t = []; return function f(e) { e.children.length > 0 && e.children.forEach((function (e) { t.push(e), e.children.length > 0 && f(e) })) }(e), t }, Class.prototype.treeConvertShowName = function (e) { var t, i, n = this, o = (n.config, e.children && e.children.length > 0 || e.CHILDCOUNT && e.CHILDCOUNT > 0); return '
            ' + function () { for (var t = "", i = 1; i < e[u.config.cols.level]; i++)t += "    "; return t += "" }() + (t = "", i = e[u.config.cols.isOpen] ? "" : "", o ? t = '' + i + "" + n.treeIconRender(e, !0) : t += n.treeIconRender(e, !0), t + "
            ") }, Class.prototype.treeNodeOpen = function (e, t) { var i = this, n = (i.config, i.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]')); e[u.config.cols.isOpen] = t; var fa = function (t) { if (t.children && t.children.length > 0) for (var n = t.children, o = 0; o < n.length; o++) { var r = n[o]; if (e[u.config.cols.isOpen]) { if (t[u.config.cols.isOpen] && t[u.config.cols.isShow]) i.layBody.find('tr[data-index="' + r[u.config.indexName] + '"]').show(), r[u.config.cols.isShow] = !0 } else i.layBody.find('tr[data-index="' + r[u.config.indexName] + '"]').hide(), r[u.config.cols.isShow] = !1; fa(r) } }; fa(e), i.treeIconRender(e, !1); var o = n.find(".layui-tree-head"); e[u.config.cols.isOpen] ? o.html("") : o.html("") }, Class.prototype.treeIconRender = function (e, i) { var n = this.config, o = n.iconOpen, r = e.children && e.children.length > 0 || e.CHILDCOUNT && e.CHILDCOUNT > 0, s = ""; if (!o) return s; var temf = function () { var t = '' }; if (r ? s = e[u.config.cols.iconOpen] || e[u.config.cols.iconClose] ? temf() : '" + (e[u.config.cols.isOpen] ? this.config.branch[1] : this.config.branch[0]) + "" : e[u.config.cols.icon] ? s = temf() : s += '" + this.config.leaf + "", i) return s; var c = this.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]').find("td[data-field=" + n.treeShowName + "]").find(".layui-table-cell"); t(c).find("div .layui-tree-" + e[n.idField]).remove(), t(c).find("div").append(s) }, Class.prototype.pullData = function (e, i, n) { var r = this, s = r.config, c = s.request, h = s.response; if (r.startTime = (new Date).getTime(), s.url) { var p = {}; s.page && (p[c.pageName] = String(e), p[c.limitName] = String(s.limit)), r.filterRulesSet(p), p = r.sortSet(p), s.isAsynchronous && (p = r.getParams(p)); var m = t.extend(p, s.where); s.contentType && 0 == s.contentType.indexOf("application/json") && (m = JSON.stringify(m)), t.ajax({ type: s.method || "get", url: s.url, contentType: s.contentType, traditional: s.traditional, data: m, dataType: "json", success: function (t) { if (t[h.dataName] || (t[h.dataName] = [], t[h.statusName] = 0, t[h.countName] = 0, t[h.msgName] = "返回的数据状态异常"), r.resetDataresetRoot = !0, "function" == typeof s.parseData && (t = s.parseData(t) || t), (s.isAsynchronous && 1 != d || null == n) && (r.resetDatas(t[h.dataName]), t[h.dataName] = u.getDataList(s.id)), t[h.statusName] != h.statusCode) r.renderForm(), r.layMain.html('
            ' + (t[h.msgName] || "返回的数据状态异常") + "
            "); else if (s.isAsynchronous && 1 == d) if (null != n) { var c = u.getDataList(r.key)[n]; r.treeNodeOpen(c, !c[u.config.cols.isOpen]), u.addRow(r.key, n + 1, t.obj), r.resize(), r.nodeKeyData = {} } else r.renderData(t, e, t[h.countName]), s.time = (new Date).getTime() - r.startTime + " ms"; else d = 1, r.renderData(t, e, t[h.countName]), s.time = (new Date).getTime() - r.startTime + " ms"; i && o.close(i), r.events(), "function" == typeof s.done && s.done(t, e, t[h.countName]) }, error: function (e, t) { r.layMain.html('
            数据接口请求异常
            '), r.renderForm(), i && o.close(i) } }) } else if (s.data && s.data.constructor === Array) { var g = {}, b = e * s.limit - s.limit; g[h.dataName] = s.data.concat().splice(b, s.limit), g[h.countName] = s.data.length, "function" == typeof s.parseData && (g = s.parseData(g) || g), r.resetDatas(g[h.dataName]), g[h.dataName] = u.getDataList(s.id), r.renderData(g, e, s.data.length), "object" == typeof s.initSort && r.sort(s.initSort.field, s.initSort.type), r.events(), "function" == typeof s.done && s.done(g, e, g[h.countName]) } }, Class.prototype.filterRulesSet = function (e) { e.filterRules = JSON.stringify(this.filterRules()) }, Class.prototype.filterRules = function () { var e = [], i = this.layFilter.find("[name^='filter_']"); return layui.each(i, (function (i, n) { if (t(n).val()) { var o = { field: n.name, op: "like", value: t(n).val(), datatype: "string" }; e.push(o) } })), e }, Class.prototype.eachCols = function (e) { var i = t.extend(!0, [], this.config.cols), n = [], o = 0; layui.each(i, (function (e, t) { layui.each(t, (function (t, r) { if (r.colspan > 1) { var s = 0; o++, r.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL || s == r.colspan || (t.PARENT_COL = o, r.CHILD_COLS.push(t), s += t.colspan > 1 ? t.colspan : 1) })) } r.PARENT_COL || n.push(r) })) })); var eachArrs = function (t) { layui.each(t || n, (function (t, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); e(t, i) })) }; eachArrs() }, Class.prototype.renderTreeConvertShowName = function (e) { var i = this.config, n = (i.elem.next("." + m), this.treeConvertShowName(e)), o = this.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]').find("td[data-field=" + i.treeShowName + "]").find(".layui-table-cell"); t(o).find("div").remove(), t(o).prepend(n) }, Class.prototype.renderTdCss = function () { var e = this, t = e.config.elem.next("." + m), i = e.index + "_" + h + "_td_style"; t.find("#" + i).remove(); var n, o = '"); 0 == t.find("#" + e.index + "_" + h + "_style").length ? t.append(o) : t.find("#" + e.index + "_" + h + "_style").before(o) }, Class.prototype.renderCss = function () { var e = this.config.elem.next("." + m), t = this.index + "_" + h + "_style"; e.find("#" + t).remove(); var i = ''; 0 == e.find("#" + this.index + "_" + h + "_td_style").length ? e.append(i) : e.find("#" + this.index + "_" + h + "_td_style").after(i) }, Class.prototype.renderTrUpids = function (e) { var t = this.config, i = t.treeUpId, n = (e.upIds, ' u_id="' + e[i] + '" '); return t.isTree ? n : "" }, Class.prototype.renderTd = function (e) { var n, o, r = this.config, s = e.cols, c = e.obj, d = e.numbers, h = e.i3, p = null == c[s.field] ? "" : String(c[s.field]), y = s.field || h, m = p, g = (this.getColElem(this.layHeader, y), ""); return r.isTree && r.treeShowName == s.field && (g = this.treeConvertShowName(c)), ['"), '
            ') + g + '

            ' + function () { var e, n, o = t.extend(!0, { LAY_INDEX: d }, c); if ("checkbox" === s.type) return o[u.config.cols.cheDisabled] ? "" : '"); if ("numbers" === s.type) return d; if ("drop" === s.type) { var h = dl.ui.table.drop.findFieldObj(r.cols[0], y); if (h && h.drop) { dl.cache.code.get(h.drop); return dl.ui.table.drop.findDropLable(h.drop, m) } } else if ("radio" === s.type) return o[u.config.cols.radDisabled] ? "" : ''; return s.toolbar ? i(t(s.toolbar).html() || "").render(o) : s.templet ? "function" == typeof s.templet ? s.templet(o) : i(t(s.templet).html() || String(m)).render(o) : m }(), "

            "].join("") }, Class.prototype.renderTr = function (e, t) { var i = this, n = (i.config, []); return i.eachCols((function (o, r) { var s = r.field || o, c = e[s]; i.getColElem(i.layHeader, s); if (null == c && (c = ""), !(r.colspan > 1)) { var d = i.renderTd({ obj: e, numbers: t, cols: r, i3: o }); n.push(d) } })), n }, Class.prototype.renderData = function (e, t, i, n) { var r = this, s = r.config, c = e[s.response.dataName] || [], d = [], h = [], p = [], render = function () { if (!n && r.sortKey) return r.sort(r.sortKey.field, r.sortKey.sort, !0); layui.each(c, (function (e, i) { r.treeFindUpData(i); var o = ""; !i[u.config.cols.isShow] && s.isTree && (o = "display: none;"); var c = [], y = e + s.limit * (t - 1) + 1; 0 !== i.length && (n || (i[u.config.indexName] = e), c = r.renderTr(i, y), d.push('" + c.join("") + ""), h.push('' + [].join("") + ""), p.push('' + [].join("") + "")) })), r.layBody.scrollTop(0), r.layMain.find("." + y).remove(), r.layMain.find("tbody").html(d.join("")), r.layFixLeft.find("tbody").html(h.join("")), r.layFixRight.find("tbody").html(p.join("")), r.renderForm(), r.syncCheckAll(), r.haveInit ? r.scrollPatch() : setTimeout((function () { r.scrollPatch() }), 50), r.haveInit = !0, o.close(r.tipsIndex) }; if (r.key = s.id || s.index, u.setDataList(r.key, c), r.layPage[0 === c.length && 1 == t ? "addClass" : "removeClass"]("layui-hide"), n) return render(); if (0 === c.length) { r.renderForm(), r.layFixed.remove(), r.layMain.find("tbody").html(""), r.layMain.find("." + y).remove(); var m = 0, g = 0, b = 0, k = 0; return r.layMain.height() > 150 ? (m = "40px", g = "80px", b = "22px", k = "10px") : (m = "10px", g = "40px", b = "14px", k = "5px"), r.layMain.append('
            ' + s.text.none + "
            ") } render(), r.renderPage(i), u.pushClassIds(s.id, !0) }, Class.prototype.renderPage = function (e) { var i = this, o = i.config; o.isPage && (o.page = t.extend({ elem: "layui-table-page" + o.index, count: e, limit: o.limit, limits: o.limits || [10, 15, 20, 30, 40, 50, 60, 70, 80, 90], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '', next: '', jump: function (e, t) { t || (i.page = e.curr, o.limit = e.limit, i.pullData(e.curr, i.loading())) } }, o.page), o.page.count = e, n.render(o.page)) }, Class.prototype.renderFilter = function () { var e = this.config, t = this.index, i = []; return i.push('
            '), i.push(''), layui.each(e.cols, (function (e, n) { layui.each(n, (function (e, n) { var o, r = n.field || e, s = n.minWidth ? "data-minwidth='" + n.minWidth + "'" : "", c = n.colspan ? 'colspan="' + n.colspan + '"' : "", d = n.rowspan ? 'rowspan="' + n.rowspan + '"' : "", u = n.unresize ? 'data-unresize="true"' : ""; i.push('") })) })), i.push("
            "), i.push('
            1 ? o = "group" : (o = t + "-" + r, "normal" !== n.type && (o += " laytable-cell-" + n.type)), o + '">')), n.isFilter && n.field ? i.push('') : i.push(""), i.push("
            "), i.push("
            "), i.join("") }, Class.prototype.getColElem = function (e, t) { var i = this.config; return e.eq(0).find(".laytable-cell-" + i.index + "-" + t + ":eq(0)") }, Class.prototype.renderForm = function (e) { r.render(e, "LAY-table-" + this.index) }, Class.prototype.getParams = function (e) { return e = t.extend({}, e, this.nodeKeyData) }, Class.prototype.sortSet = function (e) { return e = t.extend({}, e, this.sortKeyData) }, Class.prototype.sort = function (e, i, n, o) { var r = this.config; r.elem.attr("lay-filter"), u.getDataList(this.key); "string" == typeof e && this.layHeader.find("th").each((function (i, n) { var o = t(this), r = o.data("field"); if (r === e) return e = o, c = r, !1 })); try { var c = c || e.data("field"); if (this.sortKey && !n && c === this.sortKey.field && i === this.sortKey.sort) return; var d = this.layHeader.find("th .laytable-cell-" + r.index + "-" + c).find(g); this.layHeader.find("th").find(g).removeAttr("lay-sort"), d.attr("lay-sort", i || null), this.layFixed.find("th") } catch (e) { return s.error("Table modules: Did not match to field") } this.sortKeyData = { FIELD: c, ORDER: i } }, Class.prototype.loading = function () { var e = this.config; if (e.loading && e.url) return o.msg("数据查询中,请稍候...", { icon: 16, offset: [this.elem.offset().top + this.elem.height() / 2 - 35 - D.scrollTop() + "px", this.elem.offset().left + this.elem.width() / 2 - 90 - D.scrollLeft() + "px"], time: -1, anim: -1, fixed: !1 }) }, Class.prototype.setCheckData = function (e, t) { this.config; var i = u.getDataList(this.key); i[e] && i[e].constructor !== Array && (i[e][u.config.cols.isCheckName] = t) }, Class.prototype.syncCheckAll = function () { var e = this, t = e.config, i = u.getDataList(e.config.id); if (i) { var n = !0, o = 0; if (i.forEach((function (t) { t[u.config.cols.cheDisabled] || (t[u.config.cols.isCheckName] ? (e.layBody.find("tr[data-index=" + t[u.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !0), o++) : (n = !1, e.layBody.find("tr[data-index=" + t[u.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !1))) })), n) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !0); if (o < i.length - t.cheDisabledNum) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !1); e.renderForm("checkbox") } }, Class.prototype.getCssRule = function (e, t) { var i = this, n = i.elem.find("style")[0], o = n.sheet || n.styleSheet || {}, r = o.cssRules || o.rules; layui.each(r, (function (n, o) { if (o.selectorText === ".laytable-cell-" + i.index + "-" + e) return t(o), !0 })) }, Class.prototype.resize = function () { this.fullSize(), this.setArea(), this.resizeWidth() }, Class.prototype.setArea = function () { var e, t = this, i = t.config, n = 0, o = 0, r = 0, s = 0, c = i.width || (e = function (t) { var n, o; n = (t = t || i.elem.parent()).width(); try { o = "none" === t.css("display") } catch (e) { } return !t[0] || n && !o ? n : e(t.parent()) })() - 17; t.eachCols((function () { n++ })), c -= "line" === i.skin || "nob" === i.skin ? 2 : n + 1, layui.each(i.cols, (function (e, i) { layui.each(i, (function (e, n) { var r; n ? (t.initOpts(n), r = n.width || 0, n.colspan > 1 || (/\d+%$/.test(r) ? n.width = r = Math.floor(parseFloat(r) / 100 * c) : !n._is_width_dev && r || (n._is_width_dev = !0, n.width = r = 0, o++), s += r)) : i.splice(e, 1) })) })), t.autoColNums = o, c > s && o && (r = (c - s) / o), layui.each(i.cols, (function (e, t) { layui.each(t, (function (e, t) { var n = t.minWidth || i.cellMinWidth; t.colspan > 1 || 0 === t.width && (t.width = Math.floor(r >= n ? r : n)) })) })); var d = t.getParentDivHeight(i.id); i.height && /^full-\d+$/.test(i.height) && (t.fullHeightGap = i.height.split("-")[1]), null != t.fullHeightGap && (i.height = d - t.fullHeightGap) }, Class.prototype.resizeWidth = function () { this.renderTdCss() }, Class.prototype.fullSize = function () { var e, t = this.config, i = this.getParentDivHeight(t.id); null != this.fullHeightGap && (i = this.getParentDivHeight(t.id) - this.fullHeightGap), i < 135 && (i = 135), this.elem.css("height", i); var n = t.isFilter ? 76 : 38; e = parseFloat(i) - n - 1, t.toolbar && (e -= this.layTool.outerHeight()), t.isPage && (e = e - this.layPage.outerHeight() - 1), this.layMain.css("height", e) }, Class.prototype.getScrollWidth = function (e) { var t = 0; return e ? t = e.offsetWidth - e.clientWidth : ((e = document.createElement("div")).style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t }, Class.prototype.scrollPatch = function () { var e = this, i = e.layMain.children("table"), n = e.layMain.width() - e.layMain.prop("clientWidth"), o = e.layMain.height() - e.layMain.prop("clientHeight"), r = e.getScrollWidth(e.layMain[0]), s = i.outerWidth() - e.layMain.width(); if (e.autoColNums && s < 5 && !e.scrollPatchWStatus) { var c = e.layHeader.eq(0).find("thead th:last-child"), d = c.data("field"); e.getCssRule(d, (function (t) { var i = t.style.width || c.outerWidth(); t.style.width = parseFloat(i) - r - s + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px"), e.scrollPatchWStatus = !0 })) } if (n && o) { if (e.elem.find(".layui-table-patch").length <= 0) { var u = t('
            '); u.find("div").css({ width: n }), e.layHeader.eq(0).find("thead tr").append(u) } } else e.layFilter.eq(0).find(".layui-table-patch").remove(), e.layHeader.eq(0).find(".layui-table-patch").remove(); var h = e.layMain.height() - o; e.layFixed.find(".layui-table-body").css("height", i.height() > h ? h : "auto"), e.layFixRight[s > 0 ? "removeClass" : "addClass"]("layui-hide"), e.layFixRight.css("right", n - 1) }, Class.prototype.events = function () { var e, i = this, n = i.config, r = t("body"), s = {}, c = i.layHeader.find("th"), d = i.layBody.find("tr"); d.unbind("click").on("click", (function (e) { var o = t(this).attr("data-index"), r = u.getDataList(i.config.id)[o]; "function" == typeof n.onClickRow && n.onClickRow(o, r) })), d.unbind("dblclick").on("dblclick", (function (e) { var o = t(this).attr("data-index"), r = u.getDataList(i.config.id)[o]; "function" == typeof n.onDblClickRow && n.onDblClickRow(o, r) })), c.unbind("mousemove").on("mousemove", (function (e) { var i = t(this), n = i.offset().left, o = e.clientX - n; i.attr("colspan") > 1 || i.data("unresize") || s.resizeStart || (s.allowResize = i.width() - o <= 10, r.css("cursor", s.allowResize ? "col-resize" : "")) })), c.unbind("mouseleave").on("mouseleave", (function () { t(this); s.resizeStart || r.css("cursor", "") })), c.unbind("mousedown").on("mousedown", (function (e) { var o = t(this); if (s.allowResize) { var r = o.data("field"); e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], i.getCssRule(r, (function (e) { var t = e.style.width || o.outerWidth(); s.rule = e, s.ruleWidth = parseFloat(t), s.minWidth = o.data("minwidth") || n.cellMinWidth })) } })), c.unbind("mouseup").on("mouseup", (function (e) { var n = t(this), o = n.data("field"); e.preventDefault(), i.getCssRule(o, (function (e) { var t = e.style.width || n.outerWidth(); layui.each(i.config.cols, (function (e, i) { layui.each(i, (function (e, i) { i.field && i.field == o && (i.width = parseFloat(t)) })) })) })) })), E.unbind("mousemove").on("mousemove", (function (t) { if (s.resizeStart) { if (t.preventDefault(), s.rule) { var n = s.ruleWidth + t.clientX - s.offset[0]; n < s.minWidth && (n = s.minWidth), s.rule.style.width = n + "px", o.close(i.tipsIndex) } e = 1 } })), E.unbind("mouseup").on("mouseup", (function (t) { s.resizeStart && (s = {}, r.css("cursor", ""), i.scrollPatch()), 2 === e && (e = null) })), c.unbind("click").on("click", (function () { var n, o = t(this), r = o.find(g), s = r.attr("lay-sort"); if (!r[0] || 1 === e) return e = 2; n = "asc" === s ? "desc" : "desc" === s ? null : "asc", i.sort(o, n, null, !0), u.query(i.key) })), c.find(g + " .layui-edge ").unbind("click").on("click", (function (e) { var n = t(this), o = n.index(), r = n.parents("th").eq(0).data("field"); layui.stope(e), 0 === o ? i.sort(r, "asc", null, !0) : i.sort(r, "desc", null, !0), u.query(i.key) })), i.eventsinitIsRun || (i.eventsinit(), i.eventsinitIsRun = !0), i.layMain.unbind("scroll").on("scroll", (function () { var e = t(this), n = e.scrollLeft(), r = e.scrollTop(); i.layHeader.scrollLeft(n), i.layFilter.scrollLeft(n), i.layFixed.find(".layui-table-body").scrollTop(r), o.close(i.tipsIndex) })), D.unbind("resize").on("resize", (function () { i.resize() })) }, Class.prototype.eventsinitIsRun = !1, Class.prototype.eventsinit = function () { var e = this, n = e.config, r = ".layui-table-cell", s = n.elem.attr("lay-filter"); e.layFilter.on("keyup", "[name^='filter_']", (function () { e.page = 1, e.pullData(e.page, e.loading()) })), e.layBody.on("mouseenter", "tr", (function () { var i = t(this).index(); e.layBody.find("tr:eq(" + i + ")").addClass("layui-table-hover") })), e.layBody.on("mouseleave", "tr", (function () { var i = t(this).index(); e.layBody.find("tr:eq(" + i + ")").removeClass("layui-table-hover") })), e.layBody.on("click", "td div.layui-table-cell p", (function () { var i = t(this).parent().parent(), n = i.data("field"), s = i.data("edit"), d = i.parents("tr").eq(0).data("index"), h = u.getDataList(e.key)[d], p = i.children(r), y = e.config; if (o.close(e.tipsIndex), !i.data("off")) if (s) if ("select" === s) { i.data("drop"); var m = dl.ui.table.drop.findFieldObj(y.cols[0], n), g = "", k = dl.cache.code.get(m.drop).syscodevaluecache; for (var w in k) { var C = ""; k[w].scv_value == h[n] && (C = "selected='selected'"), g += "" } var D = t('"); i.find("." + b)[0] || i.append(D) } else { var E = t(''); E[0].value = t.trim(t(this).text()), i.find("." + b)[0] || i.append(E), E.focus() } else { var S = e.getCols(n); if (!u.config.initWidth[S.type]) { if (p.find(".layui-form-switch,.layui-form-checkbox")[0]) return; Math.round(p.prop("scrollWidth")) > Math.round(p.outerWidth()) && (e.tipsIndex = o.tips(['
            ', p.html(), "
            ", ''].join(""), p[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: c.ios || c.android ? 300 : 600, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", (function () { o.close(t) })) } })) } } })), e.layBody.on("change", "." + b, (function () { var i = t(this), n = this.value, o = i.parent().data("field"), r = i.parents("tr").eq(0).data("index"), c = u.getDataList(e.key)[r]; c[o] = n, layui.event.call(this, h, "edit(" + s + ")", { value: n, data: c, field: o }) })), e.layBody.on("blur", "." + b, (function () { var n, o = t(this), s = o.parent().data("field"), c = o.parents("tr").eq(0).data("index"), d = o.parent().data("edit"), h = u.getDataList(e.key)[c], p = e.config; e.eachCols((function (e, t) { t.field == s && t.templet && (n = t.templet) })); var y = ""; if ("select" === d) { var m = dl.ui.table.drop.findFieldObj(p.cols[0], s); if (m && m.drop) { dl.cache.code.get(m.drop); y = dl.ui.table.drop.findDropLable(m.drop, this.value) } o.parent().find(r + " p").html(n ? i(t(n).html() || y).render(h) : y) } else o.parent().find(r + " p").html(n ? i(t(n).html() || this.value).render(h) : this.value); o.parent().data("content", this.value), o.remove() })), e.elem.on("click", "i.layui-tree-head", (function () { var i = t(this).parents("tr").eq(0).data("index"), n = e.config, o = u.getDataList(e.key)[i], r = o[n.treeId]; if (!n.isAsynchronous || o.children && 0 != o.children.length) e.treeNodeOpen(o, !o[u.config.cols.isOpen]), e.resize(); else { var s = n.parentid; e.nodeKeyData = {}, e.nodeKeyData[s] = r, e.pullData(e.page, e.loading(), i) } })), e.elem.on("click", 'input[name="layTableCheckbox"]+', (function () { var i = t(this).prev(), o = (e.layBody.find('input[name="layTableCheckbox"]'), i.parents("tr").eq(0).data("index")), r = i[0].checked, c = u.getDataList(e.config.id)[o], d = "layTableAllChoose" === i.attr("lay-filter"); if (d) u.getDataList(e.key).forEach((function (t) { t[u.config.cols.cheDisabled] || e.setCheckData(t[u.config.indexName], r) })); else if (e.setCheckData(o, r), n.isTree) { e.treeFindSonData(c).forEach((function (t) { if (!t[u.config.cols.cheDisabled]) { if (r && ("" == n.chkboxType.Y || "p" == n.chkboxType.Y)) return !1; if (!(r || "" != n.chkboxType.N && "p" != n.chkboxType.N)) return !1; e.setCheckData(t[u.config.indexName], r) } })); var temf = function (t) { if (null != t && t && t.children.length > 0) { var i = !0; if (t.children.forEach((function (e) { e[u.config.cols.isCheckName] || (i = !1) })), i) { if (r && ("" == n.chkboxType.Y || "s" == n.chkboxType.Y)) return !1; if (!(r || "" != n.chkboxType.N && "s" != n.chkboxType.N)) return !1; e.setCheckData(t[u.config.indexName], r) } var o = e.treeFindUpData(t); o && temf(o) } }, p = e.treeFindUpData(c); temf(p) } e.syncCheckAll(), layui.event.call(this, h, "checkbox(" + s + ")", { checked: r, data: u.getDataList(e.key) && c || {}, type: d ? "all" : "one" }) })), e.layBody.on("click", "*[lay-event]", (function () { var o = t(this), c = o.parents("tr").eq(0).data("index"), d = e.layBody.find('tr[data-index="' + c + '"]'), p = (u.getDataList(e.key), u.getDataList(e.key)[c]); layui.event.call(this, h, "tool(" + s + ")", { data: p, event: o.attr("lay-event"), tr: d, del: function () { u.delRow(n.id, p) }, update: function (n) { n = n || {}, layui.each(n, (function (n, o) { if (n in p) { var s, c = d.children('td[data-field="' + n + '"]'); p[n] = o, e.eachCols((function (e, t) { t.field == n && t.templet && (s = t.templet) })), c.children(r).html(s ? i(t(s).html() || o).render(p) : o), c.data("content", o) } })) } }), d.addClass("layui-table-click").siblings("tr").removeClass("layui-table-click") })) }, Class.prototype.lazyLoad = function (e, t, i, n) { }, thisTable.config = {}, u.init(), e(h, u) })) }, function (e, t) { /** @Title: layui.upload 文件上传 @Author: 贤心 @License:MIT */ layui.define("layer", (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), r = { config: {}, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, s, e, t) } }, thisUpload = function () { var e = this; return { upload: function (t) { e.upload.call(e, t) }, config: e.config } }, s = "upload", c = "layui-upload-form", d = "layui-upload-iframe", Class = function (e) { this.config = t.extend({}, this.config, r.config, e), this.render() }; Class.prototype.config = { accept: "images", exts: "", auto: !0, bindAction: "", url: "", field: "file", method: "post", data: {}, drag: !0, size: 0, number: 0, multiple: !1 }, Class.prototype.render = function (e) { (e = this.config).elem = t(e.elem), e.bindAction = t(e.bindAction), this.file(), this.events() }, Class.prototype.file = function () { var e = this.config, i = this.elemFile = t(['"].join("")), n = e.elem.next(); (n.hasClass("layui-upload-file") || n.hasClass(c)) && n.remove(), o.ie && o.ie < 10 && e.elem.wrap('
            '), this.isFile() ? (this.elemFile = e.elem, e.field = e.elem[0].name) : e.elem.after(i), o.ie && o.ie < 10 && this.initIE() }, Class.prototype.initIE = function () { var e, i = this.config, n = t(''), o = t(['
            ', "
            "].join("")); t("#" + d)[0] || t("body").append(n), i.elem.next().hasClass(c) || (this.elemFile.wrap(o), i.elem.next("." + c).append((e = [], layui.each(i.data, (function (t, i) { i = "function" == typeof i ? i() : i, e.push('') })), e.join("")))) }, Class.prototype.msg = function (e) { return i.msg(e, { icon: 2, shift: 6 }) }, Class.prototype.isFile = function () { var e = this.config.elem[0]; if (e) return "input" === e.tagName.toLocaleLowerCase() && "file" === e.type }, Class.prototype.preview = function (e) { window.FileReader && layui.each(this.chooseFiles, (function (t, i) { var n = new FileReader; n.readAsDataURL(i), n.onload = function () { e && e(t, i, this.result) } })) }, Class.prototype.upload = function (e, i) { var n, r, s = this, c = s.config, u = s.elemFile[0], ajaxSend = function () { var i = 0, n = 0, o = e || s.files || s.chooseFiles || u.files, allDone = function () { c.multiple && i + n === s.fileLength && "function" == typeof c.allDone && c.allDone({ total: s.fileLength, successful: i, aborted: n }) }; layui.each(o, (function (e, o) { var r = new FormData; r.append(c.field, o), layui.each(c.data, (function (e, t) { t = "function" == typeof t ? t() : t, r.append(e, t) })), t.ajax({ url: c.url, type: "post", data: r, contentType: !1, processData: !1, dataType: "json", headers: c.headers || {}, success: function (t) { i++, done(e, t), allDone() }, error: function () { n++, s.msg("请求上传接口出现异常"), error(e), allDone() } }) })) }, done = function (e, t) { if (s.elemFile.next(".layui-upload-choose").remove(), u.value = "", "object" != typeof t) try { t = JSON.parse(t) } catch (e) { return t = {}, s.msg("请对上传接口返回有效JSON") } "function" == typeof c.done && c.done(t, e || 0, (function (e) { s.upload(e) })) }, error = function (e) { c.auto && (u.value = ""), "function" == typeof c.error && c.error(e || 0, (function (e) { s.upload(e) })) }, h = c.exts, p = (r = [], layui.each(e || s.chooseFiles, (function (e, t) { r.push(t.name) })), r), y = { preview: function (e) { s.preview(e) }, upload: function (e, t) { var i = {}; i[e] = t, s.upload(i) }, pushFile: function () { return s.files = s.files || {}, layui.each(s.chooseFiles, (function (e, t) { s.files[e] = t })), s.files }, resetFile: function (e, t, i) { var n = new File([t], i); s.files = s.files || {}, s.files[e] = n } }; if (0 !== (p = 0 === p.length ? u.value.match(/[^\/\\]+\..+/g) || [] || "" : p).length) { switch (c.accept) { case "file": if (h && !RegExp("\\w\\.(" + h + ")$", "i").test(escape(p))) return s.msg("选择的文件中包含不支持的格式"), u.value = ""; break; case "video": if (!RegExp("\\w\\.(" + (h || "avi|mp4|wma|rmvb|rm|flash|3gp|flv") + ")$", "i").test(escape(p))) return s.msg("选择的视频中包含不支持的格式"), u.value = ""; break; case "audio": if (!RegExp("\\w\\.(" + (h || "mp3|wav|mid") + ")$", "i").test(escape(p))) return s.msg("选择的音频中包含不支持的格式"), u.value = ""; break; default: if (layui.each(p, (function (e, t) { RegExp("\\w\\.(" + (h || "jpg|png|gif|bmp|jpeg$") + ")", "i").test(escape(t)) || (n = !0) })), n) return s.msg("选择的图片中包含不支持的格式"), u.value = "" }var m, g, b; if (s.fileLength = (m = 0, g = e || s.files || s.chooseFiles || u.files, layui.each(g, (function () { m++ })), m), c.number && s.fileLength > c.number) return s.msg("同时最多只能上传的数量为:" + c.number); if (c.size > 0 && !(o.ie && o.ie < 10)) if (layui.each(s.chooseFiles, (function (e, t) { if (t.size > 1024 * c.size) { var i = c.size / 1024; i = i >= 1 ? i.toFixed(2) + "MB" : c.size + "KB", u.value = "", b = i } })), b) return s.msg("文件不能超过" + b); !function () { if ("choose" !== i && !c.auto || (c.choose && c.choose(y), "choose" !== i)) { if (c.before && c.before(y), o.ie) return o.ie > 9 ? ajaxSend() : (e = t("#" + d), s.elemFile.parent().submit(), clearInterval(Class.timer), void (Class.timer = setInterval((function () { var t, i = e.contents().find("body"); try { t = i.text() } catch (e) { s.msg("获取上传后的响应信息出现异常"), clearInterval(Class.timer), error() } t && (clearInterval(Class.timer), i.html(""), done(0, t)) }), 30))); var e; ajaxSend() } }() } }, Class.prototype.events = function () { var e = this, i = e.config, setChooseFile = function (t) { e.chooseFiles = {}, layui.each(t, (function (t, i) { var n = (new Date).getTime(); e.chooseFiles[n + "-" + t] = i })) }, setChooseText = function (t, n) { var o = e.elemFile, r = t.length > 1 ? t.length + "个文件" : (t[0] || {}).name || o[0].value.match(/[^\/\\]+\..+/g) || [] || ""; o.next().hasClass("layui-upload-choose") && o.next().remove(), e.upload(null, "choose"), e.isFile() || i.choose || o.after('' + r + "") }; i.elem.off("upload.start").on("upload.start", (function () { var o = t(this), r = o.attr("lay-data"); if (r) try { r = new Function("return " + r)(), e.config = t.extend({}, i, r), o.next().attr("accept", e.config.accept), o.next().attr("multiple", e.config.multiple) } catch (e) { n.error("Upload element property lay-data configuration item has a syntax error: " + r) } e.config.item = o, e.elemFile[0].click() })), o.ie && o.ie < 10 || i.elem.off("upload.over").on("upload.over", (function () { t(this).attr("lay-over", "") })).off("upload.leave").on("upload.leave", (function () { t(this).removeAttr("lay-over") })).off("upload.drop").on("upload.drop", (function (n, o) { var r = t(this), s = o.originalEvent.dataTransfer.files || []; r.removeAttr("lay-over"), setChooseFile(s), i.auto ? e.upload(s) : setChooseText(s) })), e.elemFile.off("upload.change").on("upload.change", (function () { var t = this.files || []; setChooseFile(t), i.auto ? e.upload() : setChooseText(t) })), i.bindAction.off("upload.action").on("upload.action", (function () { e.upload() })), i.elem.data("haveEvents") || (e.elemFile.on("change", (function () { t(this).trigger("upload.change") })), i.elem.on("click", (function () { e.isFile() || t(this).trigger("upload.start") })), i.drag && i.elem.on("dragover", (function (e) { e.preventDefault(), t(this).trigger("upload.over") })).on("dragleave", (function (e) { t(this).trigger("upload.leave") })).on("drop", (function (e) { e.preventDefault(), t(this).trigger("upload.drop", e) })), i.bindAction.on("click", (function () { t(this).trigger("upload.action") })), i.elem.data("haveEvents", !0)) }, r.render = function (e) { var t = new Class(e); return thisUpload.call(t) }, e(s, r) })) }]);