table.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. /** layui-v2.5.7 MIT License */
  2. ;layui.define(["laytpl", "laypage", "layer", "form", "util"], function (e) {
  3. "use strict";
  4. var t = layui.$, i = layui.laytpl, a = layui.laypage, l = layui.layer, n = layui.form,
  5. o = (layui.util, layui.hint()), r = layui.device(), d = {
  6. config: {checkName: "LAY_CHECKED", indexName: "LAY_TABLE_INDEX"},
  7. cache: {},
  8. index: layui.table ? layui.table.index + 1e4 : 0,
  9. set: function (e) {
  10. var i = this;
  11. return i.config = t.extend({}, i.config, e), i
  12. },
  13. on: function (e, t) {
  14. return layui.onevent.call(this, y, e, t)
  15. }
  16. }, c = function () {
  17. var e = this, t = e.config, i = t.id || t.index;
  18. return i && (c.that[i] = e, c.config[i] = t), {
  19. config: t, reload: function (t) {
  20. e.reload.call(e, t)
  21. }, setColsWidth: function () {
  22. e.setColsWidth.call(e)
  23. }, resize: function () {
  24. e.resize.call(e)
  25. }
  26. }
  27. }, s = function (e) {
  28. var t = c.config[e];
  29. return t || o.error("The ID option was not found in the table instance"), t || null
  30. }, u = function (e, a, l, n) {
  31. var o = e.templet ? function () {
  32. return "function" == typeof e.templet ? e.templet(l) : i(t(e.templet).html() || String(a)).render(l)
  33. }() : a;
  34. return n ? t("<div>" + o + "</div>").text() : o
  35. }, y = "table", h = ".layui-table", f = "layui-hide", p = "layui-none", v = "layui-table-view",
  36. m = ".layui-table-tool", g = ".layui-table-box", b = ".layui-table-init", x = ".layui-table-header",
  37. k = ".layui-table-body", C = ".layui-table-main", w = ".layui-table-fixed", T = ".layui-table-fixed-l",
  38. A = ".layui-table-fixed-r", L = ".layui-table-total", N = ".layui-table-page", S = ".layui-table-sort",
  39. R = "layui-table-edit", W = "layui-table-hover", _ = function (e) {
  40. var t = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}';
  41. 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 () {
  42. return e.fixed && "right" !== e.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === e.fixed ? '{{# if(item2.fixed === "right"){ }}' : ""
  43. }(), "{{# 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="升序"></i><i class="layui-edge layui-table-sort-desc" title="降序"></i></span>', "{{# } }}", "{{# } }}", "</div>", "</th>", e.fixed ? "{{# }; }}" : "", "{{# }); }}", "</tr>", "{{# }); }}", "</thead>", "</table>"].join("")
  44. },
  45. 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{{# } }}>', "<tbody></tbody>", "</table>"].join(""),
  46. z = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" 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">', _(), "</div>", '<div class="layui-table-body layui-table-main">', E, "</div>", "{{# if(left){ }}", '<div class="layui-table-fixed layui-table-fixed-l">', '<div class="layui-table-header">', _({fixed: !0}), "</div>", '<div class="layui-table-body">', E, "</div>", "</div>", "{{# }; }}", "{{# if(right){ }}", '<div class="layui-table-fixed layui-table-fixed-r">', '<div class="layui-table-header">', _({fixed: "right"}), '<div class="layui-table-mend"></div>', "</div>", '<div class="layui-table-body">', E, "</div>", "</div>", "{{# }; }}", "</div>", "{{# if(d.data.totalRow){ }}", '<div class="layui-table-total">', '<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><tr><td><div class="layui-table-cell" style="visibility: hidden;">Total</div></td></tr></tbody>', "</table>", "</div>", "{{# } }}", "{{# if(d.data.page){ }}", '<div class="layui-table-page">', '<div id="layui-table-page{{d.index}}"></div>', "</div>", "{{# } }}", "<style>", "{{# layui.each(d.data.cols, function(i1, item1){", "layui.each(item1, function(i2, item2){ }}", ".laytable-cell-{{d.index}}-{{i1}}-{{i2}}{ ", "{{# if(item2.width){ }}", "width: {{item2.width}}px;", "{{# } }}", " }", "{{# });", "}); }}", "</style>", "</div>"].join(""),
  47. H = t(window), j = t(document), F = function (e) {
  48. var i = this;
  49. i.index = ++d.index, i.config = t.extend({}, i.config, d.config, e), i.render()
  50. };
  51. F.prototype.config = {
  52. limit: 10,
  53. loading: !0,
  54. cellMinWidth: 60,
  55. defaultToolbar: ["filter", "exports", "print"],
  56. autoSort: !0,
  57. text: {none: "无数据"}
  58. }, F.prototype.render = function () {
  59. var e = this, a = e.config;
  60. if (a.elem = t(a.elem), a.where = a.where || {}, a.id = a.id || a.elem.attr("id") || e.index, a.request = t.extend({
  61. pageName: "page",
  62. limitName: "limit"
  63. }, a.request), a.response = t.extend({
  64. statusName: "code",
  65. statusCode: 0,
  66. msgName: "msg",
  67. dataName: "data",
  68. totalRowName: "totalRow",
  69. countName: "count"
  70. }, a.response), "object" == typeof a.page && (a.limit = a.page.limit || a.limit, a.limits = a.page.limits || a.limits, e.page = a.page.curr = a.page.curr || 1, delete a.page.elem, delete a.page.jump), !a.elem[0]) return e;
  71. a.height && /^full-\d+$/.test(a.height) && (e.fullHeightGap = a.height.split("-")[1], a.height = H.height() - e.fullHeightGap), e.setInit();
  72. var l = a.elem, n = l.next("." + v), o = e.elem = t(i(z).render({VIEW_CLASS: v, data: a, index: e.index}));
  73. if (a.index = e.index, e.key = a.id || a.index, n[0] && n.remove(), l.after(o), e.layTool = o.find(m), e.layBox = o.find(g), e.layHeader = o.find(x), e.layMain = o.find(C), e.layBody = o.find(k), e.layFixed = o.find(w), e.layFixLeft = o.find(T), e.layFixRight = o.find(A), e.layTotal = o.find(L), e.layPage = o.find(N), e.renderToolbar(), e.fullSize(), a.cols.length > 1) {
  74. var r = e.layFixed.find(x).find("th");
  75. r.height(e.layHeader.height() - 1 - parseFloat(r.css("padding-top")) - parseFloat(r.css("padding-bottom")))
  76. }
  77. e.pullData(e.page), e.events()
  78. }, F.prototype.initOpts = function (e) {
  79. var t = this, i = (t.config, {checkbox: 48, radio: 48, space: 15, numbers: 40});
  80. e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || i[e.type])
  81. }, F.prototype.setInit = function (e) {
  82. var t = this, i = t.config;
  83. return i.clientWidth = i.width || function () {
  84. var e = function (t) {
  85. var a, l;
  86. t = t || i.elem.parent(), a = t.width();
  87. try {
  88. l = "none" === t.css("display")
  89. } catch (n) {
  90. }
  91. return !t[0] || a && !l ? a : e(t.parent())
  92. };
  93. return e()
  94. }(), "width" === e ? i.clientWidth : void layui.each(i.cols, function (e, a) {
  95. layui.each(a, function (l, n) {
  96. if (!n) return void a.splice(l, 1);
  97. if (n.key = e + "-" + l, n.hide = n.hide || !1, n.colGroup || n.colspan > 1) {
  98. var o = 0;
  99. layui.each(i.cols[e + 1], function (t, i) {
  100. i.HAS_PARENT || o > 1 && o == n.colspan || (i.HAS_PARENT = !0, i.parentKey = e + "-" + l, o += parseInt(i.colspan > 1 ? i.colspan : 1))
  101. }), n.colGroup = !0
  102. }
  103. t.initOpts(n)
  104. })
  105. })
  106. }, F.prototype.renderToolbar = function () {
  107. var e = this, a = e.config,
  108. l = ['<div class="layui-inline" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></div>', '<div class="layui-inline" lay-event="update"><i class="layui-icon layui-icon-edit"></i></div>', '<div class="layui-inline" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>'].join(""),
  109. n = e.layTool.find(".layui-table-tool-temp");
  110. if ("default" === a.toolbar) n.html(l); else if ("string" == typeof a.toolbar) {
  111. var o = t(a.toolbar).html() || "";
  112. o && n.html(i(o).render(a))
  113. }
  114. var r = {
  115. filter: {title: "筛选列", layEvent: "LAYTABLE_COLS", icon: "layui-icon-cols"},
  116. exports: {title: "导出", layEvent: "LAYTABLE_EXPORT", icon: "layui-icon-export"},
  117. print: {title: "打印", layEvent: "LAYTABLE_PRINT", icon: "layui-icon-print"}
  118. }, d = [];
  119. "object" == typeof a.defaultToolbar && layui.each(a.defaultToolbar, function (e, t) {
  120. var i = "string" == typeof t ? r[t] : t;
  121. i && d.push('<div class="layui-inline" title="' + i.title + '" lay-event="' + i.layEvent + '"><i class="layui-icon ' + i.icon + '"></i></div>')
  122. }), e.layTool.find(".layui-table-tool-self").html(d.join(""))
  123. }, F.prototype.setParentCol = function (e, t) {
  124. var i = this, a = i.config, l = i.layHeader.find('th[data-key="' + a.index + "-" + t + '"]'),
  125. n = parseInt(l.attr("colspan")) || 0;
  126. if (l[0]) {
  127. var o = t.split("-"), r = a.cols[o[0]][o[1]];
  128. e ? n-- : n++, l.attr("colspan", n), l[n < 1 ? "addClass" : "removeClass"](f), r.colspan = n, r.hide = n < 1;
  129. var d = l.data("parentkey");
  130. d && i.setParentCol(e, d)
  131. }
  132. }, F.prototype.setColsPatch = function () {
  133. var e = this, t = e.config;
  134. layui.each(t.cols, function (t, i) {
  135. layui.each(i, function (t, i) {
  136. i.hide && e.setParentCol(i.hide, i.parentKey)
  137. })
  138. })
  139. }, F.prototype.setColsWidth = function () {
  140. var e = this, t = e.config, i = 0, a = 0, l = 0, n = 0, o = e.setInit("width");
  141. e.eachCols(function (e, t) {
  142. t.hide || i++
  143. }), o = o - function () {
  144. return "line" === t.skin || "nob" === t.skin ? 2 : i + 1
  145. }() - e.getScrollWidth(e.layMain[0]) - 1;
  146. var r = function (e) {
  147. layui.each(t.cols, function (i, r) {
  148. layui.each(r, function (i, d) {
  149. var c = 0, s = d.minWidth || t.cellMinWidth;
  150. return d ? void (d.colGroup || d.hide || (e ? l && l < s && (a--, c = s) : (c = d.width || 0, /\d+%$/.test(c) ? (c = Math.floor(parseFloat(c) / 100 * o), c < s && (c = s)) : c || (d.width = c = 0, a++)), d.hide && (c = 0), n += c)) : void r.splice(i, 1)
  151. })
  152. }), o > n && a && (l = (o - n) / a)
  153. };
  154. r(), r(!0), e.autoColNums = a, e.eachCols(function (i, a) {
  155. var n = a.minWidth || t.cellMinWidth;
  156. a.colGroup || a.hide || (0 === a.width ? e.getCssRule(t.index + "-" + a.key, function (e) {
  157. e.style.width = Math.floor(l >= n ? l : n) + "px"
  158. }) : /\d+%$/.test(a.width) && e.getCssRule(t.index + "-" + a.key, function (e) {
  159. e.style.width = Math.floor(parseFloat(a.width) / 100 * o) + "px"
  160. }))
  161. });
  162. var d = e.layMain.width() - e.getScrollWidth(e.layMain[0]) - e.layMain.children("table").outerWidth();
  163. if (e.autoColNums && d >= -i && d <= i) {
  164. var c = function (t) {
  165. var i;
  166. return t = t || e.layHeader.eq(0).find("thead th:last-child"), i = t.data("field"), !i && t.prev()[0] ? c(t.prev()) : t
  167. }, s = c(), u = s.data("key");
  168. e.getCssRule(u, function (t) {
  169. var i = t.style.width || s.outerWidth();
  170. t.style.width = parseFloat(i) + d + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px")
  171. })
  172. }
  173. e.loading(!0)
  174. }, F.prototype.resize = function () {
  175. var e = this;
  176. e.fullSize(), e.setColsWidth(), e.scrollPatch()
  177. }, F.prototype.reload = function (e) {
  178. var i = this;
  179. e = e || {}, delete i.haveInit, e.data && e.data.constructor === Array && delete i.config.data, i.config = t.extend(!0, {}, i.config, e), i.render()
  180. }, F.prototype.errorView = function (e) {
  181. var i = this, a = i.layMain.find("." + p), l = t('<div class="' + p + '">' + (e || "Error") + "</div>");
  182. a[0] && (i.layNone.remove(), a.remove()), i.layFixed.addClass(f), i.layMain.find("tbody").html(""), i.layMain.append(i.layNone = l), d.cache[i.key] = []
  183. }, F.prototype.page = 1, F.prototype.pullData = function (e) {
  184. var i = this, a = i.config, l = a.request, n = a.response, o = function () {
  185. "object" == typeof a.initSort && i.sort(a.initSort.field, a.initSort.type)
  186. };
  187. if (i.startTime = (new Date).getTime(), a.url) {
  188. var r = {};
  189. r[l.pageName] = e, r[l.limitName] = a.limit;
  190. var d = t.extend(r, a.where);
  191. a.contentType && 0 == a.contentType.indexOf("application/json") && (d = JSON.stringify(d)), i.loading(), t.ajax({
  192. type: a.method || "get",
  193. url: a.url,
  194. contentType: a.contentType,
  195. data: d,
  196. dataType: "json",
  197. headers: a.headers || {},
  198. success: function (t) {
  199. "function" == typeof a.parseData && (t = a.parseData(t) || t), t[n.statusName] != n.statusCode ? (i.renderForm(), i.errorView(t[n.msgName] || '返回的数据不符合规范,正确的成功状态码应为:"' + n.statusName + '": ' + n.statusCode)) : (i.renderData(t, e, t[n.countName]), o(), a.time = (new Date).getTime() - i.startTime + " ms"), i.setColsWidth(), "function" == typeof a.done && a.done(t, e, t[n.countName])
  200. },
  201. error: function (e, t) {
  202. i.errorView("数据接口请求异常:" + t), i.renderForm(), i.setColsWidth()
  203. }
  204. })
  205. } else if (a.data && a.data.constructor === Array) {
  206. var c = {}, s = e * a.limit - a.limit;
  207. c[n.dataName] = a.data.concat().splice(s, a.limit), c[n.countName] = a.data.length, "object" == typeof a.totalRow && (c[n.totalRowName] = t.extend({}, a.totalRow)), i.renderData(c, e, c[n.countName]), o(), i.setColsWidth(), "function" == typeof a.done && a.done(c, e, c[n.countName])
  208. }
  209. }, F.prototype.eachCols = function (e) {
  210. var t = this;
  211. return d.eachCols(null, e, t.config.cols), t
  212. }, F.prototype.renderData = function (e, n, o, r) {
  213. var c = this, s = c.config, y = e[s.response.dataName] || [], h = e[s.response.totalRowName], v = [], m = [],
  214. g = [], b = function () {
  215. var e;
  216. return !r && c.sortKey ? c.sort(c.sortKey.field, c.sortKey.sort, !0) : (layui.each(y, function (a, l) {
  217. var o = [], y = [], h = [], p = a + s.limit * (n - 1) + 1;
  218. 0 !== l.length && (r || (l[d.config.indexName] = a), c.eachCols(function (n, r) {
  219. var c = r.field || n, v = s.index + "-" + r.key, m = l[c];
  220. if (void 0 !== m && null !== m || (m = ""), !r.colGroup) {
  221. var g = ['<td data-field="' + c + '" data-key="' + v + '" ' + function () {
  222. var e = [];
  223. return r.edit && e.push('data-edit="' + r.edit + '"'), r.align && e.push('align="' + r.align + '"'), r.templet && e.push('data-content="' + 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(" ")
  224. }() + ' class="' + function () {
  225. var e = [];
  226. return r.hide && e.push(f), r.field || e.push("layui-table-col-special"), e.join(" ")
  227. }() + '">', '<div class="layui-table-cell laytable-cell-' + function () {
  228. return "normal" === r.type ? v : v + " laytable-cell-" + r.type
  229. }() + '">' + function () {
  230. var n = t.extend(!0, {LAY_INDEX: p}, l), o = d.config.checkName;
  231. switch (r.type) {
  232. case"checkbox":
  233. return '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" ' + function () {
  234. return r[o] ? (l[o] = r[o], r[o] ? "checked" : "") : n[o] ? "checked" : ""
  235. }() + ">";
  236. case"radio":
  237. return n[o] && (e = a), '<input type="radio" name="layTableRadio_' + s.index + '" ' + (n[o] ? "checked" : "") + ' lay-type="layTableRadio">';
  238. case"numbers":
  239. return p
  240. }
  241. return r.toolbar ? i(t(r.toolbar).html() || "").render(n) : u(r, m, n)
  242. }(), "</div></td>"].join("");
  243. o.push(g), r.fixed && "right" !== r.fixed && y.push(g), "right" === r.fixed && h.push(g)
  244. }
  245. }), 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>"))
  246. }), c.layBody.scrollTop(0), c.layMain.find("." + p).remove(), c.layMain.find("tbody").html(v.join("")), c.layFixLeft.find("tbody").html(m.join("")), c.layFixRight.find("tbody").html(g.join("")), c.renderForm(), "number" == typeof e && c.setThisRowChecked(e), c.syncCheckAll(), c.haveInit ? c.scrollPatch() : setTimeout(function () {
  247. c.scrollPatch()
  248. }, 50), c.haveInit = !0, l.close(c.tipsIndex), s.HAS_SET_COLS_PATCH || c.setColsPatch(), void (s.HAS_SET_COLS_PATCH = !0))
  249. };
  250. return d.cache[c.key] = y, c.layPage[0 == o || 0 === y.length && 1 == n ? "addClass" : "removeClass"](f), 0 === y.length ? (c.renderForm(), c.errorView(s.text.none)) : (c.layFixed.removeClass(f), r ? b() : (b(), c.renderTotal(y, h), void (s.page && (s.page = t.extend({
  251. elem: "layui-table-page" + s.index,
  252. count: o,
  253. limit: s.limit,
  254. limits: s.limits || [10, 20, 30, 40, 50, 60, 70, 80, 90],
  255. groups: 3,
  256. layout: ["prev", "page", "next", "skip", "count", "limit"],
  257. prev: '<i class="layui-icon">&#xe603;</i>',
  258. next: '<i class="layui-icon">&#xe602;</i>',
  259. jump: function (e, t) {
  260. t || (c.page = e.curr, s.limit = e.limit, c.pullData(e.curr))
  261. }
  262. }, s.page), s.page.count = o, a.render(s.page)))))
  263. }, F.prototype.renderTotal = function (e, t) {
  264. var i = this, a = i.config, l = {};
  265. if (a.totalRow) {
  266. layui.each(e, function (e, t) {
  267. 0 !== t.length && i.eachCols(function (e, i) {
  268. var a = i.field || e, n = t[a];
  269. i.totalRow && (l[a] = (l[a] || 0) + (parseFloat(n) || 0))
  270. })
  271. }), i.dataTotal = {};
  272. var n = [];
  273. i.eachCols(function (e, o) {
  274. var r = o.field || e, d = function () {
  275. var e = o.totalRowText || "", /*i = parseFloat(l[r]).toFixed(2)*/i, a = {};
  276. if(parseInt(l[r]) == l[r]){ //是否是整数
  277. i = parseFloat(l[r]).toFixed(0);
  278. }else{
  279. i = parseFloat(l[r]).toFixed(2);
  280. }
  281. return a[r] = i, i = u(o, i, a), t ? t[o.field] || e : o.totalRow ? i || e : e
  282. }(), c = ['<td data-field="' + r + '" data-key="' + a.index + "-" + o.key + '" ' + function () {
  283. var e = [];
  284. return o.align && e.push('align="' + o.align + '"'), o.style && e.push('style="' + o.style + '"'), o.minWidth && e.push('data-minwidth="' + o.minWidth + '"'), e.join(" ")
  285. }() + ' class="' + function () {
  286. var e = [];
  287. return o.hide && e.push(f), o.field || e.push("layui-table-col-special"), e.join(" ")
  288. }() + '">', '<div class="layui-table-cell laytable-cell-' + function () {
  289. var e = a.index + "-" + o.key;
  290. return "normal" === o.type ? e : e + " laytable-cell-" + o.type
  291. }() + '">' + d, "</div></td>"].join("");
  292. o.field && (i.dataTotal[r] = d), n.push(c)
  293. }), i.layTotal.find("tbody").html("<tr>" + n.join("") + "</tr>")
  294. }
  295. }, F.prototype.getColElem = function (e, t) {
  296. var i = this, a = i.config;
  297. return e.eq(0).find(".laytable-cell-" + (a.index + "-" + t) + ":eq(0)")
  298. }, F.prototype.renderForm = function (e) {
  299. n.render(e, "LAY-table-" + this.index)
  300. }, F.prototype.setThisRowChecked = function (e) {
  301. var t = this, i = (t.config, "layui-table-click"), a = t.layBody.find('tr[data-index="' + e + '"]');
  302. a.addClass(i).siblings("tr").removeClass(i)
  303. }, F.prototype.sort = function (e, i, a, l) {
  304. var n, r, c = this, s = {}, u = c.config, h = u.elem.attr("lay-filter"), f = d.cache[c.key];
  305. "string" == typeof e && c.layHeader.find("th").each(function (i, a) {
  306. var l = t(this), o = l.data("field");
  307. if (o === e) return e = l, n = o, !1
  308. });
  309. try {
  310. var n = n || e.data("field"), p = e.data("key");
  311. if (c.sortKey && !a && n === c.sortKey.field && i === c.sortKey.sort) return;
  312. var v = c.layHeader.find("th .laytable-cell-" + p).find(S);
  313. c.layHeader.find("th").find(S).removeAttr("lay-sort"), v.attr("lay-sort", i || null), c.layFixed.find("th")
  314. } catch (m) {
  315. return o.error("Table modules: Did not match to field")
  316. }
  317. c.sortKey = {
  318. field: n,
  319. sort: i
  320. }, u.autoSort && ("asc" === i ? r = layui.sort(f, n) : "desc" === i ? r = layui.sort(f, n, !0) : (r = layui.sort(f, d.config.indexName), delete c.sortKey)), s[u.response.dataName] = r || f, c.renderData(s, c.page, c.count, !0), l && layui.event.call(e, y, "sort(" + h + ")", {
  321. field: n,
  322. type: i
  323. })
  324. }, F.prototype.loading = function (e) {
  325. var i = this, a = i.config;
  326. 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)))
  327. }, F.prototype.setCheckData = function (e, t) {
  328. var i = this, a = i.config, l = d.cache[i.key];
  329. l[e] && l[e].constructor !== Array && (l[e][a.checkName] = t)
  330. }, F.prototype.syncCheckAll = function () {
  331. var e = this, t = e.config, i = e.layHeader.find('input[name="layTableCheckbox"]'), a = function (i) {
  332. return e.eachCols(function (e, a) {
  333. "checkbox" === a.type && (a[t.checkName] = i)
  334. }), i
  335. };
  336. i[0] && (d.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)))
  337. }, F.prototype.getCssRule = function (e, t) {
  338. var i = this, a = i.elem.find("style")[0], l = a.sheet || a.styleSheet || {}, n = l.cssRules || l.rules;
  339. layui.each(n, function (i, a) {
  340. if (a.selectorText === ".laytable-cell-" + e) return t(a), !0
  341. })
  342. }, F.prototype.fullSize = function () {
  343. var e, t = this, i = t.config, a = i.height;
  344. t.fullHeightGap && (a = H.height() - t.fullHeightGap, a < 135 && (a = 135), t.elem.css("height", a)), a && (e = parseFloat(a) - (t.layHeader.outerHeight() || 38), i.toolbar && (e -= t.layTool.outerHeight() || 50), i.totalRow && (e -= t.layTotal.outerHeight() || 40), i.page && (e -= t.layPage.outerHeight() || 41), t.layMain.css("height", e - 2))
  345. }, F.prototype.getScrollWidth = function (e) {
  346. var t = 0;
  347. return e ? t = e.offsetWidth - e.clientWidth : (e = document.createElement("div"), e.style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t
  348. }, F.prototype.scrollPatch = function () {
  349. var e = this, i = e.layMain.children("table"), a = e.layMain.width() - e.layMain.prop("clientWidth"),
  350. l = e.layMain.height() - e.layMain.prop("clientHeight"),
  351. n = (e.getScrollWidth(e.layMain[0]), i.outerWidth() - e.layMain.width()), o = function (e) {
  352. if (a && l) {
  353. if (e = e.eq(0), !e.find(".layui-table-patch")[0]) {
  354. var i = t('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>');
  355. i.find("div").css({width: a}), e.find("tr").append(i)
  356. }
  357. } else e.find(".layui-table-patch").remove()
  358. };
  359. o(e.layHeader), o(e.layTotal);
  360. var r = e.layMain.height(), d = r - l;
  361. e.layFixed.find(k).css("height", i.height() >= d ? d : "auto"), e.layFixRight[n > 0 ? "removeClass" : "addClass"](f), e.layFixRight.css("right", a - 1)
  362. }, F.prototype.events = function () {
  363. var e, i = this, a = i.config, o = t("body"), c = {}, s = i.layHeader.find("th"), h = ".layui-table-cell",
  364. p = a.elem.attr("lay-filter");
  365. i.layTool.on("click", "*[lay-event]", function (e) {
  366. var o = t(this), c = o.attr("lay-event"), s = function (e) {
  367. var l = t(e.list), n = t('<ul class="layui-table-tool-panel"></ul>');
  368. 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) {
  369. layui.stope(e)
  370. }), e.done && e.done(n, l)
  371. };
  372. switch (layui.stope(e), j.trigger("table.tool.panel.remove"), l.close(i.tipsIndex), c) {
  373. case"LAYTABLE_COLS":
  374. s({
  375. list: function () {
  376. var e = [];
  377. return i.eachCols(function (t, i) {
  378. 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>')
  379. }), e.join("")
  380. }(), done: function () {
  381. n.on("checkbox(LAY_TABLE_TOOL_COLS)", function (e) {
  382. var l = t(e.elem), n = this.checked, o = l.data("key"), r = l.data("parentkey");
  383. layui.each(a.cols, function (e, t) {
  384. layui.each(t, function (t, l) {
  385. if (e + "-" + t === o) {
  386. var d = l.hide;
  387. l.hide = !n, i.elem.find('*[data-key="' + a.index + "-" + o + '"]')[n ? "removeClass" : "addClass"](f), d != l.hide && i.setParentCol(!n, r), i.resize()
  388. }
  389. })
  390. })
  391. })
  392. }
  393. });
  394. break;
  395. case"LAYTABLE_EXPORT":
  396. r.ie ? l.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出", this, {tips: 3}) : s({
  397. list: function () {
  398. return ['<li data-type="csv">导出到 Csv 文件</li>', '<li data-type="xls">导出到 Excel 文件</li>'].join("")
  399. }(), done: function (e, l) {
  400. l.on("click", function () {
  401. var e = t(this).data("type");
  402. d.exportFile.call(i, a.id, null, e)
  403. })
  404. }
  405. });
  406. break;
  407. case"LAYTABLE_PRINT":
  408. var u = window.open("打印窗口", "_blank"),
  409. 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(""),
  410. v = t(i.layHeader.html());
  411. 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()
  412. }
  413. layui.event.call(this, y, "toolbar(" + p + ")", t.extend({event: c, config: a}, {}))
  414. }), s.on("mousemove", function (e) {
  415. var i = t(this), a = i.offset().left, l = e.clientX - a;
  416. i.data("unresize") || c.resizeStart || (c.allowResize = i.width() - l <= 10, o.css("cursor", c.allowResize ? "col-resize" : ""))
  417. }).on("mouseleave", function () {
  418. t(this);
  419. c.resizeStart || o.css("cursor", "")
  420. }).on("mousedown", function (e) {
  421. var l = t(this);
  422. if (c.allowResize) {
  423. var n = l.data("key");
  424. e.preventDefault(), c.resizeStart = !0, c.offset = [e.clientX, e.clientY], i.getCssRule(n, function (e) {
  425. var t = e.style.width || l.outerWidth();
  426. c.rule = e, c.ruleWidth = parseFloat(t), c.minWidth = l.data("minwidth") || a.cellMinWidth
  427. })
  428. }
  429. }), j.on("mousemove", function (t) {
  430. if (c.resizeStart) {
  431. if (t.preventDefault(), c.rule) {
  432. var a = c.ruleWidth + t.clientX - c.offset[0];
  433. a < c.minWidth && (a = c.minWidth), c.rule.style.width = a + "px", l.close(i.tipsIndex)
  434. }
  435. e = 1
  436. }
  437. }).on("mouseup", function (t) {
  438. c.resizeStart && (c = {}, o.css("cursor", ""), i.scrollPatch()), 2 === e && (e = null)
  439. }), s.on("click", function (a) {
  440. var l, n = t(this), o = n.find(S), r = o.attr("lay-sort");
  441. return o[0] && 1 !== e ? (l = "asc" === r ? "desc" : "desc" === r ? null : "asc", void i.sort(n, l, null, !0)) : e = 2
  442. }).find(S + " .layui-edge ").on("click", function (e) {
  443. var a = t(this), l = a.index(), n = a.parents("th").eq(0).data("field");
  444. layui.stope(e), 0 === l ? i.sort(n, "asc", null, !0) : i.sort(n, "desc", null, !0)
  445. });
  446. var v = function (e) {
  447. var a = t(this), l = a.parents("tr").eq(0).data("index"), n = i.layBody.find('tr[data-index="' + l + '"]'),
  448. o = d.cache[i.key] || [];
  449. return o = o[l] || {}, t.extend({
  450. tr: n, data: d.clearCacheKey(o), del: function () {
  451. d.cache[i.key][l] = [], n.remove(), i.scrollPatch()
  452. }, update: function (e) {
  453. e = e || {}, layui.each(e, function (e, t) {
  454. if (e in o) {
  455. var a, l = n.children('td[data-field="' + e + '"]');
  456. o[e] = t, i.eachCols(function (t, i) {
  457. i.field == e && i.templet && (a = i.templet)
  458. }), l.children(h).html(u({templet: a}, t, o)), l.data("content", t)
  459. }
  460. })
  461. }
  462. }, e)
  463. };
  464. i.elem.on("click", 'input[name="layTableCheckbox"]+', function () {
  465. var e = t(this).prev(), a = i.layBody.find('input[name="layTableCheckbox"]'),
  466. l = e.parents("tr").eq(0).data("index"), n = e[0].checked,
  467. o = "layTableAllChoose" === e.attr("lay-filter");
  468. o ? (a.each(function (e, t) {
  469. t.checked = n, i.setCheckData(e, n)
  470. }), i.syncCheckAll(), i.renderForm("checkbox")) : (i.setCheckData(l, n), i.syncCheckAll()), layui.event.call(e[0], y, "checkbox(" + p + ")", v.call(e[0], {
  471. checked: n,
  472. type: o ? "all" : "one"
  473. }))
  474. }), i.elem.on("click", 'input[lay-type="layTableRadio"]+', function () {
  475. var e = t(this).prev(), a = e[0].checked, l = d.cache[i.key], n = e.parents("tr").eq(0).data("index");
  476. layui.each(l, function (e, t) {
  477. n === e ? t.LAY_CHECKED = !0 : delete t.LAY_CHECKED
  478. }), i.setThisRowChecked(n), layui.event.call(this, y, "radio(" + p + ")", v.call(this, {checked: a}))
  479. }), i.layBody.on("mouseenter", "tr", function () {
  480. var e = t(this), a = e.index();
  481. e.data("off") || i.layBody.find("tr:eq(" + a + ")").addClass(W)
  482. }).on("mouseleave", "tr", function () {
  483. var e = t(this), a = e.index();
  484. e.data("off") || i.layBody.find("tr:eq(" + a + ")").removeClass(W)
  485. }).on("click", "tr", function () {
  486. m.call(this, "row")
  487. }).on("dblclick", "tr", function () {
  488. m.call(this, "rowDouble")
  489. });
  490. var m = function (e) {
  491. var i = t(this);
  492. i.data("off") || layui.event.call(this, y, e + "(" + p + ")", v.call(i.children("td")[0]))
  493. };
  494. i.layBody.on("change", "." + R, function () {
  495. var e = t(this), a = this.value, l = e.parent().data("field"), n = e.parents("tr").eq(0).data("index"),
  496. o = d.cache[i.key][n];
  497. o[l] = a, layui.event.call(this, y, "edit(" + p + ")", v.call(this, {value: a, field: l}))
  498. }).on("blur", "." + R, function () {
  499. var e, a = t(this), l = this, n = a.parent().data("field"), o = a.parents("tr").eq(0).data("index"),
  500. r = d.cache[i.key][o];
  501. i.eachCols(function (t, i) {
  502. i.field == n && i.templet && (e = i.templet)
  503. }), a.siblings(h).html(function (t) {
  504. return u({templet: e}, t, r)
  505. }(l.value)), a.parent().data("content", l.value), a.remove()
  506. }), i.layBody.on("click", "td", function (e) {
  507. var i = t(this), a = (i.data("field"), i.data("edit")), l = i.children(h);
  508. if (!i.data("off") && a) {
  509. var n = t('<input class="layui-input ' + R + '">');
  510. return n[0].value = i.data("content") || l.text(), i.find("." + R)[0] || i.append(n), n.focus(), void layui.stope(e)
  511. }
  512. }).on("mouseenter", "td", function () {
  513. b.call(this)
  514. }).on("mouseleave", "td", function () {
  515. b.call(this, "hide")
  516. });
  517. var g = "layui-table-grid-down", b = function (e) {
  518. var i = t(this), a = i.children(h);
  519. if (!i.data("off")) if (e) i.find(".layui-table-grid-down").remove(); else if (a.prop("scrollWidth") > a.outerWidth()) {
  520. if (a.find("." + g)[0]) return;
  521. i.append('<div class="' + g + '"><i class="layui-icon layui-icon-down"></i></div>')
  522. }
  523. };
  524. i.layBody.on("click", "." + g, function (e) {
  525. var n = t(this), o = n.parent(), d = o.children(h);
  526. i.tipsIndex = l.tips(['<div class="layui-table-tips-main" style="margin-top: -' + (d.height() + 16) + "px;" + function () {
  527. return "sm" === a.size ? "padding: 4px 15px; font-size: 12px;" : "lg" === a.size ? "padding: 14px 15px;" : ""
  528. }() + '">', d.html(), "</div>", '<i class="layui-icon layui-table-tips-c layui-icon-close"></i>'].join(""), d[0], {
  529. tips: [3, ""],
  530. time: -1,
  531. anim: -1,
  532. maxWidth: r.ios || r.android ? 300 : i.elem.width() / 2,
  533. isOutAnim: !1,
  534. skin: "layui-table-tips",
  535. success: function (e, t) {
  536. e.find(".layui-table-tips-c").on("click", function () {
  537. l.close(t)
  538. })
  539. }
  540. }), layui.stope(e)
  541. }), i.layBody.on("click", "*[lay-event]", function () {
  542. var e = t(this), a = e.parents("tr").eq(0).data("index");
  543. layui.event.call(this, y, "tool(" + p + ")", v.call(this, {event: e.attr("lay-event")})), i.setThisRowChecked(a)
  544. }), i.layMain.on("scroll", function () {
  545. var e = t(this), a = e.scrollLeft(), n = e.scrollTop();
  546. i.layHeader.scrollLeft(a), i.layTotal.scrollLeft(a), i.layFixed.find(k).scrollTop(n), l.close(i.tipsIndex)
  547. }), H.on("resize", function () {
  548. i.resize()
  549. })
  550. }, function () {
  551. j.on("click", function () {
  552. j.trigger("table.remove.tool.panel")
  553. }), j.on("table.remove.tool.panel", function () {
  554. t(".layui-table-tool-panel").remove()
  555. })
  556. }(), d.init = function (e, i) {
  557. i = i || {};
  558. var a = this, l = t(e ? 'table[lay-filter="' + e + '"]' : h + "[lay-data]"),
  559. n = "Table element property lay-data configuration item has a syntax error: ";
  560. return l.each(function () {
  561. var a = t(this), l = a.attr("lay-data");
  562. try {
  563. l = new Function("return " + l)()
  564. } catch (r) {
  565. o.error(n + l)
  566. }
  567. var c = [], s = t.extend({
  568. elem: this,
  569. cols: [],
  570. data: [],
  571. skin: a.attr("lay-skin"),
  572. size: a.attr("lay-size"),
  573. even: "string" == typeof a.attr("lay-even")
  574. }, d.config, i, l);
  575. e && a.hide(), a.find("thead>tr").each(function (e) {
  576. s.cols[e] = [], t(this).children().each(function (i) {
  577. var a = t(this), l = a.attr("lay-data");
  578. try {
  579. l = new Function("return " + l)()
  580. } catch (r) {
  581. return o.error(n + l)
  582. }
  583. var d = t.extend({
  584. title: a.text(),
  585. colspan: a.attr("colspan") || 0,
  586. rowspan: a.attr("rowspan") || 0
  587. }, l);
  588. d.colspan < 2 && c.push(d), s.cols[e].push(d)
  589. })
  590. }), a.find("tbody>tr").each(function (e) {
  591. var i = t(this), a = {};
  592. i.children("td").each(function (e, i) {
  593. var l = t(this), n = l.data("field");
  594. if (n) return a[n] = l.html()
  595. }), layui.each(c, function (e, t) {
  596. var l = i.children("td").eq(e);
  597. a[t.field] = l.html()
  598. }), s.data[e] = a
  599. }), d.render(s)
  600. }), a
  601. }, c.that = {}, c.config = {}, d.eachCols = function (e, i, a) {
  602. var l = c.config[e] || {}, n = [], o = 0;
  603. a = t.extend(!0, [], a || l.cols), layui.each(a, function (e, t) {
  604. layui.each(t, function (t, i) {
  605. if (i.colGroup) {
  606. var l = 0;
  607. o++, i.CHILD_COLS = [], layui.each(a[e + 1], function (e, t) {
  608. 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))
  609. })
  610. }
  611. i.PARENT_COL_INDEX || n.push(i)
  612. })
  613. });
  614. var r = function (e) {
  615. layui.each(e || n, function (e, t) {
  616. return t.CHILD_COLS ? r(t.CHILD_COLS) : void ("function" == typeof i && i(e, t))
  617. })
  618. };
  619. r()
  620. }, d.checkStatus = function (e) {
  621. var t = 0, i = 0, a = [], l = d.cache[e] || [];
  622. return layui.each(l, function (e, l) {
  623. return l.constructor === Array ? void i++ : void (l[d.config.checkName] && (t++, a.push(d.clearCacheKey(l))))
  624. }), {data: a, isAll: !!l.length && t === l.length - i}
  625. }, d.exportFile = function (e, t, i) {
  626. var a = this;
  627. t = t || d.clearCacheKey(d.cache[e]), i = i || "csv";
  628. var l = c.config[e] || {}, n = {csv: "text/csv", xls: "application/vnd.ms-excel"}[i],
  629. s = document.createElement("a");
  630. return r.ie ? o.error("IE_NOT_SUPPORT_EXPORTS") : (s.href = "data:" + n + ";charset=utf-8,\ufeff" + encodeURIComponent(function () {
  631. var i = [], l = [], n = [];
  632. return layui.each(t, function (t, a) {
  633. var n = [];
  634. "object" == typeof e ? (layui.each(e, function (e, a) {
  635. 0 == t && i.push(a || "")
  636. }), layui.each(d.clearCacheKey(a), function (e, t) {
  637. n.push('"' + (t || "") + '"')
  638. })) : d.eachCols(e, function (e, l) {
  639. if (l.field && "normal" == l.type && !l.hide) {
  640. var o = a[l.field];
  641. void 0 !== o && null !== o || (o = ""), 0 == t && i.push(l.title || ""), n.push('"' + u(l, o, a, "text") + '"')
  642. }
  643. }), l.push(n.join(","))
  644. }), layui.each(a.dataTotal, function (e, t) {
  645. n.push(t)
  646. }), i.join(",") + "\r\n" + l.join("\r\n") + "\r\n" + n.join(",")
  647. }()), s.download = (l.title || "table_" + (l.index || "")) + "." + i, document.body.appendChild(s), s.click(), void document.body.removeChild(s))
  648. }, d.resize = function (e) {
  649. if (e) {
  650. var t = s(e);
  651. if (!t) return;
  652. c.that[e].resize()
  653. } else layui.each(c.that, function () {
  654. this.resize()
  655. })
  656. }, d.reload = function (e, t) {
  657. var i = s(e);
  658. if (i) {
  659. var a = c.that[e];
  660. return a.reload(t), c.call(a)
  661. }
  662. }, d.render = function (e) {
  663. var t = new F(e);
  664. return c.call(t)
  665. }, d.clearCacheKey = function (e) {
  666. return e = t.extend({}, e), delete e[d.config.checkName], delete e[d.config.indexName], e
  667. }, d.init(), e(y, d)
  668. });