index.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-csrf="{:systoken('remove')}" data-rule="id#{key}" 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. {empty name='list'}
  13. <blockquote class="layui-elem-quote">没 有 记 录 哦!</blockquote>
  14. {else}
  15. <table class="layui-table" lay-skin="line">
  16. <thead>
  17. <tr>
  18. <th class='list-table-check-td think-checkbox'>
  19. <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
  20. </th>
  21. <th class='list-table-sort-td'>
  22. <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
  23. </th>
  24. <th class='text-center' style="width:30px"></th>
  25. <th style="width:180px"></th>
  26. <th class='layui-hide-xs' style="width:180px"></th>
  27. <th colspan="2"></th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {foreach $list as $key=>$vo}
  32. <tr>
  33. <td class='list-table-check-td think-checkbox'>
  34. <input class="list-check-box" value='{$vo.ids}' type='checkbox'>
  35. </td>
  36. <td class='list-table-sort-td'>
  37. <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">
  38. </td>
  39. <td class='text-center'><i class="{$vo.icon} font-s18"></i></td>
  40. <td class="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.title}</td>
  41. <td class='layui-hide-xs'>{$vo.url}</td>
  42. <td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}</td>
  43. <td class='text-center nowrap notselect'>
  44. {if auth("add")}
  45. <span class="text-explode">|</span>
  46. <!--{if $vo.spt < 2}-->
  47. <a class="layui-btn layui-btn-xs layui-btn-primary" data-title="添加子菜单" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
  48. <!--{else}-->
  49. <a class="layui-btn layui-btn-xs layui-btn-disabled">添 加</a>
  50. <!--{/if}-->
  51. {/if}
  52. {if auth("edit")}
  53. <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑菜单" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  54. {/if}
  55. {if $vo.status eq 1 and auth("forbid")}
  56. <a class="layui-btn layui-btn-warm layui-btn-xs" data-confirm="确定要禁用菜单吗?" data-action="{:url('forbid')}" data-value="id#{$vo.ids};status#0" data-csrf="{:systoken('forbid')}">禁 用</a>
  57. {elseif auth("resume")}
  58. <a class="layui-btn layui-btn-warm layui-btn-xs" data-action="{:url('resume')}" data-value="id#{$vo.ids};status#1" data-csrf="{:systoken('resume')}">启 用</a>
  59. {/if}
  60. {if auth("remove")}
  61. <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.ids}" data-csrf="{:systoken('remove')}">删 除</a>
  62. {/if}
  63. </td>
  64. </tr>
  65. {/foreach}
  66. </tbody>
  67. </table>
  68. {/empty}
  69. </div>
  70. {/block}