flow_dir_top.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.io.InputStream" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.db.*" %>
  5. <%@ page import="com.redmoon.oa.flow.*" %>
  6. <%@ page import="cn.js.fan.util.*" %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <title>目录</title>
  12. <LINK href="../../common.css" type=text/css rel=stylesheet>
  13. <LINK href="default.css" type=text/css rel=stylesheet>
  14. <script>
  15. function findObj(theObj, theDoc)
  16. {
  17.   var p, i, foundObj;
  18.   
  19.   if(!theDoc) theDoc = document;
  20.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  21.   {
  22.     theDoc = parent.frames[theObj.substring(p+1)].document;
  23.     theObj = theObj.substring(0,p);
  24.   }
  25.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  26.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  27.     foundObj = theDoc.forms[i][theObj];
  28.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
  29.     foundObj = findObj(theObj,theDoc.layers[i].document);
  30.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  31.   
  32.   return foundObj;
  33. }
  34. function ShowChild(imgobj, name)
  35. {
  36. var tableobj = findObj("childof"+name);
  37. if (tableobj.style.display=="none")
  38. {
  39. tableobj.style.display = "";
  40. if (imgobj.src.indexOf("i_puls-root-1.gif")!=-1)
  41. imgobj.src = "images/i_puls-root.gif";
  42. if (imgobj.src.indexOf("i_plus-1-1.gif")!=-1)
  43. imgobj.src = "images/i_plus2-2.gif";
  44. if (imgobj.src.indexOf("i_plus-1.gif")!=-1)
  45. imgobj.src = "images/i_plus2-1.gif";
  46. }
  47. else
  48. {
  49. tableobj.style.display = "none";
  50. if (imgobj.src.indexOf("i_puls-root.gif")!=-1)
  51. imgobj.src = "images/i_puls-root-1.gif";
  52. if (imgobj.src.indexOf("i_plus2-2.gif")!=-1)
  53. imgobj.src = "images/i_plus-1-1.gif";
  54. if (imgobj.src.indexOf("i_plus2-1.gif")!=-1)
  55. imgobj.src = "images/i_plus-1.gif";
  56. }
  57. }
  58. </script>
  59. </head>
  60. <body>
  61. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  62. <jsp:useBean id="dir" scope="page" class="com.redmoon.oa.flow.Directory"/>
  63. <%
  64. if (!privilege.isUserPrivValid(request, "admin.flow")) {
  65.     out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  66. return;
  67. }
  68. String root_code = ParamUtil.get(request, "root_code");
  69. if (root_code.equals("")) {
  70. root_code = "root";
  71. }
  72. %>
  73. <Script>
  74. var root_code = "<%=root_code%>";
  75. // 使框架的bottom能得到此root_code
  76. function getRootCode() {
  77. return root_code;
  78. }
  79. </Script>
  80. <%
  81. String op = ParamUtil.get(request, "op");
  82. if (op.equals("AddChild")) {
  83. boolean re = false;
  84. try {
  85. re = dir.AddChild(request);
  86. if (!re) {
  87. out.print(StrUtil.Alert("添加节点失败,请检查编码是否重复!"));
  88. }
  89. }
  90. catch (ErrMsgException e) {
  91. out.print(StrUtil.Alert(e.getMessage()));
  92. }
  93. }
  94. if (op.equals("del")) {
  95. String delcode = ParamUtil.get(request, "delcode");
  96. try {
  97. dir.del(request, delcode);
  98. out.print(StrUtil.Alert("删除成功!"));
  99. }
  100. catch (ErrMsgException e) {
  101. out.print(StrUtil.Alert(e.getMessage()));
  102. }
  103. }
  104. if (op.equals("modify")) {
  105. boolean re = true;
  106. try {
  107. re = dir.update(request);
  108. if (re)
  109. out.print(StrUtil.Alert("修改完成"));
  110. }
  111. catch (ErrMsgException e) {
  112. out.print(StrUtil.Alert(e.getMessage()));
  113. }
  114. }
  115. if (op.equals("move")) {
  116. try {
  117. dir.move(request);
  118. }
  119. catch (ErrMsgException e) {
  120. out.print(StrUtil.Alert(e.getMessage()));
  121. }
  122. }
  123. if (op.equals("removecache")) {
  124. String curcode = ParamUtil.get(request, "code");
  125. LeafChildrenCacheMgr.remove(curcode);
  126. out.print(StrUtil.Alert(curcode + "缓存已被清除!"));
  127. }
  128. Leaf leaf = dir.getLeaf(root_code);
  129. String root_name = leaf.getName();
  130. int root_layer = leaf.getLayer();
  131. String root_description = leaf.getDescription();
  132. boolean isHome = false;
  133. %>
  134. <table width='100%' cellpadding='0' cellspacing='0' >
  135.   <tr>
  136.     <td class="head">管理&nbsp;<%=root_name%></td>
  137.   </tr>
  138. </table>
  139. <br>
  140. <TABLE class="frame_gray"  
  141. cellSpacing=0 cellPadding=0 width="95%" align=center>
  142.   <TBODY>
  143.     <TR>
  144.       <TD height=200 valign="top" bgcolor="#FFFBFF">
  145. <table class="tbg1" cellspacing=0 cellpadding=0 width="100%" align=center onMouseOver="this.className='tbg1sel'" onMouseOut="this.className='tbg1'" 
  146. border=0>
  147.           <tbody>
  148.             <tr>
  149.               <td width="66%" height="13" align=left nowrap>              &nbsp;&nbsp;&nbsp;&nbsp;                             </td>
  150.             <td width="34%" align=right nowrap>>>&nbsp;<%=root_name%>&nbsp;&nbsp;&nbsp;&nbsp;<a target=dirbottomFrame href="flow_dir_bottom.jsp?parent_code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&parent_name=<%=StrUtil.UrlEncode(root_name, "utf-8")%>&op=AddChild">添子目录</a> <a target="dirbottomFrame" href="flow_dir_bottom.jsp?op=modify&code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&name=<%=StrUtil.UrlEncode(root_name,"utf-8")%>&description=<%=StrUtil.UrlEncode(root_description,"utf-8")%>">修改</a> <!--<a target=_self href="#" onClick="if (window.confirm('您确定要删除<%=root_name%>吗?')) window.location.href='dir_top.jsp?op=del&delcode=<%=root_code%>'">删除</a>-->   </td>
  151.             </tr>
  152.           </tbody>
  153.         </table>
  154. <%
  155. DirectoryView tv = new DirectoryView(leaf);
  156. tv.list(request, out);
  157. %></TD>
  158.     </TR>
  159.   </TBODY>
  160. </TABLE>
  161. </body>
  162. </html>