123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- {extend name='admin@main'}
- {block name="button"}
- {if auth("add")}
- <button data-modal='{:url("add")}' style="background-color: #DC2219" data-title="添加分类" class='layui-btn layui-btn-sm'>添加</button>
- {/if}
- {/block}
- <style>
- .color-desc {
- color: #999 !important;
- }
- </style>
- {block name="content"}
- <div class="think-box-shadow">
- <table class="layui-table margin-top-10">
- {notempty name='list'}
- <thead>
- <tr>
- <th class='text-left nowrap'>分类名称</th>
- <th class="text-center">状态</th>
- <th class="text-center">添加时间</th>
- <th class="text-center">操作</th>
- </tr>
- </thead>
- {/notempty}
- <tbody>
- {foreach $list as $key=>$vo}
- <tr>
- <td class='text-left nowrap' style="font-size: 13px;"
- onclick='if($(".tr_{$vo.id}").hasClass("t")){$(".tr_{$vo.id}").removeClass("t").show()}else{$(".tr_{$vo.id}").addClass("t").hide();$(".ptr_{$vo.id}").addClass("t").hide()}'>
- {$vo.title|default=''}
- {if count($vo['children']) > 0}
- <i class="layui-icon layui-icon-triangle-r margin-right-5"></i>
- {/if}
- </td>
- <td class='text-center nowrap'>
- {eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
- </td>
- <td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
- <td class='text-center nowrap'>
- {if auth("add")}
- <span class="text-explode">|</span>
- <a class="layui-btn layui-btn-sm" style="background-color: #DC2219" data-title="添加" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
- {/if}
- {if auth("edit")}
- <a data-dbclick class="layui-btn layui-btn-sm" style="background-color:#FFB822 " data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
- {/if}
- {if $vo.status eq 1 and auth("forbid")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
- {elseif auth("resume")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('resume')}">启 用</a>
- {/if}
- {if auth("remove")}
- <a class="layui-btn layui-btn-sm layui-btn-danger" style="background-color: #5AD729" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
- {/if}
- </td>
- </tr>
- {foreach $vo['children'] as $k=>$v}
- <!-- <tr class="t tr_{$vo.id}" style="display: none">-->
- <tr class="t tr_{$vo.id}" >
- <td class='text-left nowrap' style="font-size: 13px;"
- onclick='if($(".tr_{$v.id}").hasClass("t")){$(".tr_{$v.id}").removeClass("t").show()}else{$(".tr_{$v.id}").addClass("t").hide()}'>
- <span class="color-desc" style="margin-left: 15px; margin-right: 10px">|-</span>
- {$v.title|default=''}
- {if count($v['children']) > 0}
- <i class="layui-icon layui-icon-triangle-r margin-right-5"></i>
- {/if}
- </td>
- <td class='text-center nowrap'>
- {eq name='v.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
- </td>
- <td class='text-center nowrap'>{$v.create_at|format_datetime}</td>
- <td class='text-center nowrap'>
- {if auth("add")}
- <span class="text-explode">|</span>
- <a class="layui-btn layui-btn-sm layui-bg-red" data-title="添加" data-modal='{:url("add")}?pid={$v.id}'>添 加</a>
- {/if}
- {if auth("edit")}
- <a data-dbclick class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$v.id}&pid={$v.id}'>编 辑</a>
- {/if}
- {if $v.status eq 1 and auth("forbid")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$v.id};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
- {elseif auth("resume")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$v.id};status#1" data-csrf="{:systoken('resume')}">启 用</a>
- {/if}
- {if auth("remove")}
- <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$v.id}">删 除</a>
- {/if}
- </td>
- {foreach $v['children'] as $ck=>$cv}
- <tr class="t ptr_{$vo.id} tr_{$v.id}" >
- <td>
- <span class="color-desc" style="margin-left: 15px; margin-right: 10px">|- </span>
- <span class="color-desc" style="margin-left: 15px; margin-right: 10px;">|- </span>
- {$cv.title|default=''}
- </td>
- <td class='text-center nowrap'>
- {eq name='cv.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
- </td>
- <td class='text-center nowrap'>{$cv.create_at|format_datetime}</td>
- <td class='text-center nowrap'>
- {if auth("add")}
- <span class="text-explode">|</span>
- <a class="layui-btn layui-btn-sm layui-btn-disabled">添 加</a>
- {/if}
- {if auth("edit")}
- <a data-dbclick class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$cv.id}&pid={$cv.id}'>编 辑</a>
- {/if}
- {if $cv.status eq 1 and auth("forbid")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$cv.id};status#0" >禁 用</a>
- {elseif auth("resume")}
- <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$cv.id};status#1" >启 用</a>
- {/if}
- {if auth("remove")}
- <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$cv.id}">删 除</a>
- {/if}
- </td>
- {/foreach}
- {/foreach}
- {/foreach}
- </tbody>
- </table>
- {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
- </div>
- {/block}
|