index.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {extend name='main'}
  2. {block name="button"}
  3. <!--{if auth("add")}-->
  4. <button data-modal='{:url("add")}' data-title="添加权限" class='layui-btn layui-btn-sm layui-btn-primary'>添加权限</button>
  5. <!--{/if}-->
  6. <!--{if auth("remove")}-->
  7. <button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些权限吗?" class='layui-btn layui-btn-sm layui-btn-primary'>删除权限</button>
  8. <!--{/if}-->
  9. {/block}
  10. {block name="content"}
  11. <div class="think-box-shadow table-block">
  12. {include file='auth/index_search'}
  13. <table class="layui-table margin-top-10" lay-skin="line">
  14. {notempty name='list'}
  15. <thead>
  16. <tr>
  17. <th class='list-table-check-td think-checkbox'>
  18. <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
  19. </th>
  20. <th class='text-left nowrap'>权限名称</th>
  21. <th class='text-left nowrap'>权限描述</th>
  22. <th class='text-left nowrap'>创建时间</th>
  23. <th class="text-center nowrap">使用状态</th>
  24. <th></th>
  25. </tr>
  26. </thead>
  27. {/notempty}
  28. <tbody>
  29. {foreach $list as $key => $vo}
  30. <tr data-dbclick>
  31. <td class='list-table-check-td think-checkbox'>
  32. <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
  33. </td>
  34. <td class='text-left'>{$vo.title|default='-'}</td>
  35. <td class='text-left'>{$vo.desc|default="没有写描述哦!"}</td>
  36. <td class="text-left nowrap">{$vo.create_at|format_datetime}</td>
  37. <td class='text-left nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">已激活</span>{/eq}</td>
  38. <td class='text-center nowrap'>
  39. <!--{if auth("edit")}-->
  40. <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑权限" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  41. <!--{/if}-->
  42. <!--{if auth("apply")}-->
  43. <a class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("apply")}?id={$vo.id}'>授 权</a>
  44. <!--{/if}-->
  45. <!--{if $vo.status eq 1 and auth("state")}-->
  46. <a class="layui-btn layui-btn-warm layui-btn-sm" data-confirm="确定禁用该权限吗?" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
  47. <!--{elseif $vo.status eq 0 and auth("state")}-->
  48. <a class="layui-btn layui-btn-warm layui-btn-sm" data-confirm="确定启用该权限吗?" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">激 活</a>
  49. <!--{/if}-->
  50. <!--{if auth("remove")}-->
  51. <a class="layui-btn layui-btn-danger layui-btn-sm" data-confirm="确定要删除权限吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
  52. <!--{/if}-->
  53. </td>
  54. </tr>
  55. {/foreach}
  56. </tbody>
  57. </table>
  58. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  59. </div>
  60. {/block}