feat(admin): add role filter functionality- Implement role-based filtering for admin list
- Add sidebar with role options for filtering - Update table to support 'find_in_set' operation for filtering-Enhance user experience by adding 'Reset' functionality
This commit is contained in:
@@ -1,12 +1,33 @@
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<table id="currentTable" class="layui-table layui-hide"
|
||||
data-auth-add="{:auth('system.admin/add')}"
|
||||
data-auth-edit="{:auth('system.admin/edit')}"
|
||||
data-auth-delete="{:auth('system.admin/delete')}"
|
||||
data-auth-password="{:auth('system.admin/password')}"
|
||||
lay-filter="currentTable">
|
||||
</table>
|
||||
|
||||
<div class="layui-row layui-col-space8">
|
||||
<div class="layui-col-md2 layui-hide-xs">
|
||||
<div class="layui-card-body layui-border">
|
||||
<h2>角色列表</h2>
|
||||
<ul class="layui-menu layui-dropdown-menu">
|
||||
<li class="layui-menu-item-checked">
|
||||
<div class="layui-menu-body-title" lay-on="authSearch" data-auth_id="0">全部</div>
|
||||
</li>
|
||||
{volist name="auth_list" id="vo"}
|
||||
<li class="">
|
||||
<div class="layui-menu-body-title" lay-on="authSearch" data-auth_id="{$key}">{$vo}</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md10">
|
||||
<table id="currentTable" class="layui-table layui-hide"
|
||||
data-auth-add="{:auth('system.admin/add')}"
|
||||
data-auth-edit="{:auth('system.admin/edit')}"
|
||||
data-auth-delete="{:auth('system.admin/delete')}"
|
||||
data-auth-password="{:auth('system.admin/password')}"
|
||||
lay-filter="currentTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use app\admin\traits\Curd;
|
||||
use app\BaseController;
|
||||
use app\common\constants\AdminConstant;
|
||||
use app\common\traits\JumpTrait;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use think\helper\Str;
|
||||
use think\response\Json;
|
||||
@@ -199,6 +200,9 @@ class AdminController extends BaseController
|
||||
case 'in':
|
||||
$where[] = [$key, 'IN', $val];
|
||||
break;
|
||||
case 'find_in_set':
|
||||
$where[] = ['', 'exp', Db::raw("FIND_IN_SET(:param,$key)", ['param' => $val])];
|
||||
break;
|
||||
case 'range':
|
||||
[$beginTime, $endTime] = explode(' - ', $val);
|
||||
$where[] = [$key, '>=', strtotime($beginTime)];
|
||||
|
||||
Reference in New Issue
Block a user