second.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-action='{:url("remove")}' data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
  4. <a href="javascript:history.go(-1);" data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
  5. <button data-modal='{:url("add")}?pid={$Think.get.pid|default="0"}&lev=2' data-title="添加分类" class='layui-btn layui-btn-sm layui-btn-primary'>添加分类</button>
  6. {/block}
  7. {block name="content"}
  8. <div class="think-box-shadow">
  9. <fieldset>
  10. <legend>条件搜索</legend>
  11. <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
  12. <div class="layui-form-item layui-inline">
  13. <label class="layui-form-label">名称</label>
  14. <div class="layui-input-inline">
  15. <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入分类名称" class="layui-input">
  16. </div>
  17. </div>
  18. <div class="layui-form-item layui-inline">
  19. <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
  20. </div>
  21. </form>
  22. <script>form.render()</script>
  23. </fieldset>
  24. <table class="layui-table margin-top-20" lay-skin="line">
  25. <thead>
  26. <tr>
  27. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  28. <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
  29. <th class='text-left nowrap'>ID</th>
  30. <th class='text-left nowrap'>名称</th>
  31. <th class='text-left nowrap'>状态</th>
  32. <th class="text-left" style="width: 20%">操作</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. {foreach $list as $key=>$vo}
  37. <tr>
  38. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  39. <td class='list-table-sort-td'><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"></td>
  40. <td class='text-left nowrap'>{$vo.id|default=''}</td>
  41. <td class='text-left nowrap'>{$vo.title|default=''}</td>
  42. <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
  43. <td class='text-left' style="width: 20%">
  44. <a data-title="编辑分类" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
  45. {if $vo.lev == 2} <a data-title="查看" class="layui-btn layui-btn-xs" data-open='{:url("third")}?pid={$vo.id}'>三级分类</a>{/if}
  46. {if $vo.status == 1}
  47. <span class="layui-btn layui-btn-xs layui-btn-warm" onclick="btn_confirm('禁用','forbid','{$vo.id}');" >禁 用</span>
  48. {else}
  49. <span class="layui-btn layui-btn-xs layui-btn-xs" onclick="btn_confirm('启用','resume','{$vo.id}');">启 用</span>
  50. {/if}
  51. <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','remove','{$vo.id}');">删 除</span>
  52. </td>
  53. </tr>
  54. {/foreach}
  55. </tbody>
  56. </table>
  57. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  58. </div>
  59. <script>
  60. function btn_confirm(msg,fun,id) {
  61. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  62. var url = "/operate/recruit_cate/"+fun;
  63. layer.closeAll();
  64. $.ajax({
  65. type: "post",
  66. url: url,
  67. data: {id:id},
  68. dataType: "json",
  69. async: false,
  70. success: function (data) {
  71. layer.msg(data.info);
  72. setTimeout(function () {
  73. window.location.reload();
  74. },1000)
  75. }
  76. });
  77. });
  78. }
  79. </script>
  80. {/block}