mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
修改搜索分页
This commit is contained in:
parent
9316171cbb
commit
95630bcc81
@ -1,13 +1,11 @@
|
||||
<div class="layui-card">
|
||||
{block name='style'}{/block}
|
||||
{block name='header'}
|
||||
{notempty name='title'}
|
||||
{block name='header'}{notempty name='title'}
|
||||
<div class="layui-card-header notselect">
|
||||
<span class="layui-icon layui-icon-next font-s10 color-desc margin-right-5"></span>{$title|default=''}
|
||||
<div class="pull-right">{block name='button'}{/block}</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
{/block}
|
||||
{/notempty}{/block}
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-card-html">
|
||||
{block name='content'}{/block}
|
||||
|
@ -663,7 +663,7 @@ $(function () {
|
||||
// 标准化请求参数,初始化排序参数,表格插件初始化参数
|
||||
var data = {}, sort = options.initSort || options.sort || {}, option = {
|
||||
id: elem.id, elem: elem, url: options.url || elem.dataset.url || '', where: getWhere(),
|
||||
limit: options.limit || 15, cols: options.cols || [[]], page: options.page !== false,
|
||||
limit: options.limit || 20, cols: options.cols || [[]], page: options.page !== false,
|
||||
};
|
||||
// 延用工具条配置
|
||||
if (sort.field && sort.type) option.initSort = sort;
|
||||
@ -687,13 +687,14 @@ $(function () {
|
||||
// 搜索表单处理
|
||||
var search = options.search || this.dataset.targetSearch;
|
||||
if (search) $body.off('submit', 'form.form-search').on('submit', search, function () {
|
||||
(data = $.extend(data, $(this).formToJson())), $(elem).trigger('reload');
|
||||
data = $.extend(data, $(this).formToJson());
|
||||
$(elem).trigger('reload', {where: getWhere(), page: {curr: 1}});
|
||||
});
|
||||
// 绑定重载事件
|
||||
$(this).bind('reload', function () {
|
||||
var config = {where: getWhere()};
|
||||
if (sort.field && sort.type) config.initSort = sort;
|
||||
layui.table.reload(elem.id, config);
|
||||
$(this).bind('reload', function (e, opts) {
|
||||
opts = opts || {where: getWhere()};
|
||||
if (sort.field && sort.type) opts.initSort = sort;
|
||||
layui.table.reload(elem.id, opts);
|
||||
});
|
||||
|
||||
// 获取查询数据
|
||||
|
Loading…
x
Reference in New Issue
Block a user