index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {extend name='main'}
  2. {block name="button"}
  3. <!--{if $type eq 'index' and auth("add")}-->
  4. <button data-modal='{:url("add")}' data-title="添加菜单" class='layui-btn layui-btn-sm layui-btn-primary'>添加菜单</button>
  5. <!--{/if}-->
  6. <!--{if $type eq 'index' and auth("state")}-->
  7. <button data-action='{:url("state")}' data-csrf="{:systoken('state')}" data-rule="id#{key};status#0" class='layui-btn layui-btn-sm layui-btn-primary'>禁用菜单</button>
  8. <!--{/if}-->
  9. <!--{if $type eq 'recycle' and auth("state")}-->
  10. <button data-action='{:url("state")}' data-csrf="{:systoken('state')}" data-rule="id#{key};status#1" class='layui-btn layui-btn-sm layui-btn-primary'>激活菜单</button>
  11. <!--{/if}-->
  12. {/block}
  13. {block name="content"}
  14. <div class="layui-tab layui-tab-card">
  15. <ul class="layui-tab-title">
  16. {foreach ['index'=>'系统菜单','recycle'=>'回 收 站'] as $k=>$v}
  17. {if isset($type) and $type eq $k}
  18. <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
  19. {else}
  20. <li data-open="{:url('index')}?type={$k}">{$v}</li>
  21. {/if}{/foreach}
  22. </ul>
  23. <div class="layui-tab-content">
  24. {empty name='list'}
  25. <div class="notdata">没有记录哦</div>
  26. {else}
  27. <table class="layui-table" lay-skin="line">
  28. <thead>
  29. <tr>
  30. <th class='list-table-check-td think-checkbox'>
  31. <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
  32. </th>
  33. <th class='list-table-sort-td'>
  34. <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
  35. </th>
  36. <th class='text-center' style="width:30px"></th>
  37. <th style="width:230px"></th>
  38. <th class='layui-hide-xs' style="width:180px"></th>
  39. <th colspan="2"></th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. {foreach $list as $key=>$vo}
  44. <tr data-dbclick class="{if ($type eq 'index' and $vo.status eq 0)}layui-hide{/if}">
  45. <td class='list-table-check-td think-checkbox'>
  46. <label><input class="list-check-box" value='{$vo.ids}' type='checkbox'></label>
  47. </td>
  48. <td class='list-table-sort-td'>
  49. <input data-action-blur="{:sysuri()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
  50. </td>
  51. <td class='text-center'><i class="{$vo.icon} font-s18"></i></td>
  52. <td class="nowrap"><span class="color-desc">{$vo.spl|raw}</span>{$vo.title}</td>
  53. <td class='layui-hide-xs'>{$vo.url}</td>
  54. <td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">已激活</span>{/eq}</td>
  55. <td class='text-center nowrap notselect'>
  56. {if isset($type) and $type eq 'index'}
  57. {if auth("add")}
  58. <!--{if $vo.spt < 2}-->
  59. <a class="layui-btn layui-btn-sm layui-btn-primary" data-title="添加子菜单" data-modal='{:url("add")}?pid={$vo.id}'>添 加</a>
  60. <!--{else}-->
  61. <a class="layui-btn layui-btn-sm layui-btn-disabled">添 加</a>
  62. <!--{/if}-->
  63. {/if}
  64. <!--{if auth("edit")}-->
  65. <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑菜单" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  66. <!--{/if}-->
  67. <!--{if $vo.status eq 1 and auth("state")}-->
  68. <a class="layui-btn layui-btn-warm layui-btn-sm" data-confirm="确定要禁用菜单吗?" data-action="{:url('state')}" data-value="id#{$vo.ids};status#0" data-csrf="{:systoken('state')}">禁 用</a>
  69. <!--{/if}-->
  70. {else}
  71. <!--{if auth("state")}-->
  72. <a class="layui-btn layui-btn-warm layui-btn-sm" data-confirm="确定要激活菜单吗?" data-action="{:url('state')}" data-value="id#{$vo.ids};status#1" data-csrf="{:systoken('state')}">激 活</a>
  73. <!--{/if}-->
  74. <!--{if auth("remove") and ($vo.spc<1 or $vo.status<1)}-->
  75. <a class="layui-btn layui-btn-danger layui-btn-sm" data-confirm="确定要删除菜单吗?" data-action="{:url('remove')}" data-value="id#{$vo.ids}" data-csrf="{:systoken('remove')}">删 除</a>
  76. <!--{/if}-->
  77. <!--{if auth("remove") and $vo.spc>0 and $vo.status>0}-->
  78. <a class="layui-btn layui-btn-disabled layui-btn-sm">删 除</a>
  79. <!--{/if}-->
  80. {/if}
  81. </td>
  82. </tr>
  83. {/foreach}
  84. </tbody>
  85. </table>
  86. {/empty}
  87. </div>
  88. </div>
  89. {/block}