You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
305 KiB
Plaintext
40 lines
305 KiB
Plaintext
11 months ago
|
/*! MIT Licensed */;!function(t){"use strict";var e=t.document,r={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.6.7"},o=t.LAYUI_GLOBAL||{},a=function(){var t=e.currentScript?e.currentScript.src:function(){for(var t,r=e.scripts,n=r.length-1,o=n;o>0;o--)if("interactive"===r[o].readyState){t=r[o].src;break}return t||r[n].src}();return r.dir=o.dir||t.substring(0,t.lastIndexOf("/")+1)}(),i=function(e,r){r=r||"log",t.console&&console[r]&&console[r]("layui error hint: "+e)},u="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),l=r.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",all:"all","layui.all":"layui.all"};n.prototype.cache=r,n.prototype.define=function(t,e){var n=this,o="function"==typeof t,a=function(){var t=function(t,e){layui[t]=e,r.status[t]=!0};return"function"==typeof e&&e(function(n,o){t(n,o),r.callback[n]=function(){e(t)}}),this};return o&&(e=t,t=[]),n.use(t,a,null,"define"),n},n.prototype.use=function(n,o,c,s){function p(t,e){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===t.type||n.test((t.currentTarget||t.srcElement).readyState))&&(r.modules[h]=e,v.removeChild(b),function o(){return++m>1e3*r.timeout/4?i(h+" is not a valid module","error"):void(r.status[h]?f():setTimeout(o,4))}())}function f(){c.push(layui[h]),n.length>1?y.use(n.slice(1),o,c,s):"function"==typeof o&&function(){return layui.jquery&&"function"==typeof layui.jquery&&"define"!==s?layui.jquery(function(){o.apply(layui,c)}):void o.apply(layui,c)}()}var y=this,d=r.dir=r.dir?r.dir:a,v=e.getElementsByTagName("head")[0];n=function(){return"string"==typeof n?[n]:"function"==typeof n?(o=n,["all"]):n}(),t.jQuery&&jQuery.fn.on&&(y.each(n,function(t,e){"jquery"===e&&n.splice(t,1)}),layui.jquery=layui.$=jQuery);var h=n[0],m=0;if(c=c||[],r.host=r.host||(d.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===n.length||layui["layui.all"]&&l[h])return f(),y;var g=(l[h]?d+"modules/":/^\{\/\}/.test(y.modules[h])?"":r.base||"")+(y.modules[h]||h)+".js";if(g=g.replace(/^\{\/\}/,""),!r.modules[h]&&layui[h]&&(r.modules[h]=g),r.modules[h])!function S(){return++m>1e3*r.timeout/4?i(h+" is not a valid module","error"):void("string"==typeof r.modules[h]&&r.status[h]?f():setTimeout(S,4))}();else{var b=e.createElement("script");b.async=!0,b.charset="utf-8",b.src=g+function(){var t=r.version===!0?r.v||(new Date).getTime():r.version||"";return t?"?v="+t:""}(),v.appendChild(b),!b.attachEvent||b.attachEvent.toString&&b.attachEvent.toString().indexOf("[native code")<0||u?b.addEventListener("load",function(t){p(t,g)},!1):b.attachEvent("onreadystatechange",function(t){p(t,g)}),r.modules[h]=g}return y},n.prototype.getStyle=function(e,r){var n=e.currentStyle?e.currentStyle:t.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](r)},n.prototype.link=function(t,n,o){var a=this,u=e.getElementsByTagName("head")[0],l=e.createElement("link");"string"==typeof n&&(o=n);var c=(o||t).replace(/\.|\//g,""),s=l.id="layuicss-"+c,p="creating",f=0;return l.rel="stylesheet",l.href=t+(r.debug?"?v="+(new Date).getTime():""),l.media="all",e.getElementById(s)||u.appendChild(l),"function"!=typeof n?a:(function y(o){var u=100,l=e.getElementById(s);return++f>1e3*r.timeout/u?i(t+" timeout"):void(1989===parseInt(a.getStyle(l,"width"))?(o===p&&l.removeAttribute("lay-status"),l.getAttribute("lay-status")===p?setTimeout(y,u):n()):(l.setAttribute("lay-status",p),setTimeout(function(){y(p)},u)))}(),a)},n.prototype.addcss=function(t,e,n){return layui.link(r.dir+"css/"+t,e,n)},r.callback={},n.prototype.factory=function(t){if(layui[t])return"function"==typeof r.callback[t]?r.callback[t]:null},n.prototype.img=function(t,e,r){var n=new Image;return n.src=t,n.complete?e(n):(n.onload=function(){n.onload=null,"function"==typeof
|
||
|
d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.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:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},T.pseudos.nth=T.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})T.pseudos[b]=s(b);for(b in{submit:!0,reset:!0})T.pseudos[b]=u(b);return f.prototype=T.filters=T.pseudos,T.setFilters=new f,N=t.tokenize=function(e,n){var r,i,o,a,s,u,l,c=z[e+" "];if(c)return n?0:c.slice(0);for(s=e,u=[],l=T.preFilter;s;){r&&!(i=ue.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),r=!1,(i=le.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in T.filter)!(i=pe[a].exec(s))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):z(e,u).slice(0)},k=t.compile=function(e,t){var n,r=[],i=[],o=X[e+" "];if(!o){for(t||(t=N(e)),n=t.length;n--;)o=v(t[n]),o[P]?r.push(o):i.push(o);o=X(e,x(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,f=!r&&N(e=l.selector||e);if(n=n||[],1===f.length){if(o=f[0]=f[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.fin
|
||
|
},e)}}),pe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){pe.fn[e]=function(e){for(var n,r=0,i=[],o=pe(e),a=o.length-1;r<=a;r++)n=r===a?this:this.clone(!0),pe(o[r])[t](n),ae.apply(i,n.get());return this.pushStack(i)}});var ut,lt={HTML:"block",BODY:"block"},ct=/^margin/,ft=new RegExp("^("+Fe+")(?!px)[a-z%]+$","i"),dt=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i},pt=re.documentElement;!function(){function t(){var t,c,f=re.documentElement;f.appendChild(u),l.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",n=i=s=!1,r=a=!0,e.getComputedStyle&&(c=e.getComputedStyle(l),n="1%"!==(c||{}).top,s="2px"===(c||{}).marginLeft,i="4px"===(c||{width:"4px"}).width,l.style.marginRight="50%",r="4px"===(c||{marginRight:"4px"}).marginRight,t=l.appendChild(re.createElement("div")),t.style.cssText=l.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",l.style.width="1px",a=!parseFloat((e.getComputedStyle(t)||{}).marginRight),l.removeChild(t)),l.style.display="none",o=0===l.getClientRects().length,o&&(l.style.display="",l.innerHTML="<table><tr><td></td><td>t</td></tr></table>",l.childNodes[0].style.borderCollapse="separate",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"
|
||
|
return this.map(function () { for (var e = this.offsetParent; e && !pe.nodeName(e, "html") && "static" === pe.css(e, "position");)e = e.offsetParent; return e || pt })
|
||
|
}
|
||
|
}), pe.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (e, t) { var n = /Y/.test(t); pe.fn[e] = function (r) { return Pe(this, function (e, r, i) { var o = te(e); return void 0 === i ? o ? t in o ? o[t] : o.document.documentElement[r] : e[r] : void (o ? o.scrollTo(n ? pe(o).scrollLeft() : i, n ? i : pe(o).scrollTop()) : e[r] = i) }, e, r, arguments.length, null) } }), pe.each(["top", "left"], function (e, t) { pe.cssHooks[t] = L(fe.pixelPosition, function (e, n) { if (n) return n = gt(e, t), ft.test(n) ? pe(e).position()[t] + "px" : n }) }), pe.each({ Height: "height", Width: "width" }, function (e, t) { pe.each({ padding: "inner" + e, content: t, "": "outer" + e }, function (n, r) { pe.fn[r] = function (r, i) { var o = arguments.length && (n || "boolean" != typeof r), a = n || (r === !0 || i === !0 ? "margin" : "border"); return Pe(this, function (t, n, r) { var i; return pe.isWindow(t) ? t.document.documentElement["client" + e] : 9 === t.nodeType ? (i = t.documentElement, Math.max(t.body["scroll" + e], i["scroll" + e], t.body["offset" + e], i["offset" + e], i["client" + e])) : void 0 === r ? pe.css(t, n, a) : pe.style(t, n, r, a) }, t, o ? r : void 0, o, null) } }) }), pe.fn.extend({ bind: function (e, t, n) { return this.on(e, null, t, n) }, unbind: function (e, t) { return this.off(e, null, t) }, delegate: function (e, t, n, r) { return this.on(t, e, n, r) }, undelegate: function (e, t, n) { return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n) } }), pe.fn.size = function () { return this.length }, pe.fn.andSelf = pe.fn.addBack, layui.define(function (e) { layui.$ = pe, e("jquery", pe) }), pe
|
||
|
}); !function (e, t) { "use strict"; var i, n, a = e.layui && layui.define, o = { getPath: function () { var t = 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 }(), i = e.LAYUI_GLOBAL || {}; return i.layer_dir || t.substring(0, t.lastIndexOf("/") + 1) }(), config: {}, end: {}, minIndex: 0, minLeft: [], btn: ["确定", "取消"], type: ["dialog", "page", "iframe", "loading", "tips"], getStyle: function (t, i) { var n = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null); return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](i) }, link: function (t, i, n) { if (r.path) { var a = document.getElementsByTagName("head")[0], s = document.createElement("link"); "string" == typeof i && (n = i); var l = (n || t).replace(/\.|\//g, ""), f = "layuicss-" + l, c = "creating", u = 0; s.rel = "stylesheet", s.href = r.path + t, s.id = f, document.getElementById(f) || a.appendChild(s), "function" == typeof i && !function d(t) { var n = 100, a = document.getElementById(f); return ++u > 1e4 / n ? e.console && console.error(l + ".css: Invalid") : void (1989 === parseInt(o.getStyle(a, "width")) ? (t === c && a.removeAttribute("lay-status"), a.getAttribute("lay-status") === c ? setTimeout(d, n) : i()) : (a.setAttribute("lay-status", c), setTimeout(function () { d(c) }, n))) }() } } }, r = { v: "3.5.1", ie: function () { var t = navigator.userAgent.toLowerCase(); return !!(e.ActiveXObject || "ActiveXObject" in e) && ((t.match(/msie\s(\d+)/) || [])[1] || "11") }(), index: e.layer && e.layer.v ? 1e5 : 0, path: o.getPath, config: function (e, t) { return e = e || {}, r.cache = o.config = i.extend({}, o.config, e), r.path = o.config.path || r.path, "string" == typeof e.extend && (e.extend = [e.extend]), o.config.path && r.ready(), e.extend ? (a ? layui.addcss("modules/layer/" + e.extend) : o.link("theme/" + e.extend), this) : this }, ready: function (e) { var t = "layer", i = "", n = (a ? "modules/layer/" : "theme/") + "default/layer.css?v=" + r.v + i; return a ? layui.addcss(n, e, t) : o.link(n, e, t), this }, alert: function (e, t, n) { var a = "function" == typeof t; return a && (n = t), r.open(i.extend({ content: e, yes: n }, a ? {} : t)) }, confirm: function (e, t, n, a) { var s = "function" == typeof t; return s && (a = n, n = t), r.open(i.extend({ content: e, btn: o.btn, yes: n, btn2: a }, s ? {} : t)) }, msg: function (e, n, a) { var s = "function" == typeof n, f = o.config.skin, c = (f ? f + " " + f + "-msg" : "") || "layui-layer-msg", u = l.anim.length - 1; return s && (a = n), r.open(i.extend({ content: e, time: 3e3, shade: !1, skin: c, title: !1, closeBtn: !1, btn: !1, resize: !1, end: a }, s && !o.config.skin ? { skin: c + " layui-layer-hui", anim: u } : function () { return n = n || {}, (n.icon === -1 || n.icon === t && !o.config.skin) && (n.skin = c + " " + (n.skin || "layui-layer-hui")), n }())) }, load: function (e, t) { return r.open(i.extend({ type: 3, icon: e || 0, resize: !1, shade: .01 }, t)) }, tips: function (e, t, n) { return r.open(i.extend({ type: 4, content: [e, t], closeBtn: !1, time: 3e3, shade: !1, resize: !1, fixed: !1, maxWidth: 260 }, n)) } }, s = function (e) { var t = this, a = function () { t.creat() }; t.index = ++r.index, t.config.maxWidth = i(n).width() - 30, t.config = i.extend({}, t.config, o.config, e), document.body ? a() : setTimeout(function () { a() }, 30) }; s.pt = s.prototype; var l = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; l.anim = ["layer-anim-00", "layer-anim-01", "layer-anim-02", "layer-anim-03", "layer-anim-04", "layer-anim-05", "layer-anim-06"], l.SHADE = "layui-layer-shade", l.MOVE = "layui-layer-move", s.pt.config = { type: 0, shade: .3, fixed: !0, move: l[1], title: "信息", offset: "auto", area: "auto", closeBtn: 1, time: 0, zIndex: 1989101
|
||
|
"use strict"; var t = layui.$, i = layui.laytpl, a = layui.laypage, l = layui.layer, n = layui.form, o = (layui.util, layui.hint()), r = layui.device(), c = { config: { checkName: "LAY_CHECKED", indexName: "LAY_TABLE_INDEX" }, cache: {}, index: layui.table ? layui.table.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, y, e, t) } }, d = function () { var e = this, t = e.config, i = t.id || t.index; return i && (d.that[i] = e, d.config[i] = t), { config: t, reload: function (t, i) { e.reload.call(e, t, i) }, setColsWidth: function () { e.setColsWidth.call(e) }, resize: function () { e.resize.call(e) } } }, s = function (e) { var t = d.config[e]; return t || o.error(e ? "The table instance with ID '" + e + "' not found" : "ID argument required"), t || null }, u = function (e, a, l, n) {
|
||
|
var o = e.templet ? function () {
|
||
|
return "function" == typeof e.templet ? e.templet(l) : i(t(e.templet).html() || String(a)).render(l)
|
||
|
}() : a; return n ? t("<div>" + o + "</div>").text() : o
|
||
|
}, y = "table", h = ".layui-table", f = "layui-hide", p = "layui-none", v = "layui-table-view", m = ".layui-table-tool", g = ".layui-table-box", b = ".layui-table-init", x = ".layui-table-header", k = ".layui-table-body", C = ".layui-table-main", w = ".layui-table-fixed", T = ".layui-table-fixed-l", N = ".layui-table-fixed-r", A = ".layui-table-total", L = ".layui-table-page", S = ".layui-table-sort", R = "layui-table-edit", _ = "layui-table-hover", W = function (e) { var t = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}'; return e = e || {}, ['<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; } }}', function () { return e.fixed && "right" !== e.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === e.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}}"{{# } }} ' + t + ' {{# 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 laytable-cell-', "{{# if(item2.colGroup){ }}", "group", "{{# } else { }}", "{{d.index}}-{{i1}}-{{i2}}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", "{{# } }}", '" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}>', "{{# } else { }}", '<span>{{item2.title||""}}</span>', "{{# if(isSort){ }}", '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc" title="\u5347\u5e8f"></i><i class="layui-edge layui-table-sort-desc" title="\u964d\u5e8f"></i></span>', "{{# } }}", "{{# } }}", "</div>", "</th>", e.fixed ? "{{# }; }}" : "", "{{# }); }}", "</tr>", "{{# }); }}", "</thead>", "</table>"].join("") }, z = ['<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{{# } }}>', "<tbody></tbody>", "</table>"].join(""), E = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}{{# if(d.data.className){ }} {{ d.data.className }}{{# } }}" lay-filter="LAY-table-{{d.index}}" lay-id="{{ d.data.id }}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">', "{{# if(d.data.toolbar){ }}", '<div class="layui-table-tool">', '<div class="layui-table-tool-temp"></div>', '<div class="layui-table-tool-self"></div>', "</div>", "{{# } }}", '<div class="layui-table-box">', "{{# if(d.data.loading){ }}", '<div class="layui-table-init" style="background-color: #fff;">', '<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>', "</div>", "{{# } }}", "{{# var left, right; }}", '<div class="layui-table-header">', W(), "</div>", '<div class="layui-table-body layui-table-main">', z, "</div>", "{{# if(left){ }}", '<div class="layui-table-fixed layui-table-fixed-l">', '<div class="layui-table-header">', W({ fixed: !0 }), "</div>", '<div class="layui-table-body">', z, "</div>", "</div>", "{{# }; }}", "{{# if(right){ }}", '<div class="layui-table
|
||
|
var d = this, s = d.config, y = e[s.response.dataName] || [], h = e[s.response.totalRowName], v = [], m = [], g = [], b = function () {
|
||
|
var e; return !r && d.sortKey ? d.sort(d.sortKey.field, d.sortKey.sort, !0) : (layui.each(y, function (a, l) {
|
||
|
var o = [], y = [], h = [], p = a + s.limit * (n - 1) + 1; "array" === layui._typeof(l) && 0 === l.length || (r || (l[c.config.indexName] = a), d.eachCols(function (n, r) {
|
||
|
var d = r.field || n, v = s.index + "-" + r.key, m = l[d];
|
||
|
if (void 0 !== m && null !== m || (m = ""), !r.colGroup) {
|
||
|
var g = ['<td data-field="' + d + '" data-key="' + v + '" ' + function () { var e = []; return r.edit && e.push('data-edit="' + r.edit + '"'), r.align && e.push('align="' + r.align + '"'), r.templet && e.push('data-content="' + layui.laytpl("{{=d.t}}").render({ t: m }) + '"'), r.toolbar && e.push('data-off="true"'), r.event && e.push('lay-event="' + r.event + '"'), r.style && e.push('style="' + r.style + '"'), r.minWidth && e.push('data-minwidth="' + r.minWidth + '"'), e.join(" ") }() + ' class="' + function () { var e = []; return r.hide && e.push(f), r.field || e.push("layui-table-col-special"), e.join(" ") }() + '">', '<div class="layui-table-cell laytable-cell-' + function () { return "normal" === r.type ? v : v + " laytable-cell-" + r.type }() + '">' + function () { var n = t.extend(!0, { LAY_INDEX: p }, l), o = c.config.checkName; switch (r.type) { case "checkbox": return '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" ' + function () { return r[o] ? (l[o] = r[o], r[o] ? "checked" : "") : n[o] ? "checked" : "" }() + ">"; case "radio": return n[o] && (e = a), '<input type="radio" name="layTableRadio_' + s.index + '" ' + (n[o] ? "checked" : "") + ' lay-type="layTableRadio">'; case "numbers": return p }return r.toolbar ? i(t(r.toolbar).html() || "").render(n) : u(r, m, n) }(), "</div></td>"].join(""); o.push(g), r.fixed && "right" !== r.fixed && y.push(g), "right" === r.fixed && h.push(g)
|
||
|
}
|
||
|
}), v.push('<tr data-index="' + a + '">' + o.join("") + "</tr>"), m.push('<tr data-index="' + a + '">' + y.join("") + "</tr>"), g.push('<tr data-index="' + a + '">' + h.join("") + "</tr>"))
|
||
|
}), d.layBody.scrollTop(0), d.layMain.find("." + p).remove(), d.layMain.find("tbody").html(v.join("")), d.layFixLeft.find("tbody").html(m.join("")), d.layFixRight.find("tbody").html(g.join("")), d.renderForm(), "number" == typeof e && d.setThisRowChecked(e), d.syncCheckAll(), d.haveInit ? d.scrollPatch() : setTimeout(function () { d.scrollPatch() }, 50), d.haveInit = !0, l.close(d.tipsIndex), s.HAS_SET_COLS_PATCH || d.setColsPatch(), void (s.HAS_SET_COLS_PATCH = !0))
|
||
|
}; return c.cache[d.key] = y, d.layPage[0 == o || 0 === y.length && 1 == n ? "addClass" : "removeClass"](f), 0 === y.length ? (d.renderForm(), d.errorView(s.text.none)) : (d.layFixed.removeClass(f), r ? b() : (b(), d.renderTotal(y, h), void (s.page && (s.page = t.extend({ elem: "layui-table-page" + s.index, count: o, limit: s.limit, limits: s.limits || [10, 20, 30, 40, 50, 60, 70, 80, 90], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '<i class="layui-icon"></i>', next: '<i class="layui-icon"></i>', jump: function (e, t) { t || (d.page = e.curr, s.limit = e.limit, d.pullData(e.curr)) } }, s.page), s.page.count = o, a.render(s.page)))))
|
||
|
}, I.prototype.renderTotal = function (e, a) { var l = this, n = l.config, o = {}; if (n.totalRow) { layui.each(e, function (e, t) { 0 !== t.length && l.eachCols(function (e, i) { var a = i.field || e, l = t[a]; i.totalRow && (o[a] = (o[a] || 0) + (parseFloat(l) || 0)) }) }), l.dataTotal = {}; var r = []; l.eachCols(function (e, c) { var d = c.field || e, s = function () { var e, t = c.totalRowText || "", i = parseFloat(o[d]).toFixed(2), l = {}; return l[d] = i, e = c.totalRow ? u(c, i, l) || t : t, a ? a[c.field] || e : e }(), y = ['<td data-field="' + d + '" data-key="' + n.index + "-" + c.key + '" ' + function () { var e = []; return c.align && e.push('align="' + c.align + '"'), c.style && e.push('style="' + c.style + '"'), c.minWidth && e.push('data-minwidth="' + c.minWidth + '"'), e.join(" ") }() + ' class="' + function () { var e = []; return c.hide && e.push(f), c.field || e.push("layui-table-col-special"), e.join(" ") }() + '">', '<div class="layui-table-cell laytable-cell-' + function () { var e = n.index + "-" + c.key; return "normal" === c.type ? e : e + " laytable-cell-" + c.type }() + '">' + function () { var e = c.totalRow || n.totalRow; return "string" == typeof e ? i(e).render(t.extend({ TOTAL_NUMS: s }, c)) : s }(), "</div></td>"].join(""); c.field && (l.dataTotal[d] = s), r.push(y) }), l.layTotal.find("tbody").html("<tr>" + r.join("") + "</tr>") } }, I.prototype.getColElem = function (e, t) { var i = this, a = i.config; return e.eq(0).find(".laytable-cell-" + (a.index + "-" + t) + ":eq(0)") }, I.prototype.renderForm = function (e) { n.render(e, "LAY-table-" + this.index) }, I.prototype.setThisRowChecked = function (e) { var t = this, i = (t.config, "layui-table-click"), a = t.layBody.find('tr[data-index="' + e + '"]'); a.addClass(i).siblings("tr").removeClass(i) }, I.prototype.sort = function (e, i, a, l) { var n, r, d = this, s = {}, u = d.config, h = u.elem.attr("lay-filter"), f = c.cache[d.key]; "string" == typeof e && (n = e, d.layHeader.find("th").each(function (i, a) { var l = t(this), o = l.data("field"); if (o === e) return e = l, n = o, !1 })); try { var n = n || e.data("field"), p = e.data("key"); if (d.sortKey && !a && n === d.sortKey.field && i === d.sortKey.sort) return; var v = d.layHeader.find("th .laytable-cell-" + p).find(S); d.layHeader.find("th").find(S).removeAttr("lay-sort"), v.attr("lay-sort", i || null), d.layFixed.find("th") } catch (m) { o.error("Table modules: sort field '" + n + "' not matched") } d.sortKey = { field: n, sort: i }, u.autoSort && ("asc" === i ? r = layui.sort(f, n) : "desc" === i ? r = layui.sort(f, n, !0) : (r = layui.sort(f, c.config.indexName), delete d.sortKey)), s[u.response.dataName] = r || f, d.renderData(s, d.page, d.count, !0), l && layui.event.call(e, y, "sort(" + h + ")", { field: n, type: i }) }, I.prototype.loading = function (e) { var i = this, a = i.config; a.loading && (e ? (i.layInit && i.layInit.remove(), delete i.layInit, i.layBox.find(b).remove()) : (i.layInit = t(['<div class="layui-table-init">', '<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>', "</div>"].join("")), i.layBox.append(i.layInit))) }, I.prototype.setCheckData = function (e, t) { var i = this, a = i.config, l = c.cache[i.key]; l[e] && l[e].constructor !== Array && (l[e][a.checkName] = t) }, I.prototype.syncCheckAll = function () { var e = this, t = e.config, i = e.layHeader.find('input[name="layTableCheckbox"]'), a = function (i) { return e.eachCols(function (e, a) { "checkbox" === a.type && (a[t.checkName] = i) }), i }; i[0] && (c.checkStatus(e.key).isAll ? (i[0].checked || (i.prop("checked", !0), e.renderForm("checkbox")), a(!0)) : (i[0].checked && (i.prop("checked", !1), e.renderForm("checkbox")), a(!1))) }, I.prototype.getCssRule = function (e, t) { var i = this, a = i.elem.find("style")[0], l = a.sheet || a.styleSheet || {}, n = l.cssRules || l.rules; layui.each(n, function (i, a) { if (a.selectorText === ".laytable-cell-" + e) return t(a), !0 }) }, I.prototype.fullSize = function () { var e, t = this, i = t.config, a = i.he
|
||
|
var e, i = this, a = i.config, o = t("body"), d = {}, s = i.layHeader.find("th"), h = ".layui-table-cell", p = a.elem.attr("lay-filter"); i.layTool.on("click", "*[lay-event]", function (e) { var o = t(this), d = o.attr("lay-event"), s = function (e) { var l = t(e.list), n = t('<ul class="layui-table-tool-panel"></ul>'); n.html(l), a.height && n.css("max-height", a.height - (i.layTool.outerHeight() || 50)), o.find(".layui-table-tool-panel")[0] || o.append(n), i.renderForm(), n.on("click", function (e) { layui.stope(e) }), e.done && e.done(n, l) }; switch (layui.stope(e), F.trigger("table.tool.panel.remove"), l.close(i.tipsIndex), d) { case "LAYTABLE_COLS": s({ list: function () { var e = []; return i.eachCols(function (t, i) { i.field && "normal" == i.type && e.push('<li><input type="checkbox" name="' + i.field + '" data-key="' + i.key + '" data-parentkey="' + (i.parentKey || "") + '" lay-skin="primary" ' + (i.hide ? "" : "checked") + ' title="' + (i.title || i.field) + '" lay-filter="LAY_TABLE_TOOL_COLS"></li>') }), e.join("") }(), done: function () { n.on("checkbox(LAY_TABLE_TOOL_COLS)", function (e) { var l = t(e.elem), n = this.checked, o = l.data("key"), r = l.data("parentkey"); layui.each(a.cols, function (e, t) { layui.each(t, function (t, l) { if (e + "-" + t === o) { var c = l.hide; l.hide = !n, i.elem.find('*[data-key="' + a.index + "-" + o + '"]')[n ? "removeClass" : "addClass"](f), c != l.hide && i.setParentCol(!n, r), i.resize() } }) }) }) } }); break; case "LAYTABLE_EXPORT": r.ie ? l.tips("\u5bfc\u51fa\u529f\u80fd\u4e0d\u652f\u6301 IE\uff0c\u8bf7\u7528 Chrome \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668\u5bfc\u51fa", this, { tips: 3 }) : s({ list: function () { return ['<li data-type="csv">\u5bfc\u51fa\u5230 Csv \u6587\u4ef6</li>', '<li data-type="xls">\u5bfc\u51fa\u5230 Excel \u6587\u4ef6</li>'].join("") }(), done: function (e, l) { l.on("click", function () { var e = t(this).data("type"); c.exportFile.call(i, a.id, null, e) }) } }); break; case "LAYTABLE_PRINT": var u = window.open("\u6253\u5370\u7a97\u53e3", "_blank"), h = ["<style>", "body{font-size: 12px; color: #666;}", "table{width: 100%; border-collapse: collapse; border-spacing: 0;}", "th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}", "a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}", "</style>"].join(""), v = t(i.layHeader.html()); v.append(i.layMain.find("table").html()), v.append(i.layTotal.find("table").html()), v.find("th.layui-table-patch").remove(), v.find(".layui-table-col-special").remove(), u.document.write(h + v.prop("outerHTML")), u.document.close(), u.print(), u.close() }layui.event.call(this, y, "toolbar(" + p + ")", t.extend({ event: d, config: a }, {})) }), s.on("mousemove", function (e) { var i = t(this), a = i.offset().left, l = e.clientX - a; i.data("unresize") || d.resizeStart || (d.allowResize = i.width() - l <= 10, o.css("cursor", d.allowResize ? "col-resize" : "")) }).on("mouseleave", function () { t(this); d.resizeStart || o.css("cursor", "") }).on("mousedown", function (e) { var l = t(this); if (d.allowResize) { var n = l.data("key"); e.preventDefault(), d.resizeStart = !0, d.offset = [e.clientX, e.clientY], i.getCssRule(n, function (e) { var t = e.style.width || l.outerWidth(); d.rule = e, d.ruleWidth = parseFloat(t), d.minWidth = l.data("minwidth") || a.cellMinWidth }) } }), F.on("mousemove", function (t) { if (d.resizeStart) { if (t.preventDefault(), d.rule) { var a = d.ruleWidth + t.clientX - d.offset[0]; a < d.minWidth && (a = d.minWidth), d.rule.style.width = a + "px", l.close(i.tipsIndex) } e = 1 } }).on("mouseup", function (t) { d.resizeStart && (d = {}, o.css("cursor", ""), i.scrollPatch()), 2 === e && (e = null) }), s.on("click", function (a) { var l, n = t(this), o = n.find(S), r = o.attr("lay-sort"); return o[0] && 1 !== e ? (l = "asc" === r ? "desc" : "desc" === r ? null : "asc", void i.sort(n, l, null, !0)) : e = 2 }).find(S + " .layui-edge ").on("click", function (e) { var a = t(this), l = a.index(), n = a.parents("th").
|
||
|
var a = t(this), l = a.parents("tr").eq(0).data("index"), n = i.layBody.find('tr[data-index="' + l + '"]'), o = c.cache[i.key] || []; return o = o[l] || {}, t.extend({
|
||
|
tr: n, data: c.clearCacheKey(o), del: function () { c.cache[i.key][l] = [], n.remove(), i.scrollPatch() },
|
||
|
update: function (e) {
|
||
|
e = e || {}, layui.each(e, function (e, t) {
|
||
|
if (e in o) {
|
||
|
var a, l = n.children('td[data-field="' + e + '"]'); o[e] = t, i.eachCols(function (t, i) {
|
||
|
i.field == e && i.templet && (a = i.templet)
|
||
|
}), l.children(h).html(
|
||
|
u(i, t, o)), l.data("content", t)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}, e)
|
||
|
}; i.elem.on("click", 'input[name="layTableCheckbox"]+', function () { var e = t(this).prev(), a = i.layBody.find('input[name="layTableCheckbox"]'), l = e.parents("tr").eq(0).data("index"), n = e[0].checked, o = "layTableAllChoose" === e.attr("lay-filter"); o ? (a.each(function (e, t) { t.checked = n, i.setCheckData(e, n) }), i.syncCheckAll(), i.renderForm("checkbox")) : (i.setCheckData(l, n), i.syncCheckAll()), layui.event.call(e[0], y, "checkbox(" + p + ")", v.call(e[0], { checked: n, type: o ? "all" : "one" })) }), i.elem.on("click", 'input[lay-type="layTableRadio"]+', function () { var e = t(this).prev(), l = e[0].checked, n = c.cache[i.key], o = e.parents("tr").eq(0).data("index"); layui.each(n, function (e, t) { o === e ? t[a.checkName] = !0 : delete t[a.checkName] }), i.setThisRowChecked(o), layui.event.call(this, y, "radio(" + p + ")", v.call(this, { checked: l })) }), i.layBody.on("mouseenter", "tr", function () { var e = t(this), a = e.index(); e.data("off") || i.layBody.find("tr:eq(" + a + ")").addClass(_) }).on("mouseleave", "tr", function () { var e = t(this), a = e.index(); e.data("off") || i.layBody.find("tr:eq(" + a + ")").removeClass(_) }).on("click", "tr", function () { m.call(this, "row") }).on("dblclick", "tr", function () { m.call(this, "rowDouble") }); var m = function (e) { var i = t(this); i.data("off") || layui.event.call(this, y, e + "(" + p + ")", v.call(i.children("td")[0])) }; i.layBody.on("change", "." + R, function () { var e = t(this), a = this.value, l = e.parent().data("field"), n = e.parents("tr").eq(0).data("index"), o = c.cache[i.key][n]; o[l] = a, layui.event.call(this, y, "edit(" + p + ")", v.call(this, { value: a, field: l })) }).on("blur", "." + R, function () { var e, a = t(this), l = this, n = a.parent().data("field"), o = a.parents("tr").eq(0).data("index"), r = c.cache[i.key][o]; i.eachCols(function (t, i) { i.field == n && i.templet && (e = i.templet) }), a.siblings(h).html(function (t) { return u({ templet: e }, t, r) }(l.value)), a.parent().data("content", l.value), a.remove() }), i.layBody.on("click", "td", function (e) { var i = t(this), a = (i.data("field"), i.data("edit")), l = i.children(h); if (!i.data("off") && a) { var n = t('<input class="layui-input ' + R + '">'); return n[0].value = i.data("content") || l.text(), i.find("." + R)[0] || i.append(n), n.focus(), void layui.stope(e) } }).on("mouseenter", "td", function () { b.call(this) }).on("mouseleave", "td", function () { b.call(this, "hide") }); var g = "layui-table-grid-down", b = function (e) { var i = t(this), a = i.children(h); if (!i.data("off")) if (e) i.find(".layui-table-grid-down").remove(); else if (a.prop("scrollWidth") > a.outerWidth()) { if (a.find("." + g)[0]) return; i.append('<div class="' + g + '"><i class="layui-icon layui-icon-down"></i></div>') } }; i.layBody.on("click", "." + g, function (e) { var n = t(this), o = n.parent(), c = o.children(h); i.tipsIndex = l.tips(['<div class="layui-table-tips-main" style="margin-top: -' + (c.height() + 16) + "px;" + function () { return "sm" === a.size ? "padding: 4px 15px; font-size: 12px;" : "lg" === a.size ? "padding: 14px 15px;" : "" }() + '">', c.html(), "</div>", '<i class="layui-icon layui-table-tips-c layui-icon-close"></i>'].join(""), c[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: r.ios || r.android ? 300 : i.elem.width() / 2, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", function () { l.close(t) }) } }), layui.stope(e) }), i.layBody.on("click", "*[lay-event]", function () { var e = t(this), a = e.parents("tr").eq(0).data("index"); layui.event.call(this, y, "tool(" + p + ")", v.call(this, { event: e.attr("lay-event") })), i.setThisRowChecked(a) }), i.layMain.on("scroll", function () { var e = t(this), a = e.scrollLeft(), n = e.scrollTop(); i.layHeader.scrollLeft(a), i.layTotal.scrollLeft(a), i.layFixed.find(k).scrollTop(n), l.close(i.tipsIndex) }), j.on("resize", function () { i.resize() })
|
||
|
}, function () { F.on("click", function () { F.trigger("table.remove.tool.panel") }), F.on("table.remove.tool.panel", function () { t(".layui-table-tool-panel").remove() }) }(), c.init = function (e, i) { i = i || {}; var a = this, l = t(e ? 'table[lay-filter="' + e + '"]' : h + "[lay-data]"), n = "Table element property lay-data configuration item has a syntax error: "; return l.each(function () { var a = t(this), l = a.attr("lay-data"); try { l = new Function("return " + l)() } catch (r) { o.error(n + l, "error") } var d = [], s = t.extend({ elem: this, cols: [], data: [], skin: a.attr("lay-skin"), size: a.attr("lay-size"), even: "string" == typeof a.attr("lay-even") }, c.config, i, l); e && a.hide(), a.find("thead>tr").each(function (e) { s.cols[e] = [], t(this).children().each(function (i) { var a = t(this), l = a.attr("lay-data"); try { l = new Function("return " + l)() } catch (r) { return o.error(n + l) } var c = t.extend({ title: a.text(), colspan: a.attr("colspan") || 0, rowspan: a.attr("rowspan") || 0 }, l); c.colspan < 2 && d.push(c), s.cols[e].push(c) }) }), a.find("tbody>tr").each(function (e) { var i = t(this), a = {}; i.children("td").each(function (e, i) { var l = t(this), n = l.data("field"); if (n) return a[n] = l.html() }), layui.each(d, function (e, t) { var l = i.children("td").eq(e); a[t.field] = l.html() }), s.data[e] = a }), c.render(s) }), a }, d.that = {}, d.config = {}, c.eachCols = function (e, i, a) { var l = d.config[e] || {}, n = [], o = 0; a = t.extend(!0, [], a || l.cols), layui.each(a, function (e, t) { layui.each(t, function (t, i) { if (i.colGroup) { var l = 0; o++, i.CHILD_COLS = [], layui.each(a[e + 1], function (e, t) { t.PARENT_COL_INDEX || l > 1 && l == i.colspan || (t.PARENT_COL_INDEX = o, i.CHILD_COLS.push(t), l += parseInt(t.colspan > 1 ? t.colspan : 1)) }) } i.PARENT_COL_INDEX || n.push(i) }) }); var r = function (e) { layui.each(e || n, function (e, t) { return t.CHILD_COLS ? r(t.CHILD_COLS) : void ("function" == typeof i && i(e, t)) }) }; r() }, c.checkStatus = function (e) { var t = 0, i = 0, a = [], l = c.cache[e] || []; return layui.each(l, function (e, l) { return l.constructor === Array ? void i++ : void (l[c.config.checkName] && (t++, a.push(c.clearCacheKey(l)))) }), { data: a, isAll: !!l.length && t === l.length - i } }, c.getData = function (e) { var t = [], i = c.cache[e] || []; return layui.each(i, function (e, i) { i.constructor !== Array && t.push(c.clearCacheKey(i)) }), t }, c.exportFile = function (e, t, i) { var a = this; t = t || c.clearCacheKey(c.cache[e]), i = i || "csv"; var l = d.config[e] || {}, n = { csv: "text/csv", xls: "application/vnd.ms-excel" }[i], s = document.createElement("a"); return r.ie ? o.error("IE_NOT_SUPPORT_EXPORTS") : (s.href = "data:" + n + ";charset=utf-8,\ufeff" + encodeURIComponent(function () { var i = [], l = [], n = []; return layui.each(t, function (t, a) { var n = []; "object" == typeof e ? (layui.each(e, function (e, a) { 0 == t && i.push(a || "") }), layui.each(c.clearCacheKey(a), function (e, t) { n.push('"' + (t || "") + '"') })) : c.eachCols(e, function (e, l) { if (l.field && "normal" == l.type && !l.hide) { var o = a[l.field]; var title = l.title; title = title || ""; title = title.replace(/<\/?[^>]*>/g, ""); title = title.replace(/[|]*\n/, ""); title = title.replace(/ /ig, ""); void 0 !== o && null !== o || (o = ""), 0 == t && i.push(title || ""), n.push('"' + u(l, o, a, "text") + '"') } }), l.push(n.join(",")) }), layui.each(a.dataTotal, function (e, t) { n.push(t) }), i.join(",") + "\r\n" + l.join("\r\n") + "\r\n" + n.join(",") }()), s.download = (l.title || "table_" + (l.index || "")) + "." + i, document.body.appendChild(s), s.click(), void document.body.removeChild(s)) }, c.resize = function (e) { if (e) { var t = s(e); if (!t) return; d.that[e].resize() } else layui.each(d.that, function () { this.resize() }) }, c.reload = function (e, t, i) { var a = s(e); if (a) { var l = d.that[e]; return l.reload(t, i), d.call(l) } }, c.render = function (e) {
|
||
|
var t=new I(e);return d.call(t)},c.clearCacheKey=function(e){return e=t.extend({},e),delete e[c.config.checkName],delete e[c.config.indexName],e},t(function(){c.init()}),e(y,c)});layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});layui.define("jquery",function(e){"use strict";var a=layui.jquery,l={config:{},index:layui.rate?layui.rate.index+
|