1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .submit-btn{
- position: fixed;
- z-index: 10;
- top: 15px;
- right: 20px;
- }
- .panel-body{
- height: 90%;
- overflow: auto;
- }
- </style>
- <div class="tabs-container">
- <ul class="nav nav-tabs">
- <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">后台权限</a>
- </li>
- <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">APP权限</a>
- </li>
- </ul>
- <form method="post" action="{:url('auth2')}" class="form-horizontal">
- <input type="hidden" name="rolesId" value="{$rolesId}">
- <div class="tab-content">
- <div id="tab-1" class="tab-pane active">
- <div class="panel-body">
- <table class="table table-striped">
- <thead>
- <tr>
- <th style="width: 30px;"><input type="checkbox" class="check-all"></th>
- <th>权限名称</th>
- </tr>
- </thead>
- <tbody>
- {if !empty($menus)}
- {if condition="$menus"}
- {:widget_view('org/authtree',['data'=>$menus,'select'=>$sauth,'depth'=>0])}
- {/if}
- {else}
- <p style="color: red">请联系管理员授权当前项目权限</p>
- {/if}
- </tbody>
- </table>
- </div>
- </div>
- <div id="tab-2" class="tab-pane">
- <div class="panel-body">
- <table class="table table-striped">
- <thead>
- <tr>
- <th style="width: 30px;"><input type="checkbox" class="app-check-all"></th>
- <th>权限名称</th>
- </tr>
- </thead>
- <tbody>
- {if !empty($appauths)}
- {if condition="$appauths"}
- {:widget_view('org/authtreeapp',['data'=>$appauths,'select'=>$sappauth,'depth'=>0])}
- {/if}
- {else}
- <p style="color: red">请联系管理员授权当前项目权限</p>
- {/if}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <button class="btn btn-primary ajax-post submit-btn" data-layer="1" target-form="form-horizontal" type="submit">保存权限</button>
- </form>
- </div>
- <div class="ibox" style="display: none">
- <div class="ibox-content">
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(document).on('click','.app-check-all',function(){
- $(".appids").prop("checked", $(this).prop('checked'));
- });
- function checkSubClick(id,_this){
- if($(_this).prop('checked') == true){
- $('.sub_'+id).prop("checked", $(_this).prop('checked'));
- }else {
- $('.sub_'+id).prop("checked", false);
- }
- }
- </script>
- {/block}
|