优化配置列表页、权限列表页,去除分页设置
This commit is contained in:
parent
3692eb18d9
commit
db09ade51e
@ -23,11 +23,8 @@ class Conf extends BaseController
|
|||||||
$param = get_params();
|
$param = get_params();
|
||||||
$where = array();
|
$where = array();
|
||||||
$where[] = ['status', '>=', 0];
|
$where[] = ['status', '>=', 0];
|
||||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
$list = Db::name('Config')->where($where)->select();
|
||||||
$content = Db::name('Config')
|
return to_assign(0, '', $list);
|
||||||
->where($where)
|
|
||||||
->paginate($rows, false, ['query' => $param]);
|
|
||||||
return table_assign(0, '', $content);
|
|
||||||
} else {
|
} else {
|
||||||
return view();
|
return view();
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,8 @@ class Role extends BaseController
|
|||||||
if (!empty($param['keywords'])) {
|
if (!empty($param['keywords'])) {
|
||||||
$where[] = ['id|title|desc', 'like', '%' . $param['keywords'] . '%'];
|
$where[] = ['id|title|desc', 'like', '%' . $param['keywords'] . '%'];
|
||||||
}
|
}
|
||||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
$list = Db::name('AdminGroup')->where($where)->order('create_time asc')->select();
|
||||||
$group = AdminGroup::where($where)
|
return to_assign(0, '', $list);
|
||||||
->order('create_time asc')
|
|
||||||
->paginate($rows, false, ['query' => $param]);
|
|
||||||
return table_assign(0, '', $group);
|
|
||||||
} else {
|
} else {
|
||||||
return view();
|
return view();
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: "/home/conf/index",
|
url: "/home/conf/index",
|
||||||
cellMinWidth: 360,
|
cellMinWidth: 360,
|
||||||
page: true, //开启分页
|
page: false, //开启分页
|
||||||
limit: 20,
|
limit: 20,
|
||||||
cols: [
|
cols: [
|
||||||
[{
|
[{
|
||||||
|
@ -2,12 +2,6 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<form class="layui-form gg-form-bar border-t border-x">
|
|
||||||
<div class="layui-input-inline" style="width:300px;">
|
|
||||||
<input type="text" name="keywords" placeholder="名称/备注" class="layui-input" autocomplete="off" />
|
|
||||||
</div>
|
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button>
|
|
||||||
</form>
|
|
||||||
<table class="layui-hide" id="role" lay-filter="role"></table>
|
<table class="layui-hide" id="role" lay-filter="role"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -32,7 +26,7 @@
|
|||||||
elem: '#role',
|
elem: '#role',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: "/home/role/index", //数据接口
|
url: "/home/role/index", //数据接口
|
||||||
page: true, //开启分页
|
page: false, //开启分页
|
||||||
limit: 20,
|
limit: 20,
|
||||||
cols: [[ //表头
|
cols: [[ //表头
|
||||||
{ field: 'id', title: 'ID号', align: 'center', width: 80 }
|
{ field: 'id', title: 'ID号', align: 'center', width: 80 }
|
||||||
@ -75,15 +69,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听搜索提交
|
|
||||||
form.on('submit(webform)', function (data) {
|
|
||||||
layui.pageTable.reload({
|
|
||||||
where: { keywords: data.field.keywords },
|
|
||||||
page: { curr: 1 }
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user