index.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {extend name='main'}
  2. {block name="button"}
  3. {if auth("admin/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("admin/auth/remove")}
  7. <button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('admin/auth/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">
  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-center nowrap">使用状态</th>
  23. <th></th>
  24. </tr>
  25. </thead>
  26. {/notempty}
  27. <tbody>
  28. {foreach $list as $key=>$vo}
  29. <tr data-dbclick>
  30. <td class='list-table-check-td think-checkbox'>
  31. <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
  32. </td>
  33. <td class='text-left'>
  34. 权限名称:{$vo.title|default='-'}<br>
  35. <p class="color-desc">权限描述:{$vo.desc|default="没有写描述哦!"}</p>
  36. </td>
  37. <td class="text-left nowrap">
  38. 日期:{$vo.create_at|format_datetime|str_replace=' ','<br><span class="color-desc">时间:',###|raw}</span>
  39. </td>
  40. <td class='text-center nowrap'>
  41. {eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}
  42. </td>
  43. <td class='text-center nowrap'>
  44. {if auth("admin/auth/edit")}
  45. <span class="text-explode">|</span>
  46. <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑权限" data-modal='{:url("admin/auth/edit")}?id={$vo.id}'>编 辑</a>
  47. {/if}
  48. {if auth("admin/auth/apply")}
  49. <a class="layui-btn layui-btn-normal layui-btn-sm" data-open='{:url("admin/auth/apply")}?id={$vo.id}'>授 权</a>
  50. {/if}
  51. {if $vo.status eq 1 and auth("admin/auth/forbid")}
  52. <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('admin/auth/forbid')}">禁 用</a>
  53. {elseif $vo.status eq 0 and auth("admin/auth/resume")}
  54. <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('admin/auth/resume')}">启 用</a>
  55. {/if}
  56. {if auth("admin/auth/remove")}
  57. <a class="layui-btn layui-btn-danger layui-btn-sm" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('admin/auth/remove')}">删 除</a>
  58. {/if}
  59. </td>
  60. </tr>
  61. {/foreach}
  62. </tbody>
  63. </table>
  64. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  65. </div>
  66. {/block}