fix(table): 重载时若当前页超过总页数,序号列渲染异常 (#2247)

pull/2257/head
morning-star 2 months ago committed by GitHub
parent e58cdf1e9d
commit c6f4dcc0a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1212,11 +1212,17 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
('返回的数据不符合规范,正确的成功状态码应为:"'+ response.statusName +'": '+ response.statusCode) ('返回的数据不符合规范,正确的成功状态码应为:"'+ response.statusName +'": '+ response.statusCode)
); );
} else { } else {
// 当前页不能超过总页数
var count = res[response.countName];
var pages = Math.ceil(count / options.limit) || 1;
if(curr > pages){
curr = pages;
}
that.totalRow = res[response.totalRowName]; that.totalRow = res[response.totalRowName];
that.renderData({ that.renderData({
res: res, res: res,
curr: curr, curr: curr,
count: res[response.countName], count: count,
type: opts.type type: opts.type
}), sort(); }), sort();

Loading…
Cancel
Save