group.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
  4. <script src="{__PLUG_PATH}moment.js"></script>
  5. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  6. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  7. <script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
  8. {/block}
  9. {block name="content"}
  10. <div class="row">
  11. <div class="col-sm-12">
  12. <div class="ibox">
  13. <div class="ibox-title">
  14. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create_group')}',{w:350,h:180})">添加分组</button>
  15. <button type="button" style="float: right;" class="btn btn-w-m btn-primary" onclick="location.href='{:Url('group',['refresh'=>1])}'">
  16. <i class="fa fa-refresh"></i>
  17. 立即同步
  18. </button>
  19. </div>
  20. <div class="ibox-content">
  21. <div class="row">
  22. <div class="m-b m-l">
  23. </div>
  24. </div>
  25. <div class="table-responsive">
  26. <table class="table table-striped table-bordered">
  27. <thead>
  28. <tr>
  29. <th class="text-center">编号</th>
  30. <th class="text-center">标签名</th>
  31. <th class="text-center">人数</th>
  32. <th class="text-center" width="180">操作</th>
  33. </tr>
  34. </thead>
  35. <tbody class="">
  36. {volist name="list" id="vo"}
  37. <tr>
  38. <td class="text-center">
  39. {$vo.id}
  40. </td>
  41. <td class="text-center">
  42. {$vo.name}
  43. </td>
  44. <td class="text-center">
  45. {$vo.count}
  46. </td>
  47. <td class="text-center">
  48. {gt name="vo.id" value="99"}
  49. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit_group',['id'=>$vo['id']])}',{w:350,h:180})"><i class="fa fa-edit"></i> 编辑</button>
  50. <button class="btn btn-danger btn-xs " data-url="{:Url('delete_group',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  51. </button>
  52. {/gt}
  53. </td>
  54. </tr>
  55. {/volist}
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. {/block}
  64. {block name="script"}
  65. <script>
  66. $('.btn-danger').on('click',function(){
  67. window.t = $(this);
  68. var _this = $(this),url =_this.data('url');
  69. $eb.$swal('delete',function(){
  70. $eb.axios.get(url).then(function(res){
  71. console.log(res);
  72. if(res.status == 200 && res.data.code == 200) {
  73. $eb.$swal('success',res.data.msg);
  74. _this.parents('tr').remove();
  75. }else
  76. return Promise.reject(res.data.msg || '删除失败')
  77. }).catch(function(err){
  78. $eb.$swal('error',err);
  79. });
  80. })
  81. });
  82. </script>
  83. {/block}