index.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox">
  6. <div class="ibox-title">
  7. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加通知模板</button>
  8. <div class="ibox-tools">
  9. </div>
  10. </div>
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline">
  15. <div class="input-group">
  16. <input type="text" name="key" value="" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn">
  17. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. <div class="table-responsive">
  23. <table class="table table-striped table-bordered">
  24. <thead>
  25. <tr>
  26. <th class="text-center">编号</th>
  27. <th class="text-center">标题</th>
  28. <th class="text-center">关键字</th>
  29. <th class="text-center">模板</th>
  30. <th class="text-center">发送管理员</th>
  31. <th class="text-center">状态</th>
  32. <th class="text-center">操作</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.title}
  43. </td>
  44. <td class="text-center">
  45. {$vo.type}
  46. </td>
  47. <td class="text-center">
  48. {$vo.template}
  49. </td>
  50. <td class="text-center">
  51. {$vo.push_admin_name}
  52. </td>
  53. <td class="text-center">
  54. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  55. </td>
  56. <td class="text-center">
  57. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
  58. <button class="btn btn-warning btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-warning"></i> 删除
  59. </button>
  60. </td>
  61. </tr>
  62. {/volist}
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. {/block}
  71. {block name="script"}
  72. <script>
  73. $('.btn-warning').on('click',function(){
  74. var _this = $(this),url =_this.data('url');
  75. $eb.$swal('delete',function(){
  76. $eb.axios.get(url).then(function(res){
  77. console.log(res);
  78. if(res.status == 200 && res.data.code == 200) {
  79. $eb.$swal('success',res.data.msg);
  80. _this.parents('tr').remove();
  81. }else
  82. return Promise.reject(res.data.msg || '删除失败')
  83. }).catch(function(err){
  84. $eb.$swal('error',err);
  85. });
  86. })
  87. });
  88. </script>
  89. {/block}