pagetree.jsp 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <%@ page contentType="text/html; charset=gb2312" language="java"%>
  2. <%
  3. String treePath = request.getContextPath();
  4. //<script language="JavaScript">
  5. %>
  6. function dyniframesize() {
  7. if (document.getElementById){
  8. obj = document.getElementById("tree");
  9. if (obj && !window.opera){
  10. obj.style.display="block"
  11. var hlenght = obj.Document.body.scrollHeight;
  12. var wlenght = obj.Document.body.scrollWidth;
  13. //if(hlenght < 150) hlenght = 150;
  14. if(wlenght < 160) wlenght = 160;
  15. obj.height = hlenght + 10;
  16. obj.width = wlenght + 10;
  17. }
  18. }
  19. }
  20. var treeOutObject;
  21. var treeOutButton;
  22. var treeStrFrame = ""; //HTML code container.
  23. var treeth;
  24. var treesrc;
  25. var hideth;
  26. document.writeln('<iframe id="tree" name="tree" frameborder="0" style="position: absolute;z-index: 9998; visibility:hidden">')
  27. document.writeln('</iframe>');
  28. // Page collection select tree creat function.
  29. function referenceTable(codeName,leafonly,hiddenObject,displayObject)
  30. {
  31. treesrc = "<%= treePath%>" + "/SystemManage/Constant/ConstantTreeDisplay.jsp?codeName=" + codeName + "&leafonly=" + leafonly;
  32. document.getElementsByName("tree")[0].src = treesrc;
  33. var dads = document.getElementsByName("tree")[0].style;
  34. treeth = displayObject;
  35. hideth = hiddenObject;
  36. var ttop = displayObject.offsetTop; //displayObject's top position.
  37. var thei = displayObject.offsetHeight; //displayObject's own height.
  38. var tleft = displayObject.offsetLeft; //displayObject's left position.
  39. while (displayObject = displayObject.offsetParent){ttop+=displayObject.offsetTop; tleft+=displayObject.offsetLeft;}
  40. dads.top = ttop+thei ;
  41. dads.left = tleft;
  42. treeOutButton = (arguments.length == 2) ? null : treeth;
  43. dads.visibility="visible";
  44. event.returnValue=false;
  45. }
  46. // Page collection select Canstant tree creat function.
  47. function roleRightTree(codeName,leafonly,hiddenObject,displayObject)
  48. {
  49. treesrc = "<%= treePath%>" + "/SystemManage/PageCollectionTree/ConstantRightSelectTree.jsp?codeName=" + codeName + "&leafonly=" + leafonly;
  50. document.getElementsByName("tree")[0].src = treesrc;
  51. var dads = document.getElementsByName("tree")[0].style;
  52. treeth = displayObject;
  53. hideth = hiddenObject;
  54. var ttop = displayObject.offsetTop; //displayObject's top position.
  55. var thei = displayObject.offsetHeight; //displayObject's own height.
  56. var tleft = displayObject.offsetLeft; //displayObject's left position.
  57. while (displayObject = displayObject.offsetParent){ttop+=displayObject.offsetTop; tleft+=displayObject.offsetLeft;}
  58. dads.top = ttop+thei ;
  59. dads.left = tleft;
  60. treeOutButton = (arguments.length == 2) ? null : treeth;
  61. dads.visibility="visible";
  62. event.returnValue=false;
  63. }
  64. //Page collection Area-Customer select tree creat function.
  65. function areaCustTree(leafonly,hiddenObject,displayObject){
  66. treesrc = "<%= treePath%>" + "/SystemManage/PageCollectionTree/ProCustAreaTreeDisplay.jsp?treeClass=tb_bm$_area&leafonly=" + leafonly;
  67. document.frames("tree").document.body.innerHTML = "<div>请稍候,正在加在数据...</div>";
  68. document.getElementsByName("tree")[0].src = treesrc;
  69. var dads = document.getElementsByName("tree")[0].style;
  70. treeth = displayObject;
  71. hideth = hiddenObject;
  72. var ttop = displayObject.offsetTop; //displayObject's top position.
  73. var thei = displayObject.offsetHeight; //displayObject's own height.
  74. var tleft = displayObject.offsetLeft; //displayObject's left position.
  75. while (displayObject = displayObject.offsetParent){
  76. ttop+=displayObject.offsetTop;
  77. tleft+=displayObject.offsetLeft;
  78. }
  79. dads.top = ttop+thei ;
  80. dads.left = tleft;
  81. treeOutButton = (arguments.length == 2) ? null : treeth;
  82. dads.visibility="visible";
  83. event.returnValue=false;
  84. }
  85. //Page collection ProductType - Product select tree creat function.
  86. function productTree(leafonly,hiddenObject,displayObject){
  87. treesrc = "<%= treePath%>" + "/SystemManage/PageCollectionTree/ProCustAreaTreeDisplay.jsp?treeClass=tb_bm$_producttype&leafonly=" + leafonly;
  88. document.frames("tree").document.body.innerHTML = "<div>请稍候,正在加在数据...</div>";
  89. document.getElementsByName("tree")[0].src = treesrc;
  90. var dads = document.getElementsByName("tree")[0].style;
  91. treeth = displayObject;
  92. hideth = hiddenObject;
  93. var ttop = displayObject.offsetTop; //displayObject's top position.
  94. var thei = displayObject.offsetHeight; //displayObject's own height.
  95. var tleft = displayObject.offsetLeft; //displayObject's left position.
  96. while (displayObject = displayObject.offsetParent){
  97. ttop+=displayObject.offsetTop;
  98. tleft+=displayObject.offsetLeft;
  99. }
  100. dads.top = ttop+thei ;
  101. dads.left = tleft;
  102. treeOutButton = (arguments.length == 2) ? null : treeth;
  103. dads.visibility="visible";
  104. event.returnValue=false;
  105. }
  106. function setReferenceTableTree(referenceclassid,leafonly,hiddenObject,displayObject,storeCode,displayName,parentCode,condition,order)
  107. {
  108. treesrc = "<%= treePath%>" + "/SystemManage/PageCollectionTree/RefTabTreeDis.jsp?referenceclassid=" + referenceclassid + "&leafonly=" + leafonly+"&storeCode="+storeCode+"&displayName="+displayName+"&parentCode="+parentCode+"&condition="+condition+"&order="+order;
  109. document.getElementsByName("tree")[0].src = treesrc;
  110. document.getElementsByName("tree")[0].src = treesrc;
  111. var dads = document.getElementsByName("tree")[0].style;
  112. treeth = displayObject;
  113. hideth = hiddenObject;
  114. var ttop = displayObject.offsetTop; //displayObject's top position.
  115. var thei = displayObject.offsetHeight; //displayObject's own height.
  116. var tleft = displayObject.offsetLeft; //displayObject's left position.
  117. while (displayObject = displayObject.offsetParent){ttop+=displayObject.offsetTop; tleft+=displayObject.offsetLeft;}
  118. dads.top = ttop+thei ;
  119. dads.left = tleft;
  120. treeOutButton = (arguments.length == 2) ? null : treeth;
  121. dads.visibility="visible";
  122. event.returnValue=false;
  123. }
  124. //cm select user
  125. function onSelectArea(hiddenObject,displayObject)
  126. {
  127. treesrc = "<%= treePath%>" + "/CmManage/CustoTreeDis.jsp";
  128. document.getElementsByName("tree")[0].src = treesrc;
  129. var dads = document.getElementsByName("tree")[0].style;
  130. treeth = displayObject;
  131. hideth = hiddenObject;
  132. var ttop = displayObject.offsetTop; //displayObject's top position.
  133. var thei = displayObject.offsetHeight; //displayObject's own height.
  134. var tleft = displayObject.offsetLeft; //displayObject's left position.
  135. while (displayObject = displayObject.offsetParent){ttop+=displayObject.offsetTop; tleft+=displayObject.offsetLeft;}
  136. dads.top = ttop+thei ;
  137. dads.left = tleft;
  138. treeOutButton = treeth;
  139. dads.visibility="visible";
  140. event.returnValue=false;
  141. }
  142. function setValue(code,name) {
  143. hideth.value=code;
  144. treeth.value = name;
  145. //if(isProduct=='true') pTreeCloseLayer();
  146. //else treeCloseLayer();
  147. treeCloseLayer();
  148. }
  149. function treedocument_onclick(e)
  150. {
  151. var elm = (document.all)?(e.srcElement):(e.target);
  152. //alert(elm.getAttribute("Author"));
  153. if ((elm.getAttribute("Author")==null || elm.getAttribute("Author")=="") && elm != treeOutObject && elm != treeOutButton)
  154. treeCloseLayer("");
  155. }
  156. //Press Esc,Change focus and close;
  157. function treedocument_onkeyup(e){
  158. if (window.event.keyCode==27){
  159. if(areaOutObject)areaOutObject.blur();
  160. treeCloseLayer("");
  161. }
  162. else if(document.activeElement)
  163. {
  164. if(document.activeElement.getAttribute("Author")==null && document.activeElement != treeOutObject && document.activeElement != treeOutButton)
  165. {
  166. treeCloseLayer("");
  167. }
  168. }
  169. }
  170. //Close this layer
  171. function treeCloseLayer(){
  172. var dads = document.getElementsByName("tree")[0].style;
  173. dads.visibility="hidden";
  174. document.frames("tree").document.body.innerHTML = "<div>请稍候,正在加在数据...</div>";
  175. }
  176. <%
  177. //</script>
  178. %>