Browse Source

查询时添加查询所有功能

lwx_dev
erdanergou 3 years ago
parent
commit
0c17aa8e55
  1. 28
      src/main/resources/static/lib/layui-v2.6.3/layui.js
  2. 2
      src/main/resources/templates/pages/depository/table-stock.html

28
src/main/resources/static/lib/layui-v2.6.3/layui.js

@ -469,7 +469,18 @@ layui.define(function (e) {
if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3 if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3
}, u.prototype.view = function () { }, u.prototype.view = function () {
var e = this, a = e.config, t = a.groups = "groups" in a ? 0 | a.groups : 5; 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 : "&#x4E0A;&#x4E00;&#x9875;", a.next = "next" in a ? a.next : "&#x4E0B;&#x4E00;&#x9875;"; 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 : "&#x4E0A;&#x4E00;&#x9875;",
a.next = "next" in a ? a.next : "&#x4E0B;&#x4E00;&#x9875;";
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 = { var n = a.pages > t ? Math.ceil((a.curr + (t > 1 ? 1 : 0)) / (t > 0 ? t : 1)) : 1, i = {
prev: function () { prev: function () {
return a.prev ? '<a href="javascript:;" class="layui-laypage-prev' + (1 == a.curr ? " " + r : "") + '" data-page="' + (a.curr - 1) + '">' + a.prev + "</a>" : "" 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 () { limit: function () {
var e = ['<span class="layui-laypage-limits"><select lay-ignore>']; var e = ['<span class="layui-laypage-limits"><select lay-ignore>'];
return layui.each(a.limits, function (t, n) { return layui.each(a.limits, function (t, n) {
if (n !== "all") {
e.push('<option value="' + n + '"' + (n === a.limit ? "selected" : "") + ">" + n + " 条/页</option>") e.push('<option value="' + n + '"' + (n === a.limit ? "selected" : "") + ">" + n + " 条/页</option>")
}), e.join("") + "</select></span>" }
}), 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(""), refresh: ['<a href="javascript:;" data-page="' + a.curr + '" class="layui-laypage-refresh">', '<i class="layui-icon layui-icon-refresh"></i>', "</a>"].join(""),
skip: function () { skip: function () {
@ -520,7 +533,13 @@ layui.define(function (e) {
}); });
p && s.on(p, "change", function () { p && s.on(p, "change", function () {
var e = this.value; 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 () { }), u && s.on(u, "click", function () {
c() c()
}) })
@ -6019,7 +6038,8 @@ layui.define(["laytpl", "laypage", "layer", "form", "util"], function (e) {
var r = {}; var r = {};
r[l.pageName] = e, r[l.limitName] = a.limit; r[l.pageName] = e, r[l.limitName] = a.limit;
var d = t.extend(r, a.where); 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", type: a.method || "get",
url: a.url, url: a.url,
contentType: a.contentType, contentType: a.contentType,

2
src/main/resources/templates/pages/depository/table-stock.html

@ -260,7 +260,7 @@
{title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"} {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
] ]
], ],
limits: [10, 15, 20, 25, 50, 100], limits: [10, 20, 50, 100],
limit: 10, limit: 10,
page: true, page: true,
skin: 'line', skin: 'line',

Loading…
Cancel
Save