dept_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.dept.*" %>
  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="default.css" type=text/css rel=stylesheet>
  13. <script>
  14. function findObj(theObj, theDoc)
  15. {
  16.   var p, i, foundObj;
  17.   
  18.   if(!theDoc) theDoc = document;
  19.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  20.   {
  21.     theDoc = parent.frames[theObj.substring(p+1)].document;
  22.     theObj = theObj.substring(0,p);
  23.   }
  24.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  25.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  26.     foundObj = theDoc.forms[i][theObj];
  27.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  28.     foundObj = findObj(theObj,theDoc.layers[i].document);
  29.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  30.   
  31.   return foundObj;
  32. }
  33. function ShowChild(imgobj, name)
  34. {
  35. var tableobj = findObj("childof"+name);
  36. if (tableobj.style.display=="none")
  37. {
  38. tableobj.style.display = "";
  39. if (imgobj.src.indexOf("i_puls-root-1.gif")!=-1)
  40. imgobj.src = "images/i_puls-root.gif";
  41. if (imgobj.src.indexOf("i_plus-1-1.gif")!=-1)
  42. imgobj.src = "images/i_plus2-2.gif";
  43. if (imgobj.src.indexOf("i_plus-1.gif")!=-1)
  44. imgobj.src = "images/i_plus2-1.gif";
  45. }
  46. else
  47. {
  48. tableobj.style.display = "none";
  49. if (imgobj.src.indexOf("i_puls-root.gif")!=-1)
  50. imgobj.src = "images/i_puls-root-1.gif";
  51. if (imgobj.src.indexOf("i_plus2-2.gif")!=-1)
  52. imgobj.src = "images/i_plus-1-1.gif";
  53. if (imgobj.src.indexOf("i_plus2-1.gif")!=-1)
  54. imgobj.src = "images/i_plus-1.gif";
  55. }
  56. }
  57. </script>
  58. </head>
  59. <body>
  60. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  61. <%
  62. String priv="admin";
  63. if (!privilege.isUserPrivValid(request,priv))
  64. {
  65. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  66. return;
  67. }
  68. %>
  69. <jsp:useBean id="dm" scope="page" class="com.redmoon.oa.dept.DeptMgr"/>
  70. <%
  71. String root_code = ParamUtil.get(request, "root_code");
  72. if (root_code.equals(""))
  73. {
  74. root_code = "root";
  75. }
  76. %>
  77. <Script>
  78. var root_code = "<%=root_code%>";
  79. // 使框架的bottom能得到此root_code
  80. function getRootCode() {
  81. return root_code;
  82. }
  83. </Script>
  84. <%
  85. String op = ParamUtil.get(request, "op");
  86. if (op.equals("AddRootChild")) {
  87. try {
  88. dm.AddRootChild(request);
  89. }
  90. catch (ErrMsgException e) {
  91. out.print(StrUtil.Alert(e.getMessage()));
  92. }
  93. }
  94. if (op.equals("AddChild")) {
  95. try {
  96. dm.AddChild(request);
  97. }
  98. catch (ErrMsgException e) {
  99. out.print(StrUtil.Alert(e.getMessage()));
  100. }
  101. }
  102. if (op.equals("del")) {
  103. String delcode = ParamUtil.get(request, "delcode");
  104. try {
  105. dm.del(delcode);
  106. }
  107. catch (ErrMsgException e) {
  108. out.print(StrUtil.Alert(e.getMessage()));
  109. }
  110. }
  111. if (op.equals("modify")) {
  112. boolean re = true;
  113. try {
  114. re = dm.update(request);
  115. }
  116. catch (ErrMsgException e) {
  117. out.print(StrUtil.Alert(e.getMessage()));
  118. }
  119. if (re)
  120. out.print(StrUtil.Alert("修改完成"));
  121. }
  122. if (op.equals("move")) {
  123. try {
  124. dm.move(request);
  125. }
  126. catch (ErrMsgException e) {
  127. out.print(StrUtil.Alert(e.getMessage()));
  128. }
  129. }
  130. DeptDb leaf = dm.getDeptDb(root_code);
  131. String root_name = leaf.getName();
  132. int root_layer = leaf.getLayer();
  133. String root_description = leaf.getDescription();
  134. boolean isHome = false;
  135. %>
  136. <table width='100%' cellpadding='0' cellspacing='0' >
  137.   <tr>
  138.     <td class="head">管理&nbsp;<%=root_name%></td>
  139.   </tr>
  140. </table>
  141. <br>
  142. <TABLE class="frame_gray"  
  143. cellSpacing=0 cellPadding=0 width="95%" align=center>
  144.   <TBODY>
  145.     <TR>
  146.       <TD height=200 valign="top" bgcolor="#FFFBFF">
  147. <table class="tbg1" cellspacing=0 cellpadding=0 width="100%" align=center onMouseOver="this.className='tbg1sel'" onMouseOut="this.className='tbg1'" 
  148. border=0>
  149.           <tbody>
  150.             <tr>
  151.               <td width="66%" height="13" align=left nowrap>              &nbsp;&nbsp;&nbsp;&nbsp;                             </td>
  152.             <td width="34%" align=right nowrap>>>&nbsp;<%=root_name%>&nbsp;&nbsp;<a target="_parent" href="document_list_m.jsp?dir_code=<%=StrUtil.UrlEncode(root_code)%>&dir_name=<%=StrUtil.UrlEncode(root_name)%>"></a><a target=dirbottomFrame href="dept_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="dept_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>-->
  153.   </td>
  154.             </tr>
  155.           </tbody>
  156.         </table>
  157. <%
  158. DeptView dv = new DeptView(leaf);
  159. dv.list(out);
  160. %></TD>
  161.     </TR>
  162.   </TBODY>
  163. </TABLE>
  164. </body>
  165. </html>