index.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <article class="cl pd-20">
  2. <div class="cl pd-5 bg-1 bk-gray">
  3. <span class="l">
  4. <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
  5. <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
  6. <a href="javascript:save(0);" class="btn btn-primary radius">
  7. <i class="Hui-iconfont">&#xe600;</i> 添加管理员</a>
  8. </span>
  9. </div>
  10. <div class="mt-10" style="min-width:800px;">
  11. <table class="table table-border table-bordered table-bg">
  12. <thead>
  13. <tr class="text-c">
  14. <th width="25">
  15. <input type="checkbox" name="allcheck" value="">
  16. </th>
  17. <th width="40px">ID</th>
  18. <th width="120px">登录名</th>
  19. <th width="120px">用户组</th>
  20. <th width="120px">姓名</th>
  21. <th width="120px">昵称</th>
  22. <th width="160px">邮箱</th>
  23. <th width="80px">登录次数</th>
  24. <th width="140px">最后登录时间</th>
  25. <th width="120px">最后登录ip</th>
  26. <th width="140px">创建时间</th>
  27. <th>操作</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {foreach $list as $val}
  32. <tr class="text-c">
  33. <td>
  34. <input type="checkbox" value="{$val.userid}" name="checkbox[]">
  35. </td>
  36. <td>{$val.userid}</td>
  37. <td>{$val.username}</td>
  38. <td>{$val.rolename}</td>
  39. <td>{$val.truename}</td>
  40. <td>{$val.nickname}</td>
  41. <td>{$val.email}</td>
  42. <td>{$val.login_num}</td>
  43. <td>{$val.per_time}</td>
  44. <td>{$val.per_ip}</td>
  45. <td>{$val.create_time}</td>
  46. <td class="td-manage">
  47. <a title="编辑" href="javascript:save({$val.userid});" style="text-decoration:none">
  48. <i class="Hui-iconfont">&#xe6df;</i>
  49. </a>
  50. <a title="删除" href="javascript:;" onclick="del(this,'{$val.userid}')" class="ml-5"
  51. style="text-decoration:none">
  52. <i class="Hui-iconfont">&#xe6e2;</i>
  53. </a>
  54. </td>
  55. </tr>
  56. {/foreach}
  57. </tbody>
  58. </table>
  59. </div>
  60. </article>
  61. <!--请在下方写此页面业务相关的脚本-->
  62. <script type="text/javascript">
  63. function save(id) {
  64. var title = id == 0 ? '添加管理员' : '修改管理员'
  65. var url = "{:url('save')}" + "?_layer=true&id=" + id
  66. layer_show(title, url, 800, 600);
  67. }
  68. // 列表删除条目
  69. function del(obj, id) {
  70. layer.confirm('确认要删除吗?', function (index) {
  71. $.post('delete', {
  72. 'id': id
  73. }, function (data) {
  74. if (data.code == 1) {
  75. $(obj).parents("tr").remove();
  76. layer.msg(data.msg, {
  77. icon: 1,
  78. time: 1000
  79. });
  80. } else {
  81. layer.msg(data.msg, {
  82. icon: 5,
  83. time: 2000
  84. });
  85. return false;
  86. }
  87. }, 'json');
  88. });
  89. }
  90. // 批量删除条目
  91. function del_all() {
  92. var checkbox = $('.text-c input[name="checkbox[]"]');
  93. var ids = new Array();
  94. checkbox.each(function (x) {
  95. if (this.checked)
  96. ids.push(this.value);
  97. })
  98. // console.log(ids);
  99. layer.confirm('确认要删除吗?', function (index) {
  100. $.post('delete', {
  101. 'id': ids
  102. }, function (data) {
  103. if (data.code == 1) {
  104. layer.msg(data.msg, {
  105. icon: 1,
  106. time: 1000
  107. });
  108. checkbox.each(function (x) {
  109. if (this.checked)
  110. $(this).parents("tr").remove();
  111. })
  112. } else {
  113. layer.msg(data.msg, {
  114. icon: 5,
  115. time: 1000
  116. });
  117. }
  118. }, 'json')
  119. });
  120. }
  121. </script>
  122. <!--/请在上方写此页面业务相关的脚本-->