auth2.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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('auth2')}" class="form-horizontal">
  23. <input type="hidden" name="rolesId" value="{$rolesId}">
  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 !empty($menus)}
  36. {if condition="$menus"}
  37. {:widget_view('org/authtree',['data'=>$menus,'select'=>$sauth,'depth'=>0])}
  38. {/if}
  39. {else}
  40. <p style="color: red">请联系管理员授权当前项目权限</p>
  41. {/if}
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <div id="tab-2" class="tab-pane">
  47. <div class="panel-body">
  48. <table class="table table-striped">
  49. <thead>
  50. <tr>
  51. <th style="width: 30px;"><input type="checkbox" class="app-check-all"></th>
  52. <th>权限名称</th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. {if !empty($appauths)}
  57. {if condition="$appauths"}
  58. {:widget_view('org/authtreeapp',['data'=>$appauths,'select'=>$sappauth,'depth'=>0])}
  59. {/if}
  60. {else}
  61. <p style="color: red">请联系管理员授权当前项目权限</p>
  62. {/if}
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. </div>
  68. <button class="btn btn-primary ajax-post submit-btn" data-layer="1" target-form="form-horizontal" type="submit">保存权限</button>
  69. </form>
  70. </div>
  71. <div class="ibox" style="display: none">
  72. <div class="ibox-content">
  73. </div>
  74. </div>
  75. {/block}
  76. {block name="script"}
  77. <script>
  78. $(document).on('click','.app-check-all',function(){
  79. $(".appids").prop("checked", $(this).prop('checked'));
  80. });
  81. function checkSubClick(id,_this){
  82. if($(_this).prop('checked') == true){
  83. $('.sub_'+id).prop("checked", $(_this).prop('checked'));
  84. }else {
  85. $('.sub_'+id).prop("checked", false);
  86. }
  87. }
  88. </script>
  89. {/block}