bdauth.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. </ul>
  20. <form method="post" action="{:url('bdauth')}" class="form-horizontal">
  21. <input type="hidden" name="id" value="{$id}">
  22. <div class="tab-content">
  23. <div id="tab-1" class="tab-pane active">
  24. <div class="panel-body">
  25. <table class="table table-striped">
  26. <thead>
  27. <tr>
  28. <th style="width: 30px;"><input type="checkbox" class="app-check-all"></th>
  29. <th>权限名称</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. {if condition="$appauths"}
  34. {foreach $appauths as $k=>$v}
  35. <tr>
  36. <td>
  37. {if condition="in_array($v['id'],$select)"}
  38. <input type="checkbox" checked class="appids {$v.id}" name="appids[]" value="{$v.id}" onclick="checkSubClick('{$v.id}',this)">
  39. {else /}
  40. <input type="checkbox" class="appids {$v.id}" name="appids[]" value="{$v.id}" onclick="checkSubClick('{$v.id}',this)">
  41. {/if}
  42. </td>
  43. <td style="text-indent:1em;">
  44. <i class="glyphicon glyphicon-list-alt"></i>
  45. {$v.title}
  46. </td>
  47. </tr>
  48. {/foreach}
  49. {/if}
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. </div>
  55. <button class="btn btn-primary ajax-post submit-btn" data-layer="1" target-form="form-horizontal" type="submit">保存权限</button>
  56. </form>
  57. </div>
  58. <div class="ibox" style="display: none">
  59. <div class="ibox-content">
  60. </div>
  61. </div>
  62. {/block}
  63. {block name="script"}
  64. <script>
  65. $(document).on('click','.app-check-all',function(){
  66. $(".appids").prop("checked", $(this).prop('checked'));
  67. });
  68. function checkSubClick(id,_this){
  69. if($(_this).prop('checked') == true){
  70. $('.sub_'+id).prop("checked", $(_this).prop('checked'));
  71. }else {
  72. $('.sub_'+id).prop("checked", false);
  73. }
  74. }
  75. </script>
  76. {/block}