zzwy2/view/manager/category/index.html

206 lines
14 KiB
HTML
Executable File

{php}
$sortUrl = url('manager.category/sort');
$delUrl = url('manager.category/del');
{/php}
{layout name="manager/layout" /}
<div class="layui-card layui-col-md12">
<div class="layui-card-body">
{if $power_add}
<div class=" top-operate" >
{if $member['groupId'] == 1}
<a class="layui-btn layui-btn-normal" id="add" data-href="{:url('manager.category/add')}" title="新增栏目">
<i class="layui-icon layui-icon-add-1"></i>新增栏目
</a>
<button class="layui-btn layui-btn-danger delAll" data-url="{:url('manager.category/batchDel')}"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
{/if}
</div>
{/if}
<div class="panel-body">
{empty name="items"}
无记录
{else /}
<table class="layui-table layui-form">
<colgroup>
<col width="15px">
<col >
<col width="150px">
<!-- <col width="150px">-->
<col width="80px">
<!-- <col width="150px">-->
<!-- <col width="150px">-->
<!-- <col width="80px">-->
<col width="400px">
</colgroup>
<thead>
<tr>
<td><input type="checkbox" lay-skin="primary" lay-filter="parents-table" title=""/></td>
<td>栏目</td>
<td>类型</td>
<!-- <td>分组</td>-->
<td>前台菜单|手机底部|pc底部</td>
<!-- <td>列表页模板</td>-->
<!-- <td>详情页模板</td>-->
<!-- <td>每页数量</td>-->
<td>操作</td>
</tr>
</thead>
{foreach $items as $item}
<tbody class="table-lv1" data-id="{$item['id']}" data-url="{$sortUrl}">
<tr>
<td><input type="checkbox" name="checkbox" value="{$item.id}" lay-skin="primary" lay-filter="childrens-table"/></td>
<td>
<a class="layui-btn layui-btn-title" data-href="{:url('manager.category/edit',['id' => $item['id']])}" title="编辑" style="width: 50%;">{$item.title}</a>
</td>
<td>{$item.modelName}</td>
<!-- <td>{$item.group_name}</td>-->
<td>{$item.state?'是':'否'}|手机{$item.foot_show_mobile?'显示':'隐藏'}|PC{$item.foot_show?'显示':'隐藏'}</td>
<!-- <td>{$item.template_list??''}</td>-->
<!-- <td>{$item.template_detail??''}</td>-->
<!-- <td>{$item.number}</td>-->
<td>
<div style="width: 365px;">
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$item['id']}" data-url="{$sortUrl}" data-sort="up" href="javascript:void(0)">
<i class=""></i>向上
</a>
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$item['id']}" data-url="{$sortUrl}" data-sort="down" href="javascript:void(0)">
<i class=""></i>向下
</a>
<a class="layui-btn layui-btn-warm layui-btn-xs" data-href="{:url('manager.category/edit', ['id' => $item['id']])}" title="编辑">
<i class=""></i>编辑
</a>
{if $member['groupId'] == 1}
<a class="del layui-btn layui-btn-danger layui-btn-xs" data-id="{$item['id']}" data-url="{$delUrl}" href="javascript:void(0);">
<i class=""></i>删除
</a>
{/if}
{if $member['groupId'] == 1}
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="{:url('manager.category/add', ['parent_id' => $item['id']])}" title="添加子栏目">
<i class=""></i>添加子栏目
</a>
{/if}
</div>
</td>
</tr>
{if isset($item['children'])}
<tr>
<td colspan="9" style="padding: 0;">
<table class="layui-table layui-table-allnobrder" style="margin: auto;">
<colgroup>
<col width="15px">
<col>
<col width="150px">
<!-- <col width="150px">-->
<col width="172px">
<!-- <col width="150px">-->
<!-- <col width="150px">-->
<!-- <col width="80px">-->
<col width="400px">
</colgroup>
{foreach $item['children'] as $child}
<tbody class="table-lv2" data-id="{$child['id']}" data-url="{$sortUrl}">
<tr>
<td><input type="checkbox" name="checkbox" value="{$child.id}" lay-skin="primary" lay-filter="childrens-table"/></td>
<td>
<img src="__MANAGER__/image/ico_arrow7.png" width="20px" style="margin:0 15px 0 25px;" />
<a class="layui-btn layui-btn-title" data-href="{:url('manager.category/edit',['id' => $child['id']])}" title="编辑">{$child.title}</a>
</td>
<td>{$child.modelName}</td>
<!-- <td>{$child.group_name}</td>-->
<td>{$child.state?'是':'否'}|手机{$child.foot_show_mobile?'显示':'隐藏'}|PC{$child.foot_show?'显示':'隐藏'}</td>
<!-- <td>{$child.template_list??''}</td>-->
<!-- <td>{$child.template_detail??''}</td>-->
<!-- <td>{$child.number}</td>-->
<td>
<div style="width: 365px;">
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$child['id']}" data-url="{$sortUrl}" data-sort="up" href="javascript:void(0)">
<i class=""></i>向上
</a>
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$child['id']}" data-url="{$sortUrl}" data-sort="down" href="javascript:void(0)">
<i class=""></i>向下
</a>
<a class="layui-btn layui-btn-warm layui-btn-xs" data-href="{:url('manager.category/edit', ['id' => $child['id']])}" title="编辑">
<i class=""></i>编辑
</a>
{if $member['groupId'] == 1}
<a class="del layui-btn layui-btn-danger layui-btn-xs" data-id="{$child['id']}" data-url="{$delUrl}" href="javascript:void(0);">
<i class=""></i>删除
</a>
{/if}
{if $member['groupId'] == 1 || $child.create_child == 1}
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="{:url('manager.category/add', ['parent_id' => $child['id']])}" title="添加子栏目">
<i class=""></i>添加子栏目
</a>
{/if}
</div>
</td>
</tr>
<tr>
<td colspan="9" style="padding: 0;">
<table class="layui-table layui-table-allnobrder" style="margin: auto;">
<colgroup>
<col width="15px">
<col>
<col width="150px">
<!-- <col width="150px">-->
<col width="172px">
<!-- <col width="150px">-->
<!-- <col width="150px">-->
<!-- <col width="80px">-->
<col width="400px">
</colgroup>
{if isset($child['children']) && !empty($child['children'])}
{foreach $child['children'] as $c}
<tr class="table-lv3" data-id="{$c['id']}" data-url="{$sortUrl}">
<td><input type="checkbox" name="checkbox" value="{$c.id}" lay-skin="primary" lay-filter="childrens-table"/></td>
<td>
<img src="__MANAGER__/image/ico_arrow7.png" width="20px" style="margin:0 15px 0 50px;" />
<a class="layui-btn layui-btn-title" data-href="{:url('manager.category/edit',['id' => $c['id']])}" title="编辑">{$c.title}</a>
</td>
<td>{$c.modelName}</td>
<!-- <td>{$c.group_name}</td>-->
<td>{$c.state?'是':'否'}|手机{$c.foot_show_mobile?'显示':'隐藏'}|PC{$c.foot_show?'显示':'隐藏'}</td>
<!-- <td>{$c.template_list??''}</td>-->
<!-- <td>{$c.template_detail??''}</td>-->
<!-- <td>{$c.number}</td>-->
<td>
<div style="width: 365px;">
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$c['id']}" data-url="{$sortUrl}" data-sort="up" href="javascript:void(0)">
<i class=""></i>向上
</a>
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-id="{$c['id']}" data-url="{$sortUrl}" data-sort="down" href="javascript:void(0)">
<i class=""></i>向下
</a>
<a class="layui-btn layui-btn-warm layui-btn-xs" data-href="{:url('manager.category/edit', ['id' => $c['id']])}" title="编辑">
<i class=""></i>编辑
</a>
{if $member['groupId'] == 1}
<a class="del layui-btn layui-btn-danger layui-btn-xs" data-id="{$c['id']}" data-url="{$delUrl}" href="javascript:void(0);">
<i class=""></i>删除
</a>
{/if}
{if $member['groupId'] == 1}
<a class="layui-btn layui-btn-primary layui-btn-xs" style="opacity: 0;pointer-events: none;"><i class=""></i>添加子栏目</a>
{/if}
</div>
</td>
</tr>
{/foreach}
{/if}
</table>
</td>
</tr>
</tbody>
{/foreach}
</table>
</td>
</tr>
{/if}
</tbody>
{/foreach}
</table>
{/empty}
</div>
</div>
</div>