dept_multi_sel.jsp
资源名称:JSP-OA.rar [点击查看]
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:5k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page contentType="text/html;charset=utf-8" %>
- <%@ page import="com.redmoon.oa.dept.*" %>
- <HTML><HEAD><TITLE>选择部门</TITLE>
- <link rel="stylesheet" href="common.css">
- <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
- <META content="Microsoft FrontPage 4.0" name=GENERATOR><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <style type="text/css">
- <!--
- .style1 {
- font-size: 12pt;
- font-weight: bold;
- }
- -->
- </style>
- <script>
- function func(code) {
- }
- function findObj(theObj, theDoc)
- {
- var p, i, foundObj;
- if(!theDoc) theDoc = document;
- if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
- {
- theDoc = parent.frames[theObj.substring(p+1)].document;
- theObj = theObj.substring(0,p);
- }
- if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
- for (i=0; !foundObj && i < theDoc.forms.length; i++)
- foundObj = theDoc.forms[i][theObj];
- for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
- foundObj = findObj(theObj,theDoc.layers[i].document);
- if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
- return foundObj;
- }
- function ShowChild(imgobj, name)
- {
- var tableobj = findObj("childof"+name);
- if (tableobj.style.display=="none")
- {
- tableobj.style.display = "";
- if (imgobj.src.indexOf("i_puls-root-1.gif")!=-1)
- imgobj.src = "images/i_puls-root.gif";
- if (imgobj.src.indexOf("i_plus-1-1.gif")!=-1)
- imgobj.src = "images/i_plus2-2.gif";
- if (imgobj.src.indexOf("i_plus-1.gif")!=-1)
- imgobj.src = "images/i_plus2-1.gif";
- }
- else
- {
- tableobj.style.display = "none";
- if (imgobj.src.indexOf("i_puls-root.gif")!=-1)
- imgobj.src = "images/i_puls-root-1.gif";
- if (imgobj.src.indexOf("i_plus2-2.gif")!=-1)
- imgobj.src = "images/i_plus-1-1.gif";
- if (imgobj.src.indexOf("i_plus2-1.gif")!=-1)
- imgobj.src = "images/i_plus-1.gif";
- }
- }
- function setDepts() {
- var depts = dialogArguments.getDepts();
- var ary = depts.split(",");
- for(var i=0; i<form1.elements.length; i++) {
- if (form1.elements[i].type=="checkbox"){
- for (var j=0; j<ary.length; j++) {
- if (form1.elements[i].name==ary[j]) {
- form1.elements[i].checked = true;
- break;
- }
- }
- }
- }
- }
- function getDepts(){
- var ary = new Array();
- var j = 0;
- for(var i=0; i<form1.elements.length; i++) {
- if (form1.elements[i].type=="checkbox"){
- if (form1.elements[i].checked) {
- ary[j] = new Array();
- ary[j][0] = form1.elements[i].name;
- ary[j][1] = form1.elements[i].value;
- j ++;
- }
- }
- }
- return ary;
- }
- function checkAll(isChecked){
- var ary = new Array();
- var j = 0;
- for(var i=0; i<form1.elements.length; i++) {
- if (form1.elements[i].type=="checkbox"){
- form1.elements[i].checked = isChecked;
- }
- }
- return ary;
- }
- function selDepts() {
- window.returnValue = getDepts();
- window.close();
- }
- function handlerOnClick() {
- var obj = window.event.srcElement;
- if (obj.type=="checkbox") {
- ;
- }
- }
- function window_onload() {
- // window.document.body.onclick = handlerOnClick;
- setDepts();
- }
- </script>
- </HEAD>
- <BODY bgColor=#FBFAF0 leftMargin=4 topMargin=8 rightMargin=0 class=menubar onLoad="window_onload()">
- <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
- <%
- String priv="read";
- if (!privilege.isUserPrivValid(request,priv)) {
- // out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
- // return;
- }
- %>
- <table width="460" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
- <tr>
- <td height="24" colspan="2" align="center" background="images/top-right.gif" class="right-title">组 织 机 构 图</td>
- </tr>
- <form id="form1" name="form1" method="post">
- <tr>
- <td width="24" height="87"> </td>
- <td width="249">
- <%
- DeptMgr dm = new DeptMgr();
- DeptDb dd = dm.getDeptDb(DeptDb.ROOTCODE);
- DeptView tv = new DeptView(dd);
- tv.ListFuncWithCheckbox(out, "", "func", "", "");
- %></td>
- </tr>
- </form>
- <tr align="center">
- <td height="28" colspan="2">
- <input type="button" name="okbtn2" value="选择全部" onClick="checkAll(true)">
-
- <input type="button" name="okbtn2" value="清除选择" onClick="checkAll(false)">
-
- <input type="button" name="okbtn" value="确定" onClick="selDepts()">
-
- <input type="button" name="cancelbtn" value="取消" onClick="window.close()"> </td>
- </tr>
- </table>
- </BODY></HTML>