roleIndex.jsp 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>岗位管理</title>
  6. <meta name="decorator" content="default"/>
  7. <%@include file="/webpage/include/treeview.jsp" %>
  8. <style type="text/css">
  9. .ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px;}
  10. </style>
  11. <script type="text/javascript">
  12. function refresh(){//刷新
  13. window.location="${ctx}/sys/role/";
  14. }
  15. </script>
  16. <style>
  17. body{
  18. background-color:transparent;
  19. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
  20. color:#ffffff;
  21. background-color:rgba(255,255,255,0);
  22. height:100%;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <div class="wrapper wrapper-content full-width" id="divId">
  28. <sys:message content="${message}"/>
  29. <div id="content" class="pr full-height full-width">
  30. <div id="left" class="contentShadow fl contents">
  31. <div class="ztreeContainer">
  32. <div id="ztree" class="ztree leftBox-content"></div>
  33. </div>
  34. </div>
  35. <div id="right" class="fl contents">
  36. <div class="layui-row contentShadow full-height tran-bg">
  37. <iframe id="userContent" name="userContent" src="${ctx}/sys/role/list" width="100%" height="100%" frameborder="0"></iframe>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <script type="text/javascript">
  43. function addDiyDom(treeId, treeNode) {
  44. var spaceWidth = 15;
  45. var switchObj = $("#" + treeNode.tId + "_switch"),
  46. icoObj = $("#" + treeNode.tId + "_ico");
  47. switchObj.remove();
  48. icoObj.before(switchObj);
  49. if (treeNode.level > 0) {
  50. var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level)+ "px'></span>";
  51. switchObj.before(spaceStr);
  52. }
  53. }
  54. var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
  55. callback:{onClick:function(event, treeId, treeNode){
  56. var id = treeNode.id == '0' ? '' :treeNode.id;
  57. var look = treeNode.look;
  58. $('#userContent').attr("src","${ctx}/sys/role/list?office.id="+id+"&look="+look+"&office.name="+ encodeURI(treeNode.name));
  59. }
  60. }
  61. ,view:{
  62. showLine: false,
  63. showIcon: false,
  64. addDiyDom: addDiyDom
  65. }
  66. };
  67. function refreshTree(){
  68. $.getJSON("${ctx}/sys/office/treeDataRole?"+ Math.random(),function(data){
  69. $.fn.zTree.init($("#ztree"), setting, data).expandAll(true);
  70. closeSubChilds();
  71. });
  72. }
  73. refreshTree();
  74. function closeSubChilds() {
  75. var secondLevel = $('#ztree').children().children().eq(1).children();
  76. var slists = secondLevel.find('a.level1').find('.level1');
  77. var arr = [];
  78. for (var i = 0, length = slists.length; i < length; i++) {
  79. arr.push(slists[i]);
  80. $(arr[i].parentNode.nextSibling).css('display','none');
  81. arr[i].click(function(){
  82. arr[i].removeClass("noline_close").addClass('noline_open');
  83. })
  84. }
  85. secondLevel.find('a.level1').children().eq(1).removeClass("noline_open").addClass('noline_close');
  86. }
  87. /*window.onload = function() {
  88. <%--$.getJSON("${ctx}/sys/office/treeDataRole?"+ Math.random(),function(data){--%>
  89. <%--$.fn.zTree.init($("#ztree"), setting, data).expandAll(true);--%>
  90. <%--});--%>
  91. var navg = window.navigator.userAgent;
  92. if(navg.indexOf('MSIE')!==-1){
  93. // var isFlag = true;
  94. // function ref(isFlag) {
  95. // isFlag = false;
  96. // window.refresh();
  97. // return isFlag;
  98. // }
  99. // ref(isFlag);
  100. // (function (){
  101. // window.refresh();
  102. // console.log('fre')
  103. // })()
  104. }
  105. var secondLevel = $('#ztree').children().children().eq(1).children();
  106. var slists = secondLevel.find('a.level1').find('.level1');
  107. var arr = [];
  108. for (var i = 0, length = slists.length; i < length; i++) {
  109. arr.push(slists[i]);
  110. $(arr[i].parentNode.nextSibling).css('display','none');
  111. arr[i].click(function(){
  112. arr[i].removeClass("noline_close").addClass('noline_open');
  113. })
  114. }
  115. secondLevel.find('a.level1').children().eq(1).removeClass("noline_open").addClass('noline_close');
  116. }*/
  117. // var width = $('#divId').width();
  118. // var leftWidth = width*0.1; // 左侧窗口大小
  119. // var htmlObj = $("html"), mainObj = $("#main");
  120. // var frameObj = $("#left, #openClose, #right, #right iframe");
  121. // function wSize(){
  122. // var strs = getWindowSize().toString().split(",");
  123. // htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
  124. // mainObj.css("width","auto");
  125. // frameObj.height(strs[0] - 120);
  126. // /* var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
  127. // $("#right").width($("#content").width()- leftWidth - $("#openClose").width() -60);
  128. // $(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);*/
  129. // $("#content").width(width);
  130. // $("#left").width(width*0.12);
  131. // $("#ztree").width(width*0.12);
  132. // $("#ztree").height('86%');
  133. // $("#right").width(width*0.82);
  134. // $("#officeContent").width(width*0.82);
  135. // }
  136. </script>
  137. <%--<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>--%>
  138. </body>
  139. </html>