📄 select.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@include file="/common/taglibs.jsp"%>
<%
String contextPath = request.getContextPath();
%>
<html>
<head>
<title> {*[Select internal user]*} </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet"
href="<%= contextPath %>/resource/css/dtree.css"
type="text/css">
<link rel="stylesheet"
href="<%= contextPath %>/resource/css/main.css"
type="text/css">
<script src="<%= contextPath %>/script/dtree.js"></script>
<script src="<%= contextPath %>/script/util.js"></script>
<script language="JavaScript">
var contextPath = '<%= contextPath %>';
function selectOne(value) {
window.returnValue = value;
window.close();
}
function doReturn() {
var sis = document.all("_selectitem");
var rtn = new Array();
var p = 0;
if (sis.length != null) {
for (var i=0; i<sis.length; i++) {
var e = sis[i];
if (e.type == 'checkbox') {
if (e.checked) {
rtn[p++] = e.value;
}
}
}
}
else {
var e = sis;
if (e.type == 'checkbox') {
if (e.checked) {
rtn[p++] = e.value;
}
}
}
//alert(rtn);
window.returnValue = rtn;
window.close();
}
function ev_init() {
var ids = '<ww:property value="#parameters['SELECTEDID'][0]" />';
var idList = ids.split(';');
if (idList != '' && idList != null) {
var sis = document.all("_selectitem");
if (sis != null && sis != '') {
for (var i=0; i<sis.length; i++) {
var e = sis[i];
for (var j=0; j<idList.length; j++) {
var tmp = e.value.split(';');
if (tmp!=null && tmp.length > 0 && tmp[0] == idList[j]) {
e.checked = true;
d.openTo(tmp[0].substring(1));
}
}
}
}
}
}
</script>
</head>
<body topmargin="0" onload="ev_init()">
<table width="98%">
<tr>
<td width="10" class="image-label"><img src="<ww:url value="/resource/image/email2.jpg"/>" /></td>
<td width="3"></td>
<td width="50" class="text-label">{*[Roles]*}</td>
<td>
<table width="100%" border=1 cellpadding="0" cellspacing="0"
class="line-position">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="line-position2" width="50" valign="top">
<c:if test="${!empty param.MULTISELECT and param.MULTISELECT eq 'TRUE'}" >
<button class="button-image"
onClick="doReturn();"><img
src="<ww:url value="/resource/image/save.gif"/>">{*[Save]*}</button>
</c:if>
</td>
<td class="line-position2" width="50" valign="top">
<button class="button-image"
onClick="doExit()"><img
src="<ww:url value="/resource/image/cancle2.gif"/>">{*[Cancel]*}</button>
</td>
<td class="line-position2" width="50" valign="top">
<button class="button-image"
onClick="doEmpty()"><img
src="<ww:url value="/resource/image/qingkong.gif"/>">{*[Clear]*}</button>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="4">
<tr><td><input class="button-cmd" type="button" value="{*[Expand]*}" onclick="d.openAll()"/><input class="button-cmd" type="button" value="{*[Indent]*}" onclick="d.closeAll();"/></td></tr>
<tr class="row-hd">
<td height="2"> </td>
</tr>
<tr>
<td>
<div class="scroll-div">
<div class="dtree">
<ww:set name="selectChild" value="#parameters['SELECTEDID'][0]" />
<script type="text/javascript">
<ww:set name="multiSelect" value="#parameters['MULTISELECT'][0]" />
var d = new dTree('d');
<ww:if test=" #multiSelect == 'TRUE' ">
d.config.multiSelect = true;
d.config.selectChild = false;
</ww:if>
<ww:iterator value="_deptSelect">
<ww:if test="%{superior.id != null && superior.id != ''}">
d.add(
'<ww:property value="id" />',
'<ww:property value="superior.id" />',
'<ww:property value="name" />',
'javascript:selectOne(\'<ww:property value="id" />;<ww:property value="name" />\');',
'D<ww:property value="id" />;<ww:property value="name" />',
'',
'<%= contextPath %>/resource/images/dtree/dept.gif',
'<%= contextPath %>/resource/images/dtree/dept.gif');
'',
"",
</ww:if>
<ww:else>
d.add('<ww:property value="id" />',
-1,
'<ww:property value="name" />',
'javascript:selectOne(\'<ww:property value="id" />;<ww:property value="name" />\');',
'D<ww:property value="id" />;<ww:property value="name" />',
'',
'<%= contextPath %>/resource/images/dtree/dept.gif');
'',
'',
"",
</ww:else>
<ww:set name="deptid" value="id" />
<ww:iterator value="roles">
d.add('<ww:property value="id" />',
'<ww:property value="#deptid" />',
'<ww:property value="name" />',
'javascript:selectOne(\'<ww:property value="id" />;<ww:property value="name" />\');',
'R<ww:property value="id" />;<ww:property value="name" />',
'',
'<%= contextPath %>/resource/images/dtree/group.gif');
'',
'',
"",
</ww:iterator>
<ww:iterator value="users">
d.add('<ww:property value="id" />',
'<ww:property value="#deptid" />',
'<ww:property value="name" />',
'javascript:selectOne(\'<ww:property value="id" />;<ww:property value="name" />\');',
'U<ww:property value="id" />;<ww:property value="name" />',
'',
'<%= contextPath %>/resource/images/dtree/user.gif');
'',
'',
"",
</ww:iterator>
</ww:iterator>
document.write(d);
</script>
</div>
</div></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -