index.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <a type="button" class="btn btn-w-m btn-primary" href="{:Url('index')}">规则首页</a>
  8. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{$addurl}')">添加规则</button>
  9. <div class="ibox-tools">
  10. </div>
  11. </div>
  12. <div class="ibox-content">
  13. <div class="row">
  14. <div class="m-b m-l">
  15. <form action="" class="form-inline">
  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. <?php
  22. /**<select name="access" aria-controls="editable" class="form-control input-sm">
  23. <option value="">子管理员是否可用</option>
  24. <option value="1" {eq name="params.access" value="1"}selected="selected"{/eq}>可用</option>
  25. <option value="0" {eq name="params.access" value="0"}selected="selected"{/eq}>不可用</option>
  26. </select>
  27. **/?>
  28. <div class="input-group">
  29. <input type="text" name="keyword" value="{$params.keyword}" placeholder="请输入关键词/规则ID/父级ID" class="input-sm form-control"> <span class="input-group-btn">
  30. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  31. </div>
  32. </form>
  33. </div>
  34. </div>
  35. <div class="table-responsive">
  36. <table class="table table-striped table-bordered">
  37. <thead>
  38. <tr>
  39. <th class="text-center">编号</th>
  40. <th class="text-center">按钮名</th>
  41. <th class="text-center">父级</th>
  42. <th class="text-center">模块名</th>
  43. <th class="text-center">控制器名</th>
  44. <th class="text-center">方法名</th>
  45. <th class="text-center">是否菜单</th>
  46. <!-- <th class="text-center">子管理员可用</th>-->
  47. <th class="text-center">操作</th>
  48. </tr>
  49. </thead>
  50. <tbody class="">
  51. {volist name="list" id="vo"}
  52. <tr>
  53. <td class="text-center">
  54. {$vo.id}
  55. </td>
  56. <td class="text-center">
  57. <a href="{:Url('index',array('pid'=>$vo['id']))}">{$vo.menu_name}</a>
  58. </td>
  59. <td class="text-center">
  60. {$vo.pid}
  61. </td>
  62. <td class="text-center">
  63. {$vo.module}
  64. </td>
  65. <td class="text-center">
  66. {$vo.controller}
  67. </td>
  68. <td class="text-center">
  69. {$vo.action}
  70. </td>
  71. <td class="text-center">
  72. <i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  73. </td>
  74. <!--<td class="text-center">
  75. <i class="fa {eq name='vo.access' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  76. </td>-->
  77. <td class="text-center">
  78. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame(this.innerText,'{:Url('create',array('cid'=>$vo['id']))}')"><i class="fa fa-plus-square"></i> 添加子菜单</button>
  79. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame(this.innerText,'{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  80. <button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  81. </button>
  82. </td>
  83. </tr>
  84. {/volist}
  85. </tbody>
  86. </table>
  87. </div>
  88. {include file="public/inner_page"}
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. {/block}
  94. {block name="script"}
  95. <script>
  96. $('.btn-danger').on('click',function(){
  97. var _this = $(this),url =_this.data('url');
  98. $eb.$swal('delete',function(){
  99. $eb.axios.get(url).then(function(res){
  100. console.log(res);
  101. if(res.status == 200 && res.data.code == 200) {
  102. $eb.$swal('success',res.data.msg);
  103. _this.parents('tr').remove();
  104. }else
  105. return Promise.reject(res.data.msg || '删除失败')
  106. }).catch(function(err){
  107. $eb.$swal('error',err);
  108. });
  109. })
  110. });
  111. </script>
  112. {/block}