SelectSystemDirectory.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:17k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="java.util.*,com.gforce.gfoa.*,com.gforce.currency.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>系统目录选择页面——GForce OA 2.0</title>
  8. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  9. <script language="javascript" type="text/javascript">
  10. function showtree(jibie,shangjiID,bline)
  11. {
  12.     if(jibie<1)
  13.     {
  14.         document.write("<div id="t" + jibie + "_" + shangjiID +"" style="display:;line-height: 10px;">");
  15.     }
  16.     else
  17.     {
  18.         document.write("<div id="t" + jibie + "_" + shangjiID +"" style="display:none;line-height: 10px;">");
  19.     }
  20.     var i,notislast,j,haschild;
  21.     notislast=false;
  22.     haschild=false;
  23.     for(i=0;i<jsArray.length;i++)
  24.     {
  25.         if((jsArray[i][3]==jibie + 1)&&(jsArray[i][2]==shangjiID.toString()))
  26.         {
  27.             if(jsArray[i][12]=="true")
  28.             {
  29.                 var j,maxorder=0;
  30.                 haschild=false;
  31.                 for(j=0;j<jsArray.length;j++)
  32.                 {
  33.                     if((jsArray[j][3]==jibie + 1)&&(jsArray[j][2]==shangjiID.toString())&&parseInt(maxorder)<parseInt(jsArray[j][5]))
  34.                     {
  35.                         maxorder=jsArray[j][5];
  36.                     }
  37.                 }
  38.                 for(j=0;j<jsArray.length;j++)
  39.                 {
  40.                     if((jsArray[j][3]==jibie + 2)&&(jsArray[j][2]==jsArray[i][0]))
  41.                     {
  42.                         haschild=true;
  43.                         break;
  44.                     }
  45.                 }
  46.                 bline = bline.substr(0,jibie);
  47.                 for(j=0;j<bline.length;j++)
  48.                     if(bline.substr(j,1)=="1")
  49.                         document.write("<img align="absbottom" src="/images/tree/i.gif" border="0" width="19" height="19">");
  50.                     else
  51.                         document.write("<img align="absbottom" src="/images/tree/white.gif" border="0" width="19" height="19">");
  52.                 if(parseInt(maxorder)>parseInt(jsArray[i][5]))
  53.                 {
  54.                     if(haschild)
  55.                     {
  56.                         if(jsArray[i][10]=="true")
  57.                             if(jsArray[i][7]=="")
  58.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  59.                             else
  60.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  61.                         else
  62.                             if(jsArray[i][7]=="")
  63.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  64.                             else
  65.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  66.                     }
  67.                     else
  68.                     {
  69.                         if(jsArray[i][10]=="true")
  70.                             if(jsArray[i][7]=="")
  71.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  72.                             else
  73.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  74.                         else
  75.                             if(jsArray[i][7]=="")
  76.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  77.                             else
  78.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  79.                     }
  80.                     bline += "1".toString();
  81.                     showtree(jibie + 1,jsArray[i][0],bline);
  82.                 }
  83.                 else
  84.                 {
  85.                     if(haschild)
  86.                     {
  87.                         if(jsArray[i][10]=="true")
  88.                             if(jsArray[i][7]=="")
  89.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  90.                             else
  91.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  92.                         else
  93.                             if(jsArray[i][7]=="")
  94.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  95.                             else
  96.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  97.                     }
  98.                     else
  99.                     {
  100.                         if(jsArray[i][10]=="true")
  101.                             if(jsArray[i][7]=="")
  102.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  103.                             else
  104.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  105.                         else
  106.                             if(jsArray[i][7]=="")
  107.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  108.                             else
  109.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="SystemDirectory" onchange="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  110.                     }
  111.                     bline += "0".toString();
  112.                     showtree(jibie + 1,jsArray[i][0],bline);
  113.                 }
  114.             }
  115.         }
  116.     }
  117.     document.write("</div>");
  118. }
  119. function clicktree(jibie,shangjiID)
  120. {
  121.     if(shangjiID>0)
  122.     if(eval("t" + jibie + "_" + shangjiID).style.display=="none")
  123.     {
  124.         eval("t" + jibie + "_" + shangjiID).style.display="";
  125.         if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("tplus.gif")>0)
  126.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tminus.gif";
  127.         else
  128.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lminus.gif";
  129.         folderOpenString = "";
  130.         for(j=0;j<jsArray.length;j++)
  131.         {
  132.             if((jsArray[j][0]==shangjiID))
  133.             {
  134.                 folderOpenString = jsArray[j][6];
  135.                 break;
  136.             }
  137.         }
  138.         if(folderOpenString=="")
  139.             eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderopen.gif";
  140.         else
  141.             eval("document.f" + jibie + "_" + shangjiID).src=folderOpenString;
  142.     }
  143.     else
  144.     {
  145.         eval("t" + jibie + "_" + shangjiID).style.display="none";
  146.         if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("tminus.gif")>0)
  147.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tplus.gif";
  148.         else
  149.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lplus.gif";
  150.         folderClosedString = "";
  151.         for(j=0;j<jsArray.length;j++)
  152.         {
  153.             if((jsArray[j][0]==shangjiID))
  154.             {
  155.                 folderClosedString = jsArray[j][7];
  156.                 break;
  157.             }
  158.         }
  159.         if(folderClosedString=="")
  160.             eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderclosed.gif";
  161.         else
  162.             eval("document.f" + jibie + "_" + shangjiID).src=folderClosedString;
  163.     }
  164. }
  165. function checkdepart(systemdirectoryid)
  166. {
  167.     if(systemdirectoryid=="0")
  168.     {
  169.       window.parent.self.document.all.Station.value="_0_";
  170.       window.parent.self.document.all.LevelNumber.value="1";
  171.       var maxorder = 0;
  172.       for(var i=0;i<jsArray.length;i++)
  173.       {
  174.         if(jsArray[i][2]=="0" && jsArray[i][3]=="1")
  175.         {
  176.           maxorder++;
  177.         }
  178.       }
  179.       window.parent.self.document.all.OrderNumber.value=maxorder + 1;
  180.     }
  181.     else
  182.     {
  183.       for(var i=0;i<jsArray.length;i++)
  184.       {
  185.         if(jsArray[i][0]==systemdirectoryid)
  186.         {
  187.           window.parent.self.document.all.Station.value=jsArray[i][13] + jsArray[i][0] + "_";
  188.           window.parent.self.document.all.LevelNumber.value= parseInt(jsArray[i][3]) + 1;
  189.           var maxorder = 0;
  190.           for(var j=0;j<jsArray.length;j++)
  191.           {
  192.             if(jsArray[j][13]==jsArray[i][13] +jsArray[i][0] + "_" &&  parseInt(jsArray[i][3]) + 1 == parseInt(jsArray[j][3]))
  193.             {
  194.               maxorder++;
  195.             }
  196.           }
  197.           window.parent.self.document.all.OrderNumber.value=maxorder + 1;
  198.           break;
  199.         }
  200.     }
  201.   }
  202.   window.parent.self.document.all.SystemDirectoryID.value=systemdirectoryid;
  203. }
  204. </script>
  205. <style type="text/css">
  206. <!--
  207. a {
  208.     color: #0A0A0A;
  209. }
  210. body {
  211.     color: #0A0A0A;
  212. }
  213. -->
  214. </style>
  215. </head>
  216. <body leftmargin="5" topmargin="0" bgcolor="<%=m_session.GetString("BackColor")%>">
  217. <form name="SelectSystemDirectory">
  218. <table width="98%" height="100%" border="0" align="center" cellspacing="0">
  219.     <tr>
  220.         <td align="left" valign="top">
  221. <img src="/images/tree/home.gif" align="absbottom" border="0" width="19" height="19"><input type="radio" name="SystemDirectory" value="0" checked="true" onchange="checkdepart(this.value);"><a><%=SystemParament.GetSystemName()%></a><br>
  222. <script language="javascript">
  223. var jsArray = new Array();
  224. <%
  225. SystemDirectoryManager systemdirectorymanager = new SystemDirectoryManager();
  226. Vector vc = systemdirectorymanager.getSystemDirectoryData();
  227. for(int row=0;row<vc.size();row++)
  228. {
  229.     String strTemp = "";
  230.     Vector hashtab = (Vector)vc.get(row);
  231.     for(int i=0;i<hashtab.size();i++)
  232.     {
  233.         if(i==2)
  234.         {
  235.             String strFarther = hashtab.get(i).toString();
  236.             strFarther = strFarther.substring(0,strFarther.length() - 1);
  237.             strFarther = strFarther.substring(strFarther.lastIndexOf("_") + 1);
  238.             strTemp += ","" + strFarther + """;
  239.         }
  240.         else
  241.             strTemp += ","" + hashtab.get(i).toString() + """;
  242.     }
  243.     out.println("jsArray[" + (row) + "]=new Array(" + strTemp.substring(1) + ","" + hashtab.get(2).toString() + "");");
  244. }
  245. %>
  246. showtree(0,0,"");
  247. if(window.parent.self.document.all.SystemDirectoryID.value=="")
  248. {
  249.   checkdepart(0);
  250. }
  251. else
  252. {
  253. // alert(window.parent.self.document.all.SystemDirectoryID.value);
  254.   checkdepart(window.parent.self.document.all.SystemDirectoryID.value);
  255.   for(var i=0;i<document.SelectSystemDirectory.elements.length;i++)
  256.   {
  257. // alert(document.SelectSystemDirectory.elements[i].name);
  258.     if(document.SelectSystemDirectory.elements[i].name=="SystemDirectory" && document.SelectSystemDirectory.elements[i].value==window.parent.self.document.all.SystemDirectoryID.value)
  259.       document.SelectSystemDirectory.elements[i].checked=true;
  260.   }
  261. }
  262. </script>
  263.         </td>
  264.   </tr>
  265. </table>
  266. </form>
  267. </body>
  268. </html>