auth.html 2.8 KB

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