增加菜单选项卡

This commit is contained in:
邹景立 2021-04-12 11:54:51 +08:00
parent ee5850364a
commit 8a67ef217b
2 changed files with 74 additions and 59 deletions

View File

@ -46,7 +46,12 @@ class Menu extends Controller
public function index()
{
$this->title = '系统菜单管理';
$this->_page($this->table, false);
$query = $this->_query($this->table);
// 状态选项卡处理
$this->type = input('type', 'index');
if ($this->type === 'index') $query->where(['status' => 1]);
// 数据查询与分页
$query->page(false, true);
}
/**

View File

@ -11,7 +11,16 @@
{/block}
{block name="content"}
<div class="think-box-shadow">
<div class="layui-tab layui-tab-card think-bg-white">
<ul class="layui-tab-title">
{foreach ['index'=>'当前菜单','recycle'=>'回 收 站'] as $k=>$v}
{if isset($type) and $type eq $k}
<li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
{else}
<li data-open="{:url('index')}?type={$k}">{$v}</li>
{/if}{/foreach}
</ul>
<div class="layui-tab-content">
{empty name='list'}
<blockquote class="layui-elem-quote"> 哦!</blockquote>
{else}
@ -70,4 +79,5 @@
</table>
{/empty}
</div>
</div>
{/block}