auth.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .submit-btn{
  5. position: fixed;
  6. z-index: 10;
  7. top: 3px;
  8. right: 5px;
  9. }
  10. .submit-btn2{
  11. position: fixed;
  12. z-index: 10;
  13. top: 3px;
  14. right: 90px;
  15. }
  16. .panel-body{
  17. height: 90%;
  18. overflow: auto;
  19. }
  20. </style>
  21. <div class="tabs-container">
  22. <ul class="nav nav-tabs">
  23. <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">后台权限</a>
  24. </li>
  25. <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">APP权限</a>
  26. </li>
  27. </ul>
  28. <form method="post" action="{:url('auth')}" class="form-horizontal">
  29. <input type="hidden" name="rolesId" value="{$rolesId}">
  30. <div class="tab-content">
  31. <div id="tab-1" class="tab-pane active">
  32. <div class="panel-body">
  33. <table class="table table-striped">
  34. <thead>
  35. <tr>
  36. <th style="width: 30px;"><input type="checkbox" class="check-all"></th>
  37. <th>权限名称</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {if condition="$menus"}
  42. {:widget_view('org/authtree',['data'=>$menus,'select'=>$sauth,'depth'=>0])}
  43. {/if}
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <div id="tab-2" class="tab-pane">
  49. <div class="panel-body">
  50. <table class="table table-striped">
  51. <thead>
  52. <tr>
  53. <th style="width: 30px;"><input type="checkbox" class="app-check-all"></th>
  54. <th>权限名称</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. {if condition="$appauths"}
  59. {:widget_view('org/authtreeapp',['data'=>$appauths,'select'=>$sappauth,'depth'=>0])}
  60. {/if}
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. </div>
  66. <button class="btn btn-primary ajax-post submit-btn" data-layer="1" target-form="form-horizontal" type="submit">保存权限</button>
  67. <a href="{:url('auth',['id'=>$rolesId,'type'=>1])}" class="btn btn-warning submit-btn2">推荐权限</a>
  68. </form>
  69. </div>
  70. <div class="ibox" style="display: none">
  71. <div class="ibox-content">
  72. </div>
  73. </div>
  74. {/block}
  75. {block name="script"}
  76. <script>
  77. $(document).on('click','.app-check-all',function(){
  78. $(".appids").prop("checked", $(this).prop('checked'));
  79. });
  80. function checkSubClick(id,_this){
  81. if($(_this).prop('checked') == true){
  82. $('.sub_'+id).prop("checked", $(_this).prop('checked'));
  83. }else {
  84. $('.sub_'+id).prop("checked", false);
  85. }
  86. }
  87. </script>
  88. {/block}