index.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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="roles" aria-controls="editable" class="form-control input-sm">
  33. <option value="">身份</option>
  34. {volist name="$role" id="vo" key="k"}
  35. <option value="{$key}" {eq name="where.roles" value="$key"}selected="selected"{/eq}>{$vo}</option>
  36. {/volist}
  37. </select>
  38. <div class="input-group">
  39. <input type="text" name="name" value="{$where.name}" placeholder="请输入姓名或者账号" class="input-sm form-control"> <span class="input-group-btn">
  40. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search"></i>搜索</button> </span>
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. <div class="table-responsive">
  46. <table class="table table-striped table-bordered">
  47. <thead>
  48. <tr>
  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. <th class="text-center">最后一次登陆ip</th>
  54. <th class="text-center">开启</th>
  55. <th class="text-center">操作</th>
  56. </tr>
  57. </thead>
  58. <tbody class="">
  59. {volist name="list" id="vo"}
  60. <tr>
  61. <td class="text-center">
  62. {$vo.real_name}
  63. </td>
  64. <td class="text-center">
  65. {$vo.account}
  66. </td>
  67. <td class="text-center">
  68. {$vo.roles}
  69. </td>
  70. <td class="text-center">
  71. {$vo.last_time? date('Y/m/d H:i',$vo.last_time) : ''}
  72. </td>
  73. <td class="text-center">
  74. {$vo.last_ip}
  75. </td>
  76. <td class="text-center">
  77. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  78. </td>
  79. <td class="text-center">
  80. <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>
  81. <button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  82. </button>
  83. </td>
  84. </tr>
  85. {/volist}
  86. </tbody>
  87. </table>
  88. </div>
  89. {include file="public/inner_page"}
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. {/block}
  95. {block name="script"}
  96. <script>
  97. $('.btn-danger').on('click',function(){
  98. window.t = $(this);
  99. var _this = $(this),url =_this.data('url');
  100. $eb.$swal('delete',function(){
  101. $eb.axios.get(url).then(function(res){
  102. console.log(res);
  103. if(res.status == 200 && res.data.code == 200) {
  104. $eb.$swal('success',res.data.msg);
  105. _this.parents('tr').remove();
  106. }else
  107. return Promise.reject(res.data.msg || '删除失败')
  108. }).catch(function(err){
  109. $eb.$swal('error',err);
  110. });
  111. })
  112. });
  113. </script>
  114. {/block}