193 lines
478 KiB
JavaScript
193 lines
478 KiB
JavaScript
|
!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 =
|
|||
|
/*!
|
|||
|
* 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 =
|
|||
|
}, "object" == typeof e.exports ? e.exports = n.document ? o(n) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return o(e) } : o(n)
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.carousel 轮播模块
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = (layui.hint(), layui.device(), { config: {}, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }), n = "carousel", o = "layui-this", r = "layui-carousel-left", s = "layui-carousel-right", c = "layui-carousel-arrow", d = "layui-carousel-ind", Class = function (e) { this.config = t.extend({}, this.config, i.config, e), this.render() }; Class.prototype.config = { width: "600px", height: "280px", full: !1, arrow: "hover", indicator: "inside", autoplay: !0, interval: 3e3, anim: "", trigger: "click", index: 0 }, Class.prototype.render = function () { var e = this.config; e.elem = t(e.elem), e.elem[0] && (this.elemItem = e.elem.find(">*[carousel-item]>*"), e.index < 0 && (e.index = 0), e.index >= this.elemItem.length && (e.index = this.elemItem.length - 1), e.interval < 800 && (e.interval = 800), e.full ? e.elem.css({ position: "fixed", width: "100%", height: "100%", zIndex: 9999 }) : e.elem.css({ width: e.width, height: e.height }), e.elem.attr("lay-anim", e.anim), this.elemItem.eq(e.index).addClass(o), this.elemItem.length <= 1 || (this.indicator(), this.arrow(), this.autoplay(), this.events())) }, Class.prototype.reload = function (e) { clearInterval(this.timer), this.config = t.extend({}, this.config, e), this.render() }, Class.prototype.prevIndex = function () { var e = this.config.index - 1; return e < 0 && (e = this.elemItem.length - 1), e }, Class.prototype.nextIndex = function () { var e = this.config.index + 1; return e >= this.elemItem.length && (e = 0), e }, Class.prototype.addIndex = function (e) { var t = this.config; e = e || 1, t.index = t.index + e, t.index >= this.elemItem.length && (t.index = 0) }, Class.prototype.subIndex = function (e) { var t = this.config; e = e || 1, t.index = t.index - e, t.index < 0 && (t.index = this.elemItem.length - 1) }, Class.prototype.autoplay = function () { var e = this, t = e.config; t.autoplay && (e.timer = setInterval((function () { e.slide() }), t.interval)) }, Class.prototype.arrow = function () { var e = this, i = e.config, n = t(['<button class="layui-icon ' + c + '" lay-type="sub">' + ("updown" === i.anim ? "" : "") + "</button>", '<button class="layui-icon ' + c + '" lay-type="add">' + ("updown" === i.anim ? "" : "") + "</button>"].join("")); i.elem.attr("lay-arrow", i.arrow), i.elem.find("." + c)[0] && i.elem.find("." + c).remove(), i.elem.append(n), n.on("click", (function () { var i = t(this).attr("lay-type"); e.slide(i) })) }, Class.prototype.indicator = function () { var e, i = this, n = i.config, o = i.elemInd = t(['<div class="' + d + '"><ul>', (e = [], layui.each(i.elemItem, (function (t) { e.push("<li" + (n.index === t ? ' class="layui-this"' : "") + "></li>") })), e.join("")), "</ul></div>"].join("")); n.elem.attr("lay-indicator", n.indicator), n.elem.find("." + d)[0] && n.elem.find("." + d).remove(), n.elem.append(o), "updown" === n.anim && o.css("margin-top", -o.height() / 2), o.find("li").on("hover" === n.trigger ? "mouseover" : n.trigger, (function () { var e = t(this).index(); e > n.index ? i.slide("add", e - n.index) : e < n.index && i.slide("sub", n.index - e) })) }, Class.prototype.slide = function (e, t) { var i = this, c = i.elemItem, d = i.config, u = d.index, h = d.elem.attr("lay-filter"); i.haveSlide || ("sub" === e ? (i.subIndex(t), c.eq(d.index).addClass("layui-carousel-prev"), setTimeout((function () { c.eq(u).addClass(s), c.eq(d.index).addClass(s) }), 50)) : (i.addIndex(t), c.eq(d.index).addClass("layui-carousel-next"), setTimeout((function () { c.eq(u).addClass(r), c.eq(d.index).addClass(r) }), 50)), setTimeout((function () { c.removeClass(o + " layui-carousel-prev layui-carousel-next " + r + " " + s), c.eq(d.index).addClass(o), i.haveSlide = !1 }), 300), i.elemInd.find("li").eq(d.index).addClass(o).siblings().removeClass(o), i.haveSlide = !0, layui.event.call(this, n, "change(" + h + ")", { index: d.index, prevIndex: u, item: c.eq(d.index)
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.code 代码修饰器
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { "use strict"; var t = layui.$; e("code", (function (e) { var i = []; (e = e || {}).elem = t(e.elem || ".layui-code"), e.about = !("about" in e) || e.about, e.elem.each((function () { i.push(this) })), layui.each(i.reverse(), (function (i, n) { var o = t(n), r = o.html(); (o.attr("lay-encode") || e.encode) && (r = r.replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """)), o.html('<ol class="layui-code-ol"><li>' + r.replace(/[\r\t\n]+/g, "</li><li>") + "</li></ol>"), o.find(">.layui-code-h3")[0] || o.prepend('<h3 class="layui-code-h3">' + (o.attr("lay-title") || e.title || "code") + (e.about ? '<a href="http://www.layui.com/doc/modules/code.html" target="_blank">layui.code</a>' : "") + "</h3>"); var s = o.find(">.layui-code-ol"); o.addClass("layui-box layui-code-view"), (o.attr("lay-skin") || e.skin) && o.addClass("layui-code-" + (o.attr("lay-skin") || e.skin)), (s.find("li").length / 100 | 0) > 0 && s.css("margin-left", (s.find("li").length / 100 | 0) + "px"), (o.attr("lay-height") || e.height) && s.css("max-height", o.attr("lay-height") || e.height) })) })) })).addcss("modules/code.css", "skincodecss")
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Title: layui.colorpicker 颜色选择器
|
|||
|
@Author: star1029
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.colorpicker ? layui.colorpicker.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, "colorpicker", e, t) } }, thisColorPicker = function () { return { config: this.config } }, n = "layui-colorpicker", o = ".layui-colorpicker-main", r = "layui-colorpicker-trigger-span", s = "layui-colorpicker-trigger-i", c = "layui-colorpicker-alpha-bgcolor", d = "layui-colorpicker-alpha-slider", u = "layui-colorpicker-main-input", RGBToHSB = function (e) { var t = { h: 0, s: 0, b: 0 }, i = Math.min(e.r, e.g, e.b), n = Math.max(e.r, e.g, e.b), o = n - i; return t.b = n, t.s = 0 != n ? 255 * o / n : 0, 0 != t.s ? e.r == n ? t.h = (e.g - e.b) / o : e.g == n ? t.h = 2 + (e.b - e.r) / o : t.h = 4 + (e.r - e.g) / o : t.h = -1, n == i && (t.h = 0), t.h *= 60, t.h < 0 && (t.h += 360), t.s *= 100 / 255, t.b *= 100 / 255, t }, HSBToRGB = function (e) { var t = {}, i = e.h, n = 255 * e.s / 100, o = 255 * e.b / 100; if (0 == n) t.r = t.g = t.b = o; else { var r = o, s = (255 - n) * o / 255, c = i % 60 * (r - s) / 60; 360 == i && (i = 0), i < 60 ? (t.r = r, t.b = s, t.g = s + c) : i < 120 ? (t.g = r, t.b = s, t.r = r - c) : i < 180 ? (t.g = r, t.r = s, t.b = s + c) : i < 240 ? (t.b = r, t.r = s, t.g = r - c) : i < 300 ? (t.b = r, t.g = s, t.r = s + c) : i < 360 ? (t.r = r, t.g = s, t.b = r - c) : (t.r = 0, t.g = 0, t.b = 0) } return { r: Math.round(t.r), g: Math.round(t.g), b: Math.round(t.b) } }, HSBToHEX = function (e) { var i = HSBToRGB(e), n = [i.r.toString(16), i.g.toString(16), i.b.toString(16)]; return t.each(n, (function (e, t) { 1 == t.length && (n[e] = "0" + t) })), n.join("") }, RGBSTo = function (e) { var t = e.match(/[0-9]{1,3}/g) || []; return { r: t[0], g: t[1], b: t[2] } }, h = t(window), p = t(document), Class = function (e) { this.index = ++i.index, this.config = t.extend({}, this.config, i.config, e), this.render() }; Class.prototype.config = { color: "", size: null, alpha: !1, format: "hex", predefine: !1, colors: ["#009688", "#5FB878", "#1E9FFF", "#FF5722", "#FFB800", "#01AAED", "#999", "#c00", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585", "rgb(0, 186, 189)", "rgb(255, 120, 0)", "rgb(250, 212, 0)", "#393D49", "rgba(0,0,0,.5)", "rgba(255, 69, 0, 0.68)", "rgba(144, 240, 144, 0.5)", "rgba(31, 147, 255, 0.73)"] }, Class.prototype.render = function () { var e, i = this.config, n = t(['<div class="layui-unselect layui-colorpicker">', "<span " + ("rgb" == i.format && i.alpha ? 'class="layui-colorpicker-trigger-bgcolor"' : "") + ">", '<span class="layui-colorpicker-trigger-span" ', 'lay-type="' + ("rgb" == i.format ? i.alpha ? "rgba" : "torgb" : "") + '" ', 'style="' + (e = "", (i.color ? (e = i.color, (i.color.match(/[0-9]{1,3}/g) || []).length > 3 && (i.alpha && "rgb" == i.format || (e = "#" + HSBToHEX(RGBToHSB(RGBSTo(i.color))))), "background: " + e) : e) + '">'), '<i class="layui-icon layui-colorpicker-trigger-i ' + (i.color ? "layui-icon-down" : "layui-icon-close") + '"></i>', "</span>", "</span>", "</div>"].join("")), o = t(i.elem); i.size && n.addClass("layui-colorpicker-" + i.size), o.addClass("layui-inline").html(this.elemColorBox = n), this.color = this.elemColorBox.find("." + r)[0].style.background, this.events() }, Class.prototype.renderPicker = function () { var e = this.config, i = this.elemColorBox[0], n = this.elemPicker = t(['<div id="layui-colorpicker' + this.index + '" data-index="' + this.index + '" class="layui-anim layui-anim-upbit layui-colorpicker-main">', '<div class="layui-colorpicker-main-wrapper">', '<div class="layui-colorpicker-basis">', '<div class="layui-colorpicker-basis-white"></div>', '<div class="layui-colorpicker-basis-black"></div>', '<div class="layui-colorpicker-basis-cursor"></div>', "</div>", '<div class="layui-colorpicker-side">', '<div class="layui-colorpicker-side-slider"></div>', "</div>", "</div>", '<div class="layui-colorpicker-main-alpha ' + (e.alpha ? "layui-show"
|
|||
|
}, function (e, t) { layui.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 = { 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" } }, cache: { tableId: { data: { list: [], map: {}, treeList: [] } }, 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, u, e, t) }, getClass: function (e) { return d.cache.cla.claObjs[e] }, pushClass: function (e, t) { d.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 d.cache[e] ? d.cache[e].data.list : [] }, setDataList: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.list || (d.cache[e].data.list = []), d.cache[e].data.list = t }, getDataMap: function (e) { return d.cache[e] ? d.cache[e].data.map : {} }, setDataMap: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.map || (d.cache[e].data.map = {}), d.cache[e].data.map = t }, getDataTreeList: function (e) { return d.cache[e] ? d.cache[e].data.treeList : [] }, setDataTreeList: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.treeList || (d.cache[e].data.treeList = {}), d.cache[e].data.treeList = t }, init: function (e, i) { i = i || {}; var n = t(e ? 'table[lay-filter="' + e + '"]' : h + "[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 = [], u = t.extend({ elem: this, cols: [], data: [], skin: n.attr("lay-skin"), size: n.attr("lay-size"), even: "string" == typeof n.attr("lay-even") }, d.config, i, r); e && n.hide(), n.find("thead>tr").each((function (e) { u.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 d = t.extend({ title: n.text(), colspan: n.attr("colspan") || 0, rowspan: n.attr("rowspan") || 0 }, r); d.colspan < 2 && c.push(d), u.cols[e].push(d) })) })), 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() })), u.data[e] = n })), d.render(u) })), this }, render: function (e) { d.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 = d.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 = d.getDataList(e) || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[d.config.cols.isCheckName] && (t++, n.push(d.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, setCheckStatus: function (e, t, i) { var n = d.getClass
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.dropdown 下拉按钮
|
|||
|
@Author:First
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { var t, i = layui.$, n = layui.device(), o = n.android || n.ios ? "click" : "mouseover"; Dropdown = function () { this.inst = null, this.currReElem = null }; var __hideDropdown = function (e) { isClosable(e.target) && isClosable(e.target.parentElement) && isClosable(e.target.parentElement.parentElement) && t.hide() }, isClosable = function (e) { return e && -1 == e.className.indexOf("layui-btn-dropdown") && -1 == e.className.indexOf("layui-dropdown-menu") }; Dropdown.prototype.hide = function () { t && t.inst && t.inst.is(":visible") && (t.inst.css("display", "none"), i("body").off(o, __hideDropdown)) }, Dropdown.prototype.render = function () { t = this, i(".layui-btn-dropdown").each((function (e, r) { var s = i(r); s.data("id", "dropdown-" + e), o = n.android || n.ios ? "click" : "mouseover", s[o]((function () { if (!t.inst || t.currReElem.data("id") != s.data("id") || t.currReElem.data("id") == s.data("id") && !t.inst.is(":visible")) { t.hide(); var e = s.find(".layui-dropdown-menu"), n = s.offset().left - i(window).scrollLeft(), r = s.offset().top + s.height() - i(window).scrollTop() - 2, c = s.width(), d = e.width(), u = n + c, h = { display: "block", position: "fixed", top: r + "px", left: n + "px" }; n + d > i(window).width() && i.extend(!0, h, { left: u - d + "px" }), e.css(h).on("click", "li", (function () { e.css("display", "none") })), t.inst = e, t.currReElem = s, i("body").on(o, __hideDropdown) } })) })) }; var r = new Dropdown; r.render(), i(window).scroll((function () { r.hide() })), e("dropdown", r) }))
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.element 常用元素操作
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = (layui.hint(), layui.device()), n = "layui-this", o = "layui-show", Element = function () { this.config = {} }; Element.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Element.prototype.on = function (e, t) { return layui.onevent.call(this, "element", e, t) }, Element.prototype.tabAdd = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]"), o = n.children(".layui-tab-title"), r = o.children(".layui-tab-bar"), s = n.children(".layui-tab-content"), c = '<li lay-id="' + (i.id || "") + '"' + (i.attr ? ' lay-attr="' + i.attr + '"' : "") + ">" + (i.title || "unnaming") + "</li>"; return r[0] ? r.before(c) : o.append(c), s.append('<div class="layui-tab-item">' + (i.content || "") + "</div>"), u.hideTabMore(!0), u.tabAuto(), this }, Element.prototype.tabDelete = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]").children(".layui-tab-title").find('>li[lay-id="' + i + '"]'); return u.tabDelete(null, n), this }, Element.prototype.tabChange = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]").children(".layui-tab-title").find('>li[lay-id="' + i + '"]'); return u.tabClick.call(n[0], null, null, n), this }, Element.prototype.tab = function (e) { e = e || {}, p.on("click", e.headerElem, (function (i) { var n = t(this).index(); u.tabClick.call(this, i, n, null, e) })) }, Element.prototype.progress = function (e, i) { var n = "layui-progress", o = t("." + n + "[lay-filter=" + e + "]").find("." + n + "-bar"), r = o.find("." + n + "-text"); return o.css("width", i), r.text(i), this }; var r = "layui-nav-tree", s = "layui-nav-child", c = "layui-nav-more", d = "layui-anim layui-anim-upbit", u = { tabClick: function (e, i, r, s) { s = s || {}; var c = r || t(this), d = (i = i || c.parent().children("li").index(c), s.headerElem ? c.parent() : c.parents(".layui-tab").eq(0)), u = s.bodyElem ? t(s.bodyElem) : d.children(".layui-tab-content").children(".layui-tab-item"), h = c.find("a"), p = d.attr("lay-filter"); "javascript:;" !== h.attr("href") && "_blank" === h.attr("target") || (c.addClass(n).siblings().removeClass(n), u.eq(i).addClass(o).siblings().removeClass(o)), layui.event.call(this, "element", "tab(" + p + ")", { elem: d, index: i }) }, tabDelete: function (e, i) { var o = i || t(this).parent(), r = o.index(), s = o.parents(".layui-tab").eq(0), c = s.children(".layui-tab-content").children(".layui-tab-item"), d = s.attr("lay-filter"); o.hasClass(n) && (o.next()[0] ? u.tabClick.call(o.next()[0], null, r + 1) : o.prev()[0] && u.tabClick.call(o.prev()[0], null, r - 1)), o.remove(), c.eq(r).remove(), setTimeout((function () { u.tabAuto() }), 50), layui.event.call(this, "element", "tabDelete(" + d + ")", { elem: s, index: r }) }, tabAuto: function () { var e = "layui-tab-bar", n = this; t(".layui-tab").each((function () { var o = t(this), r = o.children(".layui-tab-title"), s = (o.children(".layui-tab-content").children(".layui-tab-item"), 'lay-stope="tabmore"'), c = t('<span class="layui-unselect layui-tab-bar" ' + s + "><i " + s + ' class="layui-icon"></i></span>'); if (n === window && 8 != i.ie && u.hideTabMore(!0), o.attr("lay-allowClose") && r.find("li").each((function () { var e = t(this); if (!e.find(".layui-tab-close")[0]) { var i = t('<i class="layui-icon layui-unselect layui-tab-close">ဆ</i>'); i.on("click", u.tabDelete), e.append(i) } })), "string" != typeof o.attr("lay-unauto")) if (r.prop("scrollWidth") > r.outerWidth() + 1) { if (r.find("." + e)[0]) return; r.append(c), o.attr("overflow", ""), c.on("click", (function (e) { r[this.title ? "removeClass" : "addClass"]("layui-tab-more"), this.title = this.title ? "" : "收缩" })) } else r.find("." + e).remove(), o.removeAttr("overflow") })) }, hideTabMore: function (e) { var i = t(".layui-tab-title"); !0 !== e && "tabmore" === t(e.target).attr("lay-stope") || (i.removeClass("layui-tab-more"), i.find(".layui-tab-bar").attr("title", "")) }, clickThis: function () { var e = t(this), i = e.parents(".layui-nav"), o = i.attr("lay-fi
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.flow 流加载
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, Flow = function (e) { }; Flow.prototype.load = function (e) { var i, n, o, r = 0, s = t((e = e || {}).elem); if (s[0]) { var c = t(e.scrollElem || document), d = e.mb || 50, u = !("isAuto" in e) || e.isAuto, h = e.end || "没有更多了", p = e.scrollElem && e.scrollElem !== document, y = t('<div class="layui-flow-more"><a href="javascript:;"><cite>加载更多</cite></a></div>'); s.find(".layui-flow-more")[0] || s.append(y); var next = function (e, o) { e = t(e), y.before(e), (o = 0 == o || null) ? y.html(h) : y.find("a").html("<cite>加载更多</cite>"), n = o, i = null, m && m() }, done = function () { i = !0, y.find("a").html('<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>'), "function" == typeof e.done && e.done(++r, next) }; if (done(), y.find("a").on("click", (function () { t(this); n || i || done() })), e.isLazyimg) var m = this.lazyimg({ elem: e.elem + " img", scrollElem: e.scrollElem }); return u ? (c.on("scroll", (function () { var e = t(this), r = e.scrollTop(); o && clearTimeout(o), n || (o = setTimeout((function () { var n = p ? e.height() : t(window).height(); (p ? e.prop("scrollHeight") : document.documentElement.scrollHeight) - r - n <= d && (i || done()) }), 100)) })), this) : this } }, Flow.prototype.lazyimg = function (e) { var i, n, o = this, r = 0, s = t((e = e || {}).scrollElem || document), c = e.elem || "img", d = e.scrollElem && e.scrollElem !== document, show = function (e, t) { var i = s.scrollTop(), n = i + t, c = d ? e.offset().top - s.offset().top + i : e.offset().top; if (c >= i && c <= n && !e.attr("src")) { var u = e.attr("lay-src"); layui.img(u, (function () { var t = o.lazyimg.elem.eq(r); e.attr("src", u).removeAttr("lay-src"), t[0] && render(t), r++ })) } }, render = function (e, i) { var n = d ? (i || s).height() : t(window).height(), u = s.scrollTop(), h = u + n; if (o.lazyimg.elem = t(c), e) show(e, n); else for (var p = 0; p < o.lazyimg.elem.length; p++) { var y = o.lazyimg.elem.eq(p), m = d ? y.offset().top - s.offset().top + u : y.offset().top; if (show(y, n), r = p, m > h) break } }; (render(), i) || (s.on("scroll", (function () { var e = t(this); n && clearTimeout(n), n = setTimeout((function () { render(null, e) }), 50) })), i = !0); return render }, e("flow", new Flow) }))
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.form 表单组件
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define("layer", (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), r = ".layui-form", s = "layui-this", c = "layui-hide", d = "layui-disabled", Form = function () { this.config = { verify: { required: [/[\S]+/, "必填项不能为空!"], phone: function (e) { var t = /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/; if (e) if (-1 != e.indexOf("-")) { var i = e.split("-").length - 1; if (!t.test(e) && 1 == i) return "请输入正确的固定电话!"; if ("400" == e.substring(0, 3) && !/^400[0-9]{7}/.test(e) && 2 == i) return "请输入正确的400固话(400-6050-322或4000-809-009)!" } else { if ("800" == e.substring(0, 3) && !/^800[0-9]{7}/.test(e)) return "请输入正确的800固话(8007878789)!"; if (11 == e.length && !/^1\d{10}$/.test(e)) return "请输入正确的手机号!"; if (11 != e.length && !t.test(e) && "800" != e.substring(0, 3) && "400" != e.substring(0, 3)) return "请输入有效手机号或固定电话!" } }, email: function (e) { if (e && !/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)) return "邮箱格式不正确!" }, hrefurl: function (e) { if (e && !/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(e)) return "链接格式不正确!" }, number: function (e) { if (isNaN(e)) return "只能填写数字" }, numberInt: function (e) { if (e && !/^\d+$/.test(e)) return "只能填写正整数" }, date: function (e) { if (e && !/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/.test(e)) return "日期格式不正确!" }, identity: function (e) { if (e && !/(^\d{15}$)|(^\d{17}(x|X|\d)$)/.test(e)) return "请输入正确的身份证号!" }, postalCode: function (e) { if (e && !/^[0-9]{6}$/.test(e)) return "请输入正确的邮政编码!" }, url: function (e) { if (e && !/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(e)) return "请输入正确的链接地址!" }, name: function (e) { if (e && !/^[\u4E00-\u9FA5·sA-Za-z]{2,32}$/.test(e)) return "请输入正确的中英文名字,并且字符长度大于2小于等于32个字符!" }, specialCharacters: function (e) { if (e && (/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im.test(e) || /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im.test(e))) return "不能输入特殊字符!" } } } }; Array.prototype.indexOf || (Array.prototype.indexOf = function (e) { var t = this.length >>> 0, i = Number(arguments[1]) || 0; for ((i = i < 0 ? Math.ceil(i) : Math.floor(i)) < 0 && (i += t); i < t; i++)if (i in this && this[i] === e) return i; return -1 }), Form.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Form.prototype.verify = function (e) { return t.extend(!0, this.config.verify, e), this }, Form.prototype.on = function (e, t) { return layui.onevent.call(this, "form", e, t) }, Form.prototype.val = function (e, i) { return t(r + '[lay-filter="' + e + '"]').each((function (e, n) { var o = t(this); layui.each(i, (function (e, t) { var i, n = o.find('[name="' + e + '"]'); n[0] && ("checkbox" === (i = n[0].type) ? n[0].checked = t : "radio" === i ? n.each((function () { this.value === t && (this.checked = !0) })) : n.val(t)) })) })), u.render(null, e), this.getValue(e) }, Form.prototype.getValue = function (e, i) { i = i || t(r + '[lay-filter="' + e + '"]').eq(0); var n = {}, o = {}, s = i.find("input,select,textarea"); return layui.each(s, (function (e, i) { if (i.name = (i.name || "").replace(/^\s*|\s*&/, ""), i.name) { if (/^.*\[\]$/.test(i.name)) { var r = i.name.match(/^(.*)\[\]$/g)[0]; n[r] = 0 | n[r], i.name = i.name.replace(/^(.*)\[\]$/, "$1[" + n[r]++ + "]") } if (/^checkbox|radio$/.test(i.type)) { var s = t(i).attr("valueformat"); if (s) i.checked ? o[i.name] = s.split("|")[0] : o[i.name] = s.split("|")[1]; else if (!i.checked && t(i).attr("lay-skin")) o[i.name] = "1"; else { if (!i.checked) return; o[i.name] = i.value } } else o[i.name] = i.value } })), o }, Form.prototype.render = function (e, i) { var o = t(r + (i ? '[lay-filter="' + i + '"]' : "")), u = { extrCompoment: function () {
|
|||
|
}, function (e, t, i) {
|
|||
|
var n;
|
|||
|
/**
|
|||
|
|
|||
|
@Name : layDate 5.0.9 日期时间控件
|
|||
|
@Author: 贤心
|
|||
|
@Site:http://www.layui.com/laydate/
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/!function () { "use strict"; var o, r, s = window.layui && layui.define, c = { getPath: (o = 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 }(), o.substring(0, o.lastIndexOf("/") + 1)), getStyle: function (e, t) { var i = e.currentStyle ? e.currentStyle : window.getComputedStyle(e, null); return i[i.getPropertyValue ? "getPropertyValue" : "getAttribute"](t) }, link: function (e, t, i) { if (d.path) { var n = document.getElementsByTagName("head")[0], o = document.createElement("link"); "string" == typeof t && (i = t); var r = "layuicss-" + (i || e).replace(/\.|\//g, ""), s = 0; o.rel = "stylesheet", o.href = d.path + e, o.id = r, document.getElementById(r) || n.appendChild(o), "function" == typeof t && function poll() { if (++s > 80) return window.console && void 0; 1989 === parseInt(c.getStyle(document.getElementById(r), "width")) ? t() : setTimeout(poll, 100) }() } } }, d = { v: "5.0.9", config: {}, index: window.laydate && window.laydate.v ? 1e5 : 0, path: c.getPath, set: function (e) { return this.config = lay.extend({}, this.config, e), this }, ready: function (e) { var t = (s ? "modules/laydate/" : "theme/") + "default/laydate.css?v=" + d.v; return s ? layui.addcss(t, e, "laydate") : c.link(t, e, "laydate"), this } }, thisDate = function () { var e = this; return { hint: function (t) { e.hint.call(e, t) }, config: e.config } }, u = "layui-this", h = "laydate-disabled", p = "开始日期超出了结束日期<br>建议重新选择", y = [100, 2e5], m = "layui-laydate-list", g = "layui-laydate-hint", b = ".laydate-btns-confirm", Class = function (e) { var t = this; t.index = ++d.index, t.config = lay.extend({}, t.config, d.config, e), d.ready((function () { t.init() })) }, lay = function (e) { return new LAY(e) }, LAY = function (e) { for (var t = 0, i = "object" == typeof e ? [e] : (this.selector = e, document.querySelectorAll(e || null)); t < i.length; t++)this.push(i[t]) }; LAY.prototype = [], LAY.prototype.constructor = LAY, lay.extend = function () { var e = 1, t = arguments, clone = function (e, t) { for (var i in e = e || (t.constructor === Array ? [] : {}), t) e[i] = t[i] && t[i].constructor === Object ? clone(e[i], t[i]) : t[i]; return e }; for (t[0] = "object" == typeof t[0] ? t[0] : {}; e < t.length; e++)"object" == typeof t[e] && clone(t[0], t[e]); return t[0] }, lay.ie = (r = navigator.userAgent.toLowerCase(), !(!window.ActiveXObject && !("ActiveXObject" in window)) && ((r.match(/msie\s(\d+)/) || [])[1] || "11")), lay.stope = function (e) { (e = e || window.event).stopPropagation ? e.stopPropagation() : e.cancelBubble = !0 }, lay.each = function (e, t) { var i; if ("function" != typeof t) return this; if ((e = e || []).constructor === Object) { for (i in e) if (t.call(e[i], i, e[i])) break } else for (i = 0; i < e.length && !t.call(e[i], i, e[i]); i++); return this }, lay.digit = function (e, t, i) { var n = ""; t = t || 2; for (var o = (e = String(e)).length; o < t; o++)n += "0"; return e < Math.pow(10, t) ? n + (0 | e) : e }, lay.elem = function (e, t) { var i = document.createElement(e); return lay.each(t || {}, (function (e, t) { i.setAttribute(e, t) })), i }, LAY.addStr = function (e, t) { return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), lay.each(t, (function (t, i) { new RegExp("\\b" + i + "\\b").test(e) || (e = e + " " + i) })), e.replace(/^\s|\s$/, "") }, LAY.removeStr = function (e, t) { return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), lay.each(t, (function (t, i) { var n = new RegExp("\\b" + i + "\\b"); n.test(e) && (e = e.replace(n, "")) })), e.replace(/\s+/, " ").replace(/^\s|\s$/, "") }, LAY.prototype.find = function (e) { var t = this, i = 0, n = [], o = "object" == typeof e; return this.each((function (r, s) { for (var c = o ? [e] : s.querySelectorAll(e || null); i < c.length; i++)n.push(c[i]); t.shift() })), o || (t.selector = (t.selector ? t.selector + " " : "") + e),
|
|||
|
}, function (e, t) {
|
|||
|
/**
|
|||
|
|
|||
|
@Name:layui.layedit 富文本编辑器
|
|||
|
@Author:贤心
|
|||
|
@License:MIT
|
|||
|
|
|||
|
*/
|
|||
|
layui.define(["layer", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.form, o = (layui.hint(), layui.device()), r = "layui-disabled", Edit = function () { this.index = 0, this.config = { tool: ["strong", "italic", "underline", "del", "|", "left", "center", "right", "|", "link", "unlink", "face", "image"], hideTool: [], height: 280 } }; Edit.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Edit.prototype.on = function (e, t) { return layui.onevent("layedit", e, t) }, Edit.prototype.build = function (e, i) { i = i || {}; var n, r, c = this.config, d = "layui-layedit", u = t("string" == typeof e ? "#" + e : e), h = "LAY_layedit_" + ++this.index, p = u.next("." + d), y = t.extend({}, c, i), m = (n = [], r = {}, layui.each(y.hideTool, (function (e, t) { r[t] = !0 })), layui.each(y.tool, (function (e, t) { s[t] && !r[t] && n.push(s[t]) })), n.join("")), g = t(['<div class="' + d + '">', '<div class="layui-unselect layui-layedit-tool">' + m + "</div>", '<div class="layui-layedit-iframe">', '<iframe id="' + h + '" name="' + h + '" textarea="' + e + '" frameborder="0"></iframe>', "</div>", "</div>"].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(["<style>", "*{margin: 0; padding: 0;}", "body{padding: 10px; line-height: 20px; overflow-x: hidden; word-wrap: break-word; font: 14px Helvetica Neue,Helvetica,PingFang SC,Microsoft YaHei,Tahoma,Arial,sans-serif; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}", "a{color:#01AAED; text-decoration:none;}a:hover{color:#c00}", "p{margin-bottom: 10px;}", "img{display: inline-block; border: none; vertical-align: middle;}", "pre{margin: 10px 0; padding: 10px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}", "</style>"].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, "<p>") } })), 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, "<p>"), setTimeout((function () { filter.call(e, d), r.value = d.html() }), 100) })) }, filter = function (e) { this.document; e.find("*[style]").each((function () { v
|
|||
|
}, 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 ? '<div class="layui-layer-title" style="' + (s ? o.title[1] : "") + '">' + (s ? o.title[0] : o.title) + "</div>" : ""; return o.zIndex = r, t([o.shade ? '<div c
|
|||
|
}, 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++; }}", '<li layim-event="chat" data-type="' + e.type + '" data-index="{{ ' + (e.index || "i") + ' }}" class="layim-' + ("history" === e.type ? "{{i}}" : e.type + "{{data.id}}") + ' {{ data.status === "offline" ? "layim-list-gray" : "" }}"><img src="{{ data.avatar }}"><span>{{ data.username||data.groupname||data.name||"佚名" }}</span><p>{{ data.remark||data.sign||"" }}</p><span class="layim-msg-status">new</span></li>', "{{# }); if(length === 0){ }}", '<li class="layim-null">' + ({ friend: "该分组下暂无好友", group: "暂无群组", history: "暂无历史会话" }[e.type] || "暂无数据") + "</li>", "{{# } }}"].join("") }, u = ['<div class="layui-layim-main">', '<div class="layui-layim-info">', '<div class="layui-layim-user">{{ d.mine.username }}</div>', '<div class="layui-layim-status">', '{{# if(d.mine.status === "online"){ }}', '<span class="layui-icon layim-status-online" layim-event="status" lay-type="show"></span>', '{{# } else if(d.mine.status === "hide") { }}', '<span class="layui-icon layim-status-hide" layim-event="status" lay-type="show"></span>', "{{# } }}", '<ul class="layui-anim layim-menu-box">', '<li {{d.mine.status === "online" ? "class=layim-this" : ""}} layim-event="status" lay-type="online"><i class="layui-icon"></i><cite class="layui-icon layim-status-online"></cite>在线</li>', '<li {{d.mine.status === "hide" ? "class=layim-this" : ""}} layim-event="status" lay-type="hide"><i class="layui-icon"></i><cite class="layui-icon layim-status-hide"></cite>隐身</li>', "</ul>", "</div>", '<input class="layui-layim-remark" placeholder="编辑签名" value="{{ d.mine.remark||d.mine.sign||"" }}">', "</div>", '<ul class="layui-unselect layui-layim-tab{{# if(!d.base.isfriend || !d.base.isgroup){ }}', " layim-tab-two", '{{# } }}">', '<li class="layui-icon', "{{# if(!d.base.isfriend){ }}", " layim-hide", "{{# } else { }}", " layim-this", "{{# } }}", '" title="联系人" layim-event="tab" l
|
|||
|
}, 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 ? '<a href="javascript:;" class="layui-laypage-prev' + (1 == e.curr ? " layui-disabled" : "") + '" data-page="' + (e.curr - 1) + '">' + e.prev + "</a>" : "", page: function () { var i = []; if (e.count < 1) return ""; n > 1 && !1 !== e.first && 0 !== t && i.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">' + (e.first || 1) + "</a>"); 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('<span class="layui-laypage-spr">…</span>'); s <= c; s++)s === e.curr ? i.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" ' + (/^#/.test(e.theme) ? 'style="background-color:' + e.theme + ';"' : "") + "></em><em>" + s + "</em></span>") : i.push('<a href="javascript:;" data-page="' + s + '">' + s + "</a>"); return e.pages > t && e.pages > c && !1 !== e.last && (c + 1 < e.pages && i.push('<span class="layui-laypage-spr">…</span>'), 0 !== t && i.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="' + e.pages + '">' + (e.last || e.pages) + "</a>")), i.join("") }(), next: e.next ? '<a href="javascript:;" class="layui-laypage-next' + (e.curr == e.pages ? " layui-disabled" : "") + '" data-page="' + (e.curr + 1) + '">' + e.next + "</a>" : "", count: '<span class="layui-laypage-count">共 ' + e.count + " 条</span>", limit: function () { var t = ['<span class="layui-laypage-limits"><select lay-ignore>']; return layui.each(e.limits, (function (i, n) { t.push('<option value="' + n + '"' + (n === e.limit ? "selected" : "") + ">" + n + " 条/页</option>") })), t.join("") + "</select></span>" }(), refresh: ['<a href="javascript:;" data-page="' + e.curr + '" class="layui-laypage-refresh">', '<i class="layui-icon layui-icon-refresh"></i>', "</a>"].join(""), skip: ['<span class="layui-laypage-skip">到第', '<input type="text" min="1" value="' + e.curr + '" class="layui-input">', '页<button type="button" class="layui-laypage-btn">确定</button>', "</span>"].join("") }; return ['<div class="layui-box layui-laypage layui-laypage-' + (e.theme ? /^#/.test(e.theme) ? "molv" : e.theme : "default") + '" id="layui-laypage-' + e.index + '">', (i = [], layui.each(e.layout, (function (e, t) { o[t] && i.push(o[t]) })), i.join("")), "</div>"].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
|
|||
|
}, 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, "'").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 = '<ul class="layui-rate" ' + (i.readonly ? "readonly" : "") + ">", c = 1; c <= i.length; c++) { var d = '<li class="layui-inline"><i class="layui-icon ' + (c > Math.floor(i.value) ? o : r) + '" ' + n + "></i></li>"; i.half && parseInt(i.value) !== i.value && c == Math.ceil(i.value) ? s = s + '<li><i class="layui-icon layui-icon-rate-half" ' + n + "></i></li>" : s += d } s += "</ul>" + (i.text ? '<span class="layui-inline">' + i.value + "星" : "") + "</span>"; 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("<option value='" + i.KEY + "' >" + i.VALUE + "</option>") })), 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-slid
|
|||
|
/**
|
|||
|
@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 ? ['<ul class="tab-sort">', "{{# layui.each(d.data.sortcols, function(i1, item1){ }}", "{{# layui.each(item1, function(i2, item2){ }}", '<li data-field="{{ item2.field||i2 }}" data-key="{{# if(item2.key){ }}{{d.index}}-{{item2.key}}{{# } else { }}{{d.index}}-{{i1}}-{{i2}} {{# } }}" class="{{# if(item2.hide){ }}layui-hide{{# } }}">', '<div class="layui-table-cell laytable-cell-', "{{# if(item2.key){ }}{{d.index}}-{{item2.key}}{{# } else { }}{{d.index}}-{{i1}}-{{i2}} {{# } }}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", '"{{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<span style="margin-right:5px"><input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose"></span>', "{{# } }}", '<span>{{item2.title||""}}</span>', '{{# if(item2.type != "checkbox"){ }}', '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc" title="升序"></i><i class="layui-edge layui-table-sort-desc" title="降序"></i></span>', "{{# } }}", "</div>", "</li>", "{{# }); }}", "{{# }); }}", "</ul>"].join("") : ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<thead>", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "<tr>", "{{# 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; }}", '<th data-field="{{ item2.field||i2 }}" data-key="{{d.index}}-{{i1}}-{{i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{ item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}">', '<div class="layui-table-cell la
|
|||
|
}, 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 ['<div class="layui-transfer-box" data-index="' + (e = e || {}).index + '">', '<div class="layui-transfer-header">', '<input type="checkbox" name="' + e.checkAllName + '" lay-filter="layTransferCheckbox" lay-type="all" lay-skin="primary" title="{{ d.data.title[' + e.index + "] || 'list" + (e.index + 1) + "' }}\">", "</div>", "{{# if(d.data.showSearch){ }}", '<div class="layui-transfer-search">', '<i class="layui-icon layui-icon-search"></i>', '<input type="input" class="layui-input" placeholder="关键词搜索">', "</div>", "{{# } }}", '<ul class="layui-transfer-data"></ul>', "</div>"].join("") }, d = ['<div class="layui-transfer layui-form layui-border-box" lay-filter="LAY-transfer-{{ d.index }}">', TPL_BOX({ index: 0, checkAllName: "layTransferLeftCheckAll" }), '<div class="layui-transfer-active">', '<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="0">', '<i class="layui-icon layui-icon-next"></i>', "</button>", '<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="1">', '<i class="layui-icon layui-icon-prev"></i>', "</button>", "</div>", TPL_BOX({ index: 1, checkAllName: "layTransferRightCheckAll" }), "</div>"].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 = ["<li>", '<input type="checkbox" name="' + i[t].checkName + '" lay-skin="primary" lay-filter="layTransferCheckbox" title="' + e.title + '"' + (e.disabled ? " disabled" : "") + (e.checked ? " checked" : "") + ' value="' + e.value + '">', "</li>"].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.eac
|
|||
|
}, 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('<ul class="' + (h.spread ? "layui-show" : "") + '"></ul>'), m = t(["<li " + (h.spread ? 'data-spread="' + h.spread + '"' : "") + ">", p ? '<i class="layui-icon layui-tree-spread">' + (h.spread ? o[1] : o[0]) + "</i>" : "", u.check ? '<i class="layui-icon layui-tree-check">' + ("checkbox" === u.check ? r[0] : "radio" === u.check ? s[0] : "") + "</i>" : "", '<a href="' + (h.href || "javascript:;") + '" ' + (u.target && h.href ? 'target="' + u.target + '"' : "") + '><i class="layui-icon layui-tree-' + (p ? "branch" : "leaf") + '">' + (p ? h.spread ? c[1] : c[0] : d) + "</i><cite>" + (h.name || "未命名") + "</cite></a>", "</li>"].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('<div class="layui-box ' + r + '"></div>'); 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.hasOwnPropert
|
|||
|
/**
|
|||
|
|
|||
|
@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(['<input class="layui-upload-file" type="file" accept="' + e.acceptMime + '" name="' + e.field + '"', e.multiple ? " multiple" : "", ">"].join("")), n = e.elem.next(); (n.hasClass("layui-upload-file") || n.hasClass(c)) && n.remove(), o.ie && o.ie < 10 && e.elem.wrap('<div class="layui-upload-wrap"></div>'), 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('<iframe id="' + d + '" class="' + d + '" name="' + d + '" frameborder="0"></iframe>'), o = t(['<form target="' + d + '" class="' + c + '" method="post" key="set-mine" enctype="multipart/form-data" action="' + i.url + '">', "</form>"].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('<input type="hidden" name="' + t + '" value="' + i + '">') })), 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 || {}
|
|||
|
}]);
|