1
This commit is contained in:
@@ -122,14 +122,56 @@
|
||||
table.render({
|
||||
elem: '#data-table',
|
||||
url: SELECT_API,
|
||||
page: true,
|
||||
page: {
|
||||
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
|
||||
groups: 5,
|
||||
theme: '#FF5722',
|
||||
text: {
|
||||
count: translations.pagination_total,
|
||||
limit: translations.pagination_limit,
|
||||
page: translations.pagination_page,
|
||||
prev: translations.pagination_prev,
|
||||
next: translations.pagination_next,
|
||||
jump: translations.pagination_jump,
|
||||
go: translations.pagination_go
|
||||
}
|
||||
},
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
toolbar: '#table-toolbar',
|
||||
defaultToolbar: [{
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
}, 'filter', 'print', 'exports'],
|
||||
text: {
|
||||
none: translations.data_not_found
|
||||
},
|
||||
done: function () {
|
||||
// 更新分页文本
|
||||
$('.layui-laypage a').each(function() {
|
||||
let text = $(this).text();
|
||||
if (text === '上一页') {
|
||||
$(this).text(translations.pagination_prev);
|
||||
} else if (text === '下一页') {
|
||||
$(this).text(translations.pagination_next);
|
||||
}
|
||||
});
|
||||
|
||||
// 更新分页信息
|
||||
let pageInfo = $('.layui-laypage-count').text();
|
||||
let total = pageInfo.match(/\d+/)[0];
|
||||
$('.layui-laypage-count').text(translations.pagination_total.replace('{total}', total));
|
||||
|
||||
// 更新每页条数
|
||||
$('.layui-laypage-limits option').each(function() {
|
||||
let value = $(this).val();
|
||||
$(this).text(translations.pagination_limit.replace('{limit}', value));
|
||||
});
|
||||
|
||||
// 更新跳转文本
|
||||
$('.layui-laypage-skip').prev().text(translations.pagination_jump);
|
||||
$('.layui-laypage-btn').text(translations.pagination_go);
|
||||
}
|
||||
});
|
||||
|
||||
// 工具条点击事件
|
||||
|
||||
Reference in New Issue
Block a user