|
|
@ -533,12 +533,11 @@ layui.define(function (e) { |
|
|
}); |
|
|
}); |
|
|
p && s.on(p, "change", function () { |
|
|
p && s.on(p, "change", function () { |
|
|
var e = this.value; |
|
|
var e = this.value; |
|
|
if(e === "all"){ |
|
|
if (e === "all") { |
|
|
e = i.count |
|
|
e = i.count |
|
|
} |
|
|
} |
|
|
i.curr * e > i.count && (i.curr = Math.ceil(i.count / e)), |
|
|
i.curr * e > i.count && (i.curr = Math.ceil(i.count / e)), |
|
|
i.limit = e, |
|
|
i.limit = e, |
|
|
|
|
|
|
|
|
t.render() |
|
|
t.render() |
|
|
}), u && s.on(u, "click", function () { |
|
|
}), u && s.on(u, "click", function () { |
|
|
c() |
|
|
c() |
|
|
@ -554,7 +553,8 @@ layui.define(function (e) { |
|
|
} |
|
|
} |
|
|
}, u.prototype.render = function (e) { |
|
|
}, u.prototype.render = function (e) { |
|
|
var n = this, i = n.config, r = n.type(), u = n.view(); |
|
|
var n = this, i = n.config, r = n.type(), u = n.view(); |
|
|
2 === r ? i.elem && (i.elem.innerHTML = u) : 3 === r ? i.elem.html(u) : a[t](i.elem) && (a[t](i.elem).innerHTML = u), i.jump && i.jump(i, e); |
|
|
2 === r ? i.elem && (i.elem.innerHTML = u) : 3 === r ? i.elem.html(u) : a[t](i.elem) && (a[t](i.elem).innerHTML = u), |
|
|
|
|
|
i.jump && i.jump(i, e); |
|
|
var s = a[t]("layui-laypage-" + i.index); |
|
|
var s = a[t]("layui-laypage-" + i.index); |
|
|
n.jump(s), i.hash && !e && (location.hash = "!" + i.hash + "=" + i.curr), n.skip(s) |
|
|
n.jump(s), i.hash && !e && (location.hash = "!" + i.hash + "=" + i.curr), n.skip(s) |
|
|
}; |
|
|
}; |
|
|
@ -6040,19 +6040,19 @@ layui.define(["laytpl", "laypage", "layer", "form", "util"], function (e) { |
|
|
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(), |
|
|
a.contentType && 0 == a.contentType.indexOf("application/json") && (d = JSON.stringify(d)), i.loading(), |
|
|
t.ajax({ |
|
|
t.ajax({ |
|
|
type: a.method || "get", |
|
|
type: a.method || "get", |
|
|
url: a.url, |
|
|
url: a.url, |
|
|
contentType: a.contentType, |
|
|
contentType: a.contentType, |
|
|
data: d, |
|
|
data: d, |
|
|
dataType: "json", |
|
|
dataType: "json", |
|
|
headers: a.headers || {}, |
|
|
headers: a.headers || {}, |
|
|
success: function (t) { |
|
|
success: function (t) { |
|
|
"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]) |
|
|
"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]) |
|
|
}, |
|
|
}, |
|
|
error: function (e, t) { |
|
|
error: function (e, t) { |
|
|
i.errorView("数据接口请求异常:" + t), i.renderForm(), i.setColsWidth(), "function" == typeof a.error && a.error(e, t) |
|
|
i.errorView("数据接口请求异常:" + t), i.renderForm(), i.setColsWidth(), "function" == typeof a.error && a.error(e, t) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else if (a.data && a.data.constructor === Array) { |
|
|
} else if (a.data && a.data.constructor === Array) { |
|
|
var c = {}, s = e * a.limit - a.limit; |
|
|
var c = {}, s = e * a.limit - a.limit; |
|
|
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]) |
|
|
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]) |
|
|
|