SelectUser1.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:8k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=GB2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
- <% Session m_session = new Session(session); %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title>用户选择-- GForce OA 2.0</title>
- <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
- <style type="text/css">
- <!--
- div {
- font-size: 12px;
- line-height: normal;
- }
- a {
- font-size: 12px;
- line-height: normal;
- color: #000000;
- }
- td {
- font-size: 12px;
- }
- -->
- </style>
- </head>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- var jsArray = new Array();
- <%
- Vector vt = DepartmentManager.getDepartmentTreeData();
- int i=0;
- for(int j=0;j<vt.size();j++,i++)
- {
- String strFartherID = ((Vector)vt.get(j)).get(2).toString();
- strFartherID = strFartherID.substring(0,strFartherID.length()-1);
- strFartherID = strFartherID.substring(strFartherID.lastIndexOf("_")+1);
- out.println("jsArray[" + i+ "] = new Array("" + ((Vector)vt.get(j)).get(0).toString() + "","" + ((Vector)vt.get(j)).get(1).toString() + "","" + strFartherID + "");");
- }
- out.println("var maxdept=" + i);
- vt = UserManager.getUserTreeData();
- for(int j=0;j<vt.size();j++,i++)
- {
- out.println("jsArray[" + i + "] = new Array("" + ((Vector)vt.get(j)).get(0).toString() + "","" + ((Vector)vt.get(j)).get(1).toString() + "","" + ((Vector)vt.get(j)).get(2).toString() + "","" + ((Vector)vt.get(j)).get(3).toString() + "");");
- }
- %>
- function showtree(jibie,shangjiid,bline)
- {
- if(jibie==0)
- {
- document.write("<div id="t" + jibie + "_" + shangjiid +"" style="display:">");
- }
- else
- document.write("<div id="t" + jibie + "_" + shangjiid +"" style="display:none">");
- var i,notislast,j,haschild;
- notislast=false;
- haschild=false;
- for(i=0;i<jsArray.length;i++)
- {
- if(jsArray[i][2]==shangjiid.toString())
- {
- var j,maxorder=0;
- haschild=false;
- for(j=0;j<jsArray.length;j++)
- {
- if((jsArray[j][2]==shangjiid.toString())&&maxorder<j)
- {
- maxorder=j;
- }
- }
- if(i<maxdept)
- {
- for(j=0;j<jsArray.length;j++)
- {
- if(jsArray[j][2]==jsArray[i][0])
- {
- haschild=true;
- break;
- }
- }
- }
- bline = bline.substr(0,jibie);
- for(j=0;j<bline.length;j++)
- if(bline.substr(j,1)=="1")
- document.write("<img align="absbottom" src="/images/tree/i.gif" border=0>");
- else
- document.write("<img align="absbottom" src="/images/tree/white.gif" border=0>");
- if(maxorder>i)
- {
- if(haschild)
- {
- document.write("<a href="#" onclick="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");return false;" target="_self"><img align="absbottom" src="/images/tree/tplus.gif" border=0 name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom" src="/images/tree/folderclosed.gif" border=0 name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
- bline += "1".toString();
- showtree(jibie + 1,jsArray[i][0],bline);
- }
- else
- {
- if(i<maxdept)
- document.write("<img align="absbottom" src="/images/tree/t.gif" border=0><img align="absbottom" src="/images/tree/folderclosed.gif" border=0>" + jsArray[i][1] + "<br>");
- else
- document.write("<img align="absbottom" src="/images/tree/t.gif" border=0><img align="absbottom" src="/images/tree/book.gif" border=0><a href="#" onclick="javascript:clickpersonnel(" + jsArray[i][0] + ");return false;" target="_self">" + jsArray[i][1] + "</a><br>");
- }
- }
- else
- {
- if(haschild)
- {
- document.write("<a href="#" onclick="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");return false;" target="_self"><img align="absbottom" src="/images/tree/lplus.gif" border=0 name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom" src="/images/tree/folderclosed.gif" border=0 name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
- bline += "0".toString();
- showtree(jibie + 1,jsArray[i][0],bline);
- }
- else
- {
- if(i<maxdept)
- document.write("<img align="absbottom" src="/images/tree/l.gif" border=0><img align="absbottom" src="/images/tree/folderclosed.gif" border=0>" + jsArray[i][1] + "<br>");
- else
- document.write("<img align="absbottom" src="/images/tree/l.gif" border=0><img align="absbottom" src="/images/tree/book.gif" border=0><a href="#" onclick="javascript:clickpersonnel(" + jsArray[i][0] + ");return false;" target="_self">" + jsArray[i][1] + "</a><br>");
- }
- }
- }
- }
- document.write("</div>");
- }
- function clicktree(jibie,shangjiID)
- {
- if(shangjiID>0)
- if(eval("t" + jibie + "_" + shangjiID).style.display=="none")
- {
- eval("t" + jibie + "_" + shangjiID).style.display="";
- if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("/images/tree/tplus.gif")>0)
- eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tminus.gif";
- else
- eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lminus.gif";
- eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderopen.gif";
- }
- else
- {
- eval("t" + jibie + "_" + shangjiID).style.display="none";
- if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("/images/tree/tminus.gif")>0)
- eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tplus.gif";
- else
- eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lplus.gif";
- eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderclosed.gif";
- }
- }
- function clickpersonnel(userid)
- {
- try
- {
- for(var i=maxdept;i<jsArray.length;i++)
- {
- if(jsArray[i][0]==userid.toString())
- {
- window.returnValue=jsArray[i][0] + "|!|" + jsArray[i][1] + "|!|" + jsArray[i][3];
- window.close();
- return;
- }
- }
- }
- catch (ex)
- {
- }
- }
- //-->
- </SCRIPT>
- <BODY BGCOLOR='<%=m_session.GetString("BackColor")%>' LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <form name="selectuser" method="post" action="">
- <img src="/images/tree/folderopen.gif" width="18" height="18" align="absbottom"><%=SystemParament.GetCommpanyName()%><br>
- <script language="JavaScript">
- showtree(0,0,"");
- </script>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>