authorize.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <include file="public@header" />
  2. <style>.expander{margin-left: -20px;}</style>
  3. </head>
  4. <body>
  5. <div class="wrap js-check-wrap">
  6. <ul class="nav nav-tabs">
  7. <li><a href="{:url('rbac/index')}">{:lang('ADMIN_RBAC_INDEX')}</a></li>
  8. <li><a href="{:url('rbac/roleAdd')}">{:lang('ADMIN_RBAC_ROLEADD')}</a></li>
  9. <li class="active"><a href="javascript:;">{:lang('ADMIN_RBAC_AUTHORIZE')}</a></li>
  10. </ul>
  11. <form class="js-ajax-form margin-top-20" action="{:url('rbac/authorizePost')}" method="post">
  12. <div class="table_full">
  13. <table class="table table-bordered" id="authrule-tree">
  14. <tbody>
  15. {$category}
  16. </tbody>
  17. </table>
  18. </div>
  19. <div class="form-actions">
  20. <input type="hidden" name="roleId" value="{$roleId}" />
  21. <button class="btn btn-primary js-ajax-submit" type="submit">{:lang('SAVE')}</button>
  22. <a class="btn btn-default" href="{:url('admin/rbac/index')}">{:lang('BACK')}</a>
  23. </div>
  24. </form>
  25. </div>
  26. <script src="__STATIC__/js/admin.js"></script>
  27. <script type="text/javascript">
  28. $(document).ready(function () {
  29. Wind.css('treeTable');
  30. Wind.use('treeTable', function () {
  31. $("#authrule-tree").treeTable({
  32. indent: 20
  33. });
  34. });
  35. });
  36. function checknode(obj) {
  37. var chk = $("input[type='checkbox']");
  38. var count = chk.length;
  39. var num = chk.index(obj);
  40. var level_top = level_bottom = chk.eq(num).attr('level');
  41. for (var i = num; i >= 0; i--) {
  42. var le = chk.eq(i).attr('level');
  43. if (le <level_top) {
  44. chk.eq(i).prop("checked", true);
  45. var level_top = level_top - 1;
  46. }
  47. }
  48. for (var j = num + 1; j < count; j++) {
  49. var le = chk.eq(j).attr('level');
  50. if (chk.eq(num).prop("checked")) {
  51. if (le > level_bottom){
  52. chk.eq(j).prop("checked", true);
  53. }
  54. else if (le == level_bottom){
  55. break;
  56. }
  57. } else {
  58. if (le >level_bottom){
  59. chk.eq(j).prop("checked", false);
  60. }else if(le == level_bottom){
  61. break;
  62. }
  63. }
  64. }
  65. }
  66. </script>
  67. </body>
  68. </html>