index.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. <?php /* <form action="" class="form-inline">
  15. <i class="fa fa-search" style="margin-right: 10px;"></i>
  16. <select name="is_show" aria-controls="editable" class="form-control input-sm">
  17. <option value="">是否显示</option>
  18. <option value="1" {eq name="params.is_show" value="1"}selected="selected"{/eq}>显示</option>
  19. <option value="0" {eq name="params.is_show" value="0"}selected="selected"{/eq}>不显示</option>
  20. </select>
  21. <select name="access" aria-controls="editable" class="form-control input-sm">
  22. <option value="">子管理员是否可用</option>
  23. <option value="1" {eq name="params.access" value="1"}selected="selected"{/eq}>可用</option>
  24. <option value="0" {eq name="params.access" value="0"}selected="selected"{/eq}>不可用</option>
  25. </select>
  26. <div class="input-group">
  27. <input type="text" name="keyword" value="{$params.keyword}" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn">
  28. <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
  29. </div>
  30. </form> */ ?>
  31. <form action="" class="form-inline">
  32. <select name="status" aria-controls="editable" class="form-control input-sm">
  33. <option value="">状态</option>
  34. <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>显示</option>
  35. <option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>不显示</option>
  36. </select>
  37. <div class="input-group">
  38. <input type="text" name="role_name" value="{$where.role_name}" placeholder="请输入身份昵称" class="input-sm form-control"> <span class="input-group-btn">
  39. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. <div class="table-responsive">
  45. <table class="table table-striped table-bordered">
  46. <thead>
  47. <tr>
  48. <th class="text-center">编号</th>
  49. <th class="text-center">身份昵称</th>
  50. <th class="text-center">权限</th>
  51. <th class="text-center">状态</th>
  52. <th class="text-center">操作</th>
  53. </tr>
  54. </thead>
  55. <tbody class="">
  56. {volist name="list" id="vo"}
  57. <tr>
  58. <td class="text-center">
  59. {$vo.id}
  60. </td>
  61. <td class="text-center">
  62. {$vo.role_name}
  63. </td>
  64. <td class="text-center" style="width: 70%;">
  65. {$vo.rules}
  66. </td>
  67. <td class="text-center">
  68. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  69. </td>
  70. <td class="text-center">
  71. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  72. <button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  73. </button>
  74. </td>
  75. </tr>
  76. {/volist}
  77. </tbody>
  78. </table>
  79. </div>
  80. {include file="public/inner_page"}
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. {/block}
  86. {block name="script"}
  87. <script>
  88. $('.btn-danger').on('click',function(){
  89. window.t = $(this);
  90. var _this = $(this),url =_this.data('url');
  91. $eb.$swal('delete',function(){
  92. $eb.axios.get(url).then(function(res){
  93. console.log(res);
  94. if(res.status == 200 && res.data.code == 200) {
  95. $eb.$swal('success',res.data.msg);
  96. _this.parents('tr').remove();
  97. }else
  98. return Promise.reject(res.data.msg || '删除失败')
  99. }).catch(function(err){
  100. $eb.$swal('error',err);
  101. });
  102. })
  103. });
  104. </script>
  105. {/block}