|
|
|
@ -469,7 +469,18 @@ layui.define(function (e) { |
|
|
|
if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3 |
|
|
|
}, u.prototype.view = function () { |
|
|
|
var e = this, a = e.config, t = a.groups = "groups" in a ? 0 | a.groups : 5; |
|
|
|
a.layout = "object" == typeof a.layout ? a.layout : ["prev", "page", "next"], a.count = 0 | a.count, a.curr = 0 | a.curr || 1, a.limits = "object" == typeof a.limits ? a.limits : [10, 20, 30, 40, 50], a.limit = 0 | a.limit || 10, a.pages = Math.ceil(a.count / a.limit) || 1, a.curr > a.pages && (a.curr = a.pages), t < 0 ? t = 1 : t > a.pages && (t = a.pages), a.prev = "prev" in a ? a.prev : "上一页", a.next = "next" in a ? a.next : "下一页"; |
|
|
|
a.layout = "object" == typeof a.layout ? a.layout : ["prev", "page", "next"], |
|
|
|
a.count = 0 | a.count, a.curr = 0 | a.curr || 1, |
|
|
|
a.limits = "object" == typeof a.limits ? a.limits : [10, 20, 30, 40, 50], |
|
|
|
a.limit = 0 | a.limit || 10, |
|
|
|
a.pages = Math.ceil(a.count / a.limit) || 1, |
|
|
|
a.curr > a.pages && (a.curr = a.pages), |
|
|
|
t < 0 ? t = 1 : t > a.pages && (t = a.pages), |
|
|
|
a.prev = "prev" in a ? a.prev : "上一页", |
|
|
|
a.next = "next" in a ? a.next : "下一页"; |
|
|
|
if (a.limits.indexOf("all") === -1) { |
|
|
|
a.limits.push("all"); |
|
|
|
} |
|
|
|
var n = a.pages > t ? Math.ceil((a.curr + (t > 1 ? 1 : 0)) / (t > 0 ? t : 1)) : 1, i = { |
|
|
|
prev: function () { |
|
|
|
return a.prev ? '<a href="javascript:;" class="layui-laypage-prev' + (1 == a.curr ? " " + r : "") + '" data-page="' + (a.curr - 1) + '">' + a.prev + "</a>" : "" |
|
|
|
@ -492,8 +503,10 @@ layui.define(function (e) { |
|
|
|
limit: function () { |
|
|
|
var e = ['<span class="layui-laypage-limits"><select lay-ignore>']; |
|
|
|
return layui.each(a.limits, function (t, n) { |
|
|
|
e.push('<option value="' + n + '"' + (n === a.limit ? "selected" : "") + ">" + n + " 条/页</option>") |
|
|
|
}), e.join("") + "</select></span>" |
|
|
|
if (n !== "all") { |
|
|
|
e.push('<option value="' + n + '"' + (n === a.limit ? "selected" : "") + ">" + n + " 条/页</option>") |
|
|
|
} |
|
|
|
}), e.push('<option value="all">全部数据</option>'), e.join("") + "</select></span>" |
|
|
|
}(), |
|
|
|
refresh: ['<a href="javascript:;" data-page="' + a.curr + '" class="layui-laypage-refresh">', '<i class="layui-icon layui-icon-refresh"></i>', "</a>"].join(""), |
|
|
|
skip: function () { |
|
|
|
@ -520,7 +533,13 @@ layui.define(function (e) { |
|
|
|
}); |
|
|
|
p && s.on(p, "change", function () { |
|
|
|
var e = this.value; |
|
|
|
i.curr * e > i.count && (i.curr = Math.ceil(i.count / e)), i.limit = e, t.render() |
|
|
|
if(e === "all"){ |
|
|
|
e = i.count |
|
|
|
} |
|
|
|
i.curr * e > i.count && (i.curr = Math.ceil(i.count / e)), |
|
|
|
i.limit = e, |
|
|
|
|
|
|
|
t.render() |
|
|
|
}), u && s.on(u, "click", function () { |
|
|
|
c() |
|
|
|
}) |
|
|
|
@ -3702,18 +3721,18 @@ layui.define(function (e) { |
|
|
|
var t = this, |
|
|
|
|
|
|
|
a = function () { |
|
|
|
r.ready(function () { |
|
|
|
t.creat() |
|
|
|
}) |
|
|
|
}; |
|
|
|
r.ready(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) |
|
|
|
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"]; |
|
|
|
@ -6019,7 +6038,8 @@ layui.define(["laytpl", "laypage", "layer", "form", "util"], function (e) { |
|
|
|
var r = {}; |
|
|
|
r[l.pageName] = e, r[l.limitName] = a.limit; |
|
|
|
var d = t.extend(r, a.where); |
|
|
|
a.contentType && 0 == a.contentType.indexOf("application/json") && (d = JSON.stringify(d)), i.loading(), t.ajax({ |
|
|
|
a.contentType && 0 == a.contentType.indexOf("application/json") && (d = JSON.stringify(d)), i.loading(), |
|
|
|
t.ajax({ |
|
|
|
type: a.method || "get", |
|
|
|
url: a.url, |
|
|
|
contentType: a.contentType, |
|
|
|
|