index.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. <select name="status" aria-controls="editable" class="form-control input-sm">
  16. <option value="">是否有效</option>
  17. <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>开启</option>
  18. <option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>关闭</option>
  19. </select>
  20. <div class="input-group">
  21. <input type="text" name="name" value="{$where.name}" placeholder="请输入模板名" class="input-sm form-control"> <span class="input-group-btn">
  22. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. <div class="table-responsive">
  28. <table class="table table-striped table-bordered">
  29. <thead>
  30. <tr>
  31. <th class="text-center">编号</th>
  32. <th class="text-center">模板编号</th>
  33. <th class="text-center">模板ID</th>
  34. <th class="text-center">模板名</th>
  35. <th class="text-center">回复内容</th>
  36. <th class="text-center">状态</th>
  37. <th class="text-center">添加时间</th>
  38. <th class="text-center">操作</th>
  39. </tr>
  40. </thead>
  41. <tbody class="">
  42. {volist name="list" id="vo"}
  43. <tr>
  44. <td class="text-center">
  45. {$vo.id}
  46. </td>
  47. <td class="text-center">
  48. {$vo.tempkey}
  49. </td>
  50. <td class="text-center">
  51. {$vo.tempid}
  52. </td>
  53. <td class="text-center">
  54. {$vo.name}
  55. </td>
  56. <td class="text-center">
  57. <pre>{$vo.content}</pre>
  58. </td>
  59. <td class="text-center">
  60. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  61. </td>
  62. <td class="text-center">
  63. {$vo.add_time|date='Y-m-d H:i:s'}
  64. </td>
  65. <td class="text-center">
  66. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}',{h:400})"><i class="fa fa-edit"></i>编辑</button>
  67. <button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  68. </button>
  69. </td>
  70. </tr>
  71. {/volist}
  72. </tbody>
  73. </table>
  74. </div>
  75. {include file="public/inner_page"}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {/block}
  81. {block name="script"}
  82. <script>
  83. $('.btn-danger').on('click',function(){
  84. window.t = $(this);
  85. var _this = $(this),url =_this.data('url');
  86. $eb.$swal('delete',function(){
  87. $eb.axios.get(url).then(function(res){
  88. console.log(res);
  89. if(res.status == 200 && res.data.code == 200) {
  90. $eb.$swal('success',res.data.msg);
  91. _this.parents('tr').remove();
  92. }else
  93. return Promise.reject(res.data.msg || '删除失败')
  94. }).catch(function(err){
  95. $eb.$swal('error',err);
  96. });
  97. });
  98. });
  99. </script>
  100. {/block}