group.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {include file="public/header"}
  2. <form action="group" method="GET" class="form-inline">
  3. <button type="button" class="btn btn-primary" id="addgroup">添加小组</button>
  4. </form>
  5. <div class="table-responsive" style="padding-top: 10px;">
  6. <table class="table table-striped" border='1'>
  7. <thead>
  8. <tr>
  9. <th style="text-align: center;">分组编号</th>
  10. <th style="text-align: center;">分组名</th>
  11. <th style="text-align: center;">管理区域</th>
  12. <th style="text-align: center;">操作</th>
  13. </tr>
  14. </thead>
  15. <tbody style="text-align: center;">
  16. {volist name="group_info" id="vo"}
  17. <tr>
  18. <td><b>{$vo.id}</b></td>
  19. <td>
  20. {if condition = "$vo.name eq null"}
  21. 暂无
  22. {else/}
  23. {$vo.name}
  24. {/if}
  25. </td>
  26. <td>
  27. {if condition = "$vo.regionName eq null"}
  28. 暂无
  29. {else/}
  30. {foreach $vo.regionName as $v}
  31. {$v['username']} &nbsp;
  32. {/foreach}
  33. {/if}
  34. </td>
  35. <td>
  36. <button data-groupid="{$vo['id']}" class="btn btn-xs btn-danger buttoneidt">编辑</button>
  37. <button data-groupid="{$vo['id']}" class="btn btn-xs btn-warning del" >删除</button>
  38. </td>
  39. </tr>
  40. {/volist}
  41. </tbody>
  42. <thead>
  43. <tr>
  44. <th style="text-align: center;">分组编号</th>
  45. <th style="text-align: center;">分组名</th>
  46. <th style="text-align: center;">管理区域</th>
  47. <th style="text-align: center;">操作</th>
  48. </tr>
  49. </thead>
  50. </table>
  51. </div>
  52. <!-- 分页的渲染函数 -->
  53. <div style="text-align:center;">
  54. {$group_info->render()}
  55. </div>
  56. <script src="__LOGIN__/js/jquery.min.js"></script>
  57. <script>
  58. $(function () {
  59. $('.buttoneidt').click(function () {
  60. let groupid = $(this).attr('data-groupid');
  61. window.location.href = "__URL__/edit_group?group_id=" + groupid; //编辑分组信息
  62. });
  63. $('#addgroup').click(function(){
  64. window.location.href = "__URL__/add_group"; //添加分组
  65. });
  66. $('.del').click(function () {
  67. let groupid = $(this).attr('data-groupid');
  68. window.location.href = "/admin/index/del_group?group_id=" + groupid;
  69. })
  70. });
  71. </script>