306 lines
11 KiB
Plaintext
306 lines
11 KiB
Plaintext
<%@page import="com.amarsoft.are.util.json.JSONEncoder"%>
|
||
<%@page import="com.amarsoft.awe.util.ObjectTreeManager"%>
|
||
<%@page import="com.amarsoft.awe.ui.widget.ObjectTree"%>
|
||
<%@ page language="java" contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin.jspf"%>
|
||
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/chart/json2.js"></script>
|
||
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/widget/htmltree.js"></script>
|
||
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%
|
||
|
||
String sRoleID = CurPage.getParameter("sRoleID");
|
||
if(sRoleID == null) sRoleID = "";
|
||
%>
|
||
<script type="text/javascript">
|
||
var availableReportCaptionList = new Array;
|
||
var availableReportNameList = new Array;
|
||
var selectedReportCaptionList = new Array;
|
||
var selectedReportNameList = new Array;
|
||
<%
|
||
int num = 0;
|
||
BizObjectManager bm = JBOFactory.getBizObjectManager("jbo.sys.ORG_INFO");
|
||
//String param="ButtonFLowDefault";
|
||
String queryStr = "SELECT orgid,orgname FROM O ";
|
||
List<BizObject> ml = bm.createQuery(queryStr).getResultList(false);
|
||
System.out.print(ml);
|
||
String itemno="";
|
||
String itemname="";
|
||
for(BizObject bo : ml){
|
||
itemno = bo.getAttribute("orgid").getString();
|
||
|
||
itemname = bo.getAttribute("orgname").getString();
|
||
|
||
String displayName = itemno +" "+itemname;
|
||
out.println("availableReportCaptionList[" + num + "] = '" + displayName + "';\r");
|
||
out.println("availableReportNameList[" + num + "] = '" + itemno + "';\r");
|
||
num++;
|
||
}
|
||
System.out.print(itemno);
|
||
System.out.print(itemname);
|
||
//String param2="ViewTabProject";
|
||
/* queryStr = "SELECT orgid,orgname,sortno FROM O;";
|
||
List<BizObject> ml1 = bm.createQuery(queryStr).setParameter("param",1).getResultList(false);
|
||
num = 0;
|
||
for(BizObject bo : ml1){
|
||
String itemno = bo.getAttribute("orgid").getString();
|
||
String itemname = bo.getAttribute("orgname").getString();
|
||
String displayName = itemno +" "+itemname;
|
||
out.println("selectedReportCaptionList[" + num + "] = '" + displayName + "';\r");
|
||
out.println("selectedReportNameList[" + num + "] = '" + itemno + "';\r");
|
||
num++;
|
||
} */
|
||
|
||
%>
|
||
</script>
|
||
|
||
<html>
|
||
<head>
|
||
</head>
|
||
<body bgcolor="#E4E4E4">
|
||
<form name="analyseterm">
|
||
<table align="center" width="100%">
|
||
<tr>
|
||
<td>
|
||
<table width='100%' border='1' cellpadding='0' cellspacing='5' bgcolor='#DDDDDD'>
|
||
<tr>
|
||
<td align='center' style='width:50%;'>
|
||
<select name='report_available' onchange='selectionChanged(document.forms["analyseterm"].elements["report_available"],document.forms["analyseterm"].elements["report_chosen"]);' size='12' style='width:100%;overflow:auto;' multiple>
|
||
</select>
|
||
</td>
|
||
<td width='1' align='center' valign='middle' bordercolor='#DDDDDD'>
|
||
<img name='movefrom_report_available'
|
||
onmousedown='pushButton("movefrom_report_available",true);'
|
||
onmouseup='pushButton("movefrom_report_available",false);'
|
||
onmouseout='pushButton("movefrom_report_available",false);'
|
||
onclick='moveSelected(document.forms["analyseterm"].elements["report_available"],document.forms["analyseterm"].elements["report_chosen"]);updateHiddenChooserField(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report"]);'
|
||
border='0'
|
||
src='<%=CurConfig.getImagePath()%>/chooser_orange/arrowRight_disabled.gif'
|
||
alt='Add selected items' />
|
||
<br><br>
|
||
<img name='movefrom_report_chosen'
|
||
onmousedown='pushButton("movefrom_report_chosen",true);'
|
||
onmouseup='pushButton("movefrom_report_chosen",false);'
|
||
onmouseout='pushButton("movefrom_report_chosen",false);'
|
||
onclick='moveSelected(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report_available"]);updateHiddenChooserField(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report"]);'
|
||
border='0'
|
||
src='<%=CurConfig.getImagePath()%>/chooser_orange/arrowLeft_disabled.gif'
|
||
alt='Remove selected items' />
|
||
</td>
|
||
<td align='center'>
|
||
<select name='report_chosen' onchange='selectionChanged(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report_available"]);' size='12' style='width:100%;' multiple>
|
||
</select>
|
||
<input type='hidden' name='report' value=''>
|
||
</td>
|
||
<td width='1' align='center' valign='middle' bordercolor='#DDDDDD'>
|
||
<img name='shiftup_report_chosen'
|
||
onmousedown='pushButton("shiftup_report_chosen",true);'
|
||
onmouseup='pushButton("shiftup_report_chosen",false);'
|
||
onmouseout='pushButton("shiftup_report_chosen",false);'
|
||
onclick='shiftSelected(document.forms["analyseterm"].elements["report_chosen"],-1);updateHiddenChooserField(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report"]);'
|
||
border='0'
|
||
src='<%=CurConfig.getImagePath()%>/chooser_orange/arrowUp_disabled.gif'
|
||
alt='Shift selected items down' />
|
||
<br><br>
|
||
<img name='shiftdown_report_chosen'
|
||
onmousedown='pushButton("shiftdown_report_chosen",true);'
|
||
onmouseup='pushButton("shiftdown_report_chosen",false);'
|
||
onmouseout='pushButton("shiftdown_report_chosen",false);'
|
||
onclick='shiftSelected(document.forms["analyseterm"].elements["report_chosen"],1);updateHiddenChooserField(document.forms["analyseterm"].elements["report_chosen"],document.forms["analyseterm"].elements["report"]);'
|
||
border='0'
|
||
src='<%=CurConfig.getImagePath()%>/chooser_orange/arrowDown_disabled.gif'
|
||
alt='Shift selected items up' />
|
||
</td>
|
||
</tr>
|
||
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
<tr height=1>
|
||
<td> </td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan=4>
|
||
<table style="width: 100%;">
|
||
<tr>
|
||
<td width="30%" align="right">
|
||
<%=new Button(" <3B><> <3B><> ","<22>ָ<EFBFBD>","doDefault()","","").getHtmlText()%>
|
||
</td>
|
||
<td width="40%" align="center">
|
||
<%=new Button(" ȷ <3B><> ","ȷ<><C8B7>","doQuery()","","").getHtmlText()%>
|
||
</td>
|
||
<td width="30%" align="left">
|
||
<%=new Button(" <3B><> <3B><> ","<22><><EFBFBD><EFBFBD>","parent.AsDialog.ClosePage();","","").getHtmlText()%>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</form>
|
||
</body>
|
||
</html>
|
||
<script type="text/javascript">
|
||
|
||
function cloneOption(option){
|
||
var out = new Option(option.text,option.value);
|
||
out.selected = option.selected;
|
||
out.defaultSelected = option.defaultSelected;
|
||
return out;
|
||
}
|
||
|
||
function shiftSelected(chosen,howFar){
|
||
var opts = chosen.options;
|
||
var newopts = new Array(opts.length);
|
||
var start, end, incr;
|
||
if(howFar > 0){
|
||
start = 0;
|
||
end = newopts.length;
|
||
incr = 1;
|
||
}else{
|
||
start = newopts.length - 1;
|
||
end = -1;
|
||
incr = -1;
|
||
}
|
||
for(var sel = start; sel != end; sel += incr){
|
||
if (opts[sel].selected) {
|
||
setAtFirstAvailable(newopts, cloneOption(opts[sel]), sel + howFar, -incr);
|
||
}
|
||
}
|
||
for(var uns = start; uns != end; uns += incr){
|
||
if (!opts[uns].selected) {
|
||
setAtFirstAvailable(newopts, cloneOption(opts[uns]), start, incr);
|
||
}
|
||
}
|
||
opts.length = 0;
|
||
for(var i=0; i<newopts.length; i++){
|
||
opts[opts.length] = newopts[i];
|
||
}
|
||
}
|
||
|
||
function setAtFirstAvailable(array,obj,startIndex,incr){
|
||
if (startIndex < 0) startIndex = 0;
|
||
if (startIndex >= array.length) startIndex = array.length -1;
|
||
for(var xxx=startIndex; xxx>= 0 && xxx<array.length; xxx += incr){
|
||
if (array[xxx] == null) {
|
||
array[xxx] = obj;
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
function moveSelected(from,to) {
|
||
newTo = new Array();
|
||
for(var i=0; i<to.options.length; i++){
|
||
newTo[newTo.length] = cloneOption(to.options[i]);
|
||
newTo[newTo.length-1].selected = false;
|
||
}
|
||
|
||
for(i=0; i<from.options.length; i++){
|
||
if (from.options[i].selected) {
|
||
newTo[newTo.length] = cloneOption(from.options[i]);
|
||
from.options[i] = null;
|
||
i--;
|
||
}
|
||
}
|
||
to.options.length = 0;
|
||
for(i=0; i<newTo.length; i++){
|
||
to.options[to.options.length] = newTo[i];
|
||
}
|
||
selectionChanged(to,from);
|
||
}
|
||
|
||
function updateHiddenChooserField(chosen,hidden){
|
||
hidden.value='';
|
||
var opts = chosen.options;
|
||
for(var i=0; i<opts.length; i++){
|
||
hidden.value = hidden.value + opts[i].value+'\n';
|
||
}
|
||
}
|
||
|
||
function selectionChanged(selectedElement,unselectedElement){
|
||
for(var i=0; i<unselectedElement.options.length; i++){
|
||
unselectedElement.options[i].selected=false;
|
||
}
|
||
form = selectedElement.form;
|
||
enableButton("movefrom_"+selectedElement.name,(selectedElement.selectedIndex != -1));
|
||
enableButton("movefrom_"+unselectedElement.name,(unselectedElement.selectedIndex != -1));
|
||
enableButton("shiftdown_"+selectedElement.name,(selectedElement.selectedIndex != -1));
|
||
enableButton("shiftup_"+selectedElement.name,(selectedElement.selectedIndex != -1));
|
||
enableButton("shiftdown_"+unselectedElement.name,(unselectedElement.selectedIndex != -1));
|
||
enableButton("shiftup_"+unselectedElement.name,(unselectedElement.selectedIndex != -1));
|
||
}
|
||
|
||
function enableButton(buttonName,enable){
|
||
var img = document.images[buttonName];
|
||
if (img == null) return;
|
||
var src = img.src;
|
||
var und = src.lastIndexOf("_disabled.gif");
|
||
if (und != -1) {
|
||
if(enable) img.src = src.substring(0,und)+".gif";
|
||
}else{
|
||
if(!enable){
|
||
var gif = src.lastIndexOf("_clicked.gif");
|
||
if (gif == -1) gif = src.lastIndexOf(".gif");
|
||
img.src = src.substring(0,gif)+"_disabled.gif";
|
||
}
|
||
}
|
||
}
|
||
|
||
function pushButton(buttonName,push){
|
||
var img = document.images[buttonName];
|
||
if (img == null) return;
|
||
var src = img.src;
|
||
var und = src.lastIndexOf("_disabled.gif");
|
||
if (und != -1) return false;
|
||
und = src.lastIndexOf("_clicked.gif");
|
||
if (und == -1) {
|
||
var gif = src.lastIndexOf(".gif");
|
||
if (push) img.src = src.substring(0,gif)+"_clicked.gif";
|
||
}else{
|
||
if (!push) img.src = src.substring(0,und)+".gif";
|
||
}
|
||
}
|
||
|
||
function doQuery(){
|
||
if(analyseterm.report_chosen.length == 0){
|
||
alert("<22><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>");
|
||
return;
|
||
}
|
||
|
||
var vReturn = "";
|
||
var vReportCount = analyseterm.report_chosen.length;
|
||
for(var i=0; i<vReportCount;i++){
|
||
var vTemp = analyseterm.report_chosen.options[i].value;
|
||
vReturn = vReturn+vTemp+",";
|
||
}
|
||
parent.AsDialog.ClosePage(vReturn);
|
||
|
||
<%-- var sReturn = RunJavaMethodTrans("com.amarsoft.app.awe.config.role.action.ManageRoleMenuRela","addRoleMenus","RoleID=<%=sRoleID%>,RelaValues="+vReturn);
|
||
if(sReturn == "SUCCEEDED"){
|
||
alert("<22>˵<EFBFBD><CBB5><EFBFBD>Ȩ<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>");
|
||
top.close();
|
||
}else{
|
||
alert("<22>˵<EFBFBD><CBB5><EFBFBD>Ȩʧ<C8A8>ܣ<EFBFBD>");
|
||
} --%>
|
||
}
|
||
|
||
function doDefault(){
|
||
analyseterm.report_available.options.length = 0;
|
||
analyseterm.report_chosen.length = 0;
|
||
|
||
var j = 0;
|
||
for(var i = 0; i < availableReportNameList.length; i++){
|
||
eval("analyseterm.report_available.options[" + j + "] = new Option(availableReportCaptionList[" + i + "], availableReportNameList[" + i + "])");
|
||
j++;
|
||
}
|
||
|
||
j = 0;
|
||
for(var i = 0; i < selectedReportNameList.length; i++){
|
||
eval("analyseterm.report_chosen.options[" + j + "] = new Option(selectedReportCaptionList[" + i + "], selectedReportNameList[" + i + "])");
|
||
j++;
|
||
}
|
||
}
|
||
|
||
doDefault();
|
||
</script>
|
||
<%@ include file="/IncludeEnd.jsp"%> |