org_batch_auth.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. .tab-content{
  21. width: 60%;
  22. display: inline-block;
  23. float: left;
  24. }
  25. .org-box{
  26. width: 40%;
  27. height: auto;
  28. background: #fff;
  29. display: inline-block;
  30. float: right;
  31. }
  32. </style>
  33. <div class="tabs-container" >
  34. <ul class="nav nav-tabs">
  35. <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">后台权限</a>
  36. </li>
  37. <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">APP权限</a>
  38. </li>
  39. </ul>
  40. <form method="post" action="{:url('orgBatchAuth')}" class="form-horizontal">
  41. <div class="tab-content">
  42. <div id="tab-1" class="tab-pane active">
  43. <div class="panel-body">
  44. <table class="table table-striped">
  45. <thead>
  46. <tr>
  47. <th style="width: 30px;"><input type="checkbox" class="check-all"></th>
  48. <th>权限名称</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. {if condition="$menus"}
  53. {:widget_view('org/org_bach_authtree',['data'=>$menus,'select'=>[],'depth'=>0])}
  54. {/if}
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. <div id="tab-2" class="tab-pane">
  60. <div class="panel-body">
  61. <table class="table table-striped">
  62. <thead>
  63. <tr>
  64. <th style="width: 30px;"><input type="checkbox" class="app-check-all"></th>
  65. <th>权限名称</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. {if condition="$appauths"}
  70. {:widget_view('org/org_bach_authtreeapp',['data'=>$appauths,'select'=>[],'depth'=>0])}
  71. {/if}
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="org-box">
  78. <div class="panel-body">
  79. <table class="table table-striped">
  80. <thead>
  81. <tr>
  82. <th style="width: 30px;"><input type="checkbox" class="check-all-org"></th>
  83. <th>组织名称</th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. {foreach $orgList as $k=>$v}
  88. <tr>
  89. <td>
  90. <input type="checkbox" class="orgs {$v.id}" name="orgs[]" value="{$v.id}" onclick="orgClick('{$v.id}',this)">
  91. </td>
  92. <td>
  93. <i class="glyphicon glyphicon-list-alt"></i>
  94. {$v.name}
  95. </td>
  96. </tr>
  97. {/foreach}
  98. </tbody>
  99. </table>
  100. </div>
  101. </div>
  102. <button class="btn btn-primary ajax-post submit-btn" target-form="form-horizontal" type="submit">保存权限</button>
  103. </form>
  104. </div>
  105. <div class="ibox" style="display: none">
  106. <div class="ibox-content">
  107. </div>
  108. </div>
  109. {/block}
  110. {block name="script"}
  111. <script>
  112. $(document).on('click','.app-check-all',function(){
  113. $(".appids").prop("checked", $(this).prop('checked'));
  114. });
  115. function checkSubClick(id,_this){
  116. if($(_this).prop('checked') == true){
  117. $('.sub_'+id).prop("checked", $(_this).prop('checked'));
  118. }else {
  119. $('.sub_'+id).prop("checked", false);
  120. }
  121. }
  122. $(document).on('click','.check-all-org',function(){
  123. $(".orgs").prop("checked", $(this).prop('checked'));
  124. });
  125. function orgClick(id,_this){
  126. if($(_this).prop('checked') == true){
  127. $('.orgs'+id).prop("checked", $(_this).prop('checked'));
  128. }else {
  129. $('.orgs'+id).prop("checked", false);
  130. }
  131. }
  132. </script>
  133. {/block}