index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {extend name='admin@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">
  12. {include file='auth/index_search'}
  13. <table class="layui-table" 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='list-table-sort-td'>
  21. <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
  22. </th>
  23. <th class='text-left nowrap'>权限名称</th>
  24. <th class='text-left nowrap'>权限路径</th>
  25. <th class='text-center nowrap'>使用状态</th>
  26. <th class='text-left nowrap'>登录时间</th>
  27. <th class='text-left nowrap'></th>
  28. </tr>
  29. </thead>
  30. {/notempty}
  31. <tbody>
  32. {foreach $list as $key=>$vo}
  33. <tr data-dbclick>
  34. <td class='list-table-check-td think-checkbox'>
  35. <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
  36. </td>
  37. <td class='list-table-sort-td'>
  38. <label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></label>
  39. </td>
  40. <td class='text-left nowrap'>{$vo.title|default=''}</td>
  41. <td class='text-left nowrap'>{$vo.path|nl2br|raw}</td>
  42. <td class='text-center nowrap'>
  43. {eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{/eq}
  44. {eq name='vo.status' value='1'}<span class="color-green">使用中</span>{/eq}
  45. </td>
  46. <td class='text-left nowrap'>{$vo.create_at|format_datetime}</td>
  47. <td class='text-left nowrap'>
  48. {if auth("edit")}
  49. <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑仓库权限" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  50. {/if}
  51. {if auth("state") and $vo.status neq 0}
  52. <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
  53. {elseif auth("state") and $vo.status neq 1 }
  54. <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">启 用</a>
  55. {/if}
  56. {if auth("remove")}
  57. <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该权限吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('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}