308 lines
11 KiB
Plaintext
308 lines
11 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
|
<%@ include file="/IncludeBeginMD.jsp"%><%
|
|
|
|
String sRoleID = CurPage.getParameter("itemno");
|
|
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.com.tenwa.app.entity.Flowpageconfig.CODE_LIBRARY");
|
|
//String param="ButtonFLowDefault";
|
|
String queryStr = "SELECT itemno,itemname FROM O"+
|
|
" WHERE codeno=(SELECT rm.attribute3 FROM jbo.com.tenwa.app.entity.Flowpageconfig.CODE_LIBRARY rm WHERE rm.itemno =:itemno)";
|
|
List<BizObject> ml = bm.createQuery(queryStr).setParameter("itemno",sRoleID).getResultList(false);
|
|
for(BizObject bo : ml){
|
|
String itemno = bo.getAttribute("itemno").getString();
|
|
String itemname = bo.getAttribute("itemname").getString();
|
|
String displayName = itemno +" "+itemname;
|
|
out.println("availableReportCaptionList[" + num + "] = '" + displayName + "';\r");
|
|
out.println("availableReportNameList[" + num + "] = '" + itemno + "';\r");
|
|
num++;
|
|
}
|
|
//String param2="ViewTabProject";
|
|
/* queryStr = "SELECT itemno,itemname FROM O"+
|
|
" WHERE codeno=(SELECT rm.attribute3 FROM jbo.com.tenwa.app.entity.Flowpageconfig.CODE_LIBRARY rm WHERE rm.itemno =:itemno)";
|
|
List<BizObject> ml1 = bm.createQuery(queryStr).setParameter("itemno",sRoleID).getResultList(false);
|
|
num = 0;
|
|
for(BizObject bo : ml1){
|
|
String itemno = bo.getAttribute("itemno").getString();
|
|
String itemname = bo.getAttribute("itemname").getString();
|
|
String displayName = itemno +" "+itemname;
|
|
out.println("selectedReportCaptionList[" + num + "] = '" + displayName + "';\r");
|
|
out.println("selectedReportNameList[" + num + "] = '" + itemno + "';\r");
|
|
num++;
|
|
} */
|
|
%>
|
|
setDialogTitle("对流程编号【<%=sRoleID%>】进行配置");
|
|
</script>
|
|
<html>
|
|
<head>
|
|
<!-- <title>主菜单授权</title> -->
|
|
</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 colspan="4">
|
|
<span>选取要新增的主菜单</span>
|
|
</td>
|
|
</tr> -->
|
|
<!-- <tr>
|
|
<td bgcolor='#DDDDDD'>
|
|
<span class='dialog-label'>可新增的主菜单列表</span>
|
|
</td>
|
|
<td bordercolor='#DDDDDD'></td>
|
|
<td bgcolor='#DDDDDD'>
|
|
<span class='dialog-label'>已配置的主菜单列表</span>
|
|
</td>
|
|
<td></td>
|
|
</tr> -->
|
|
<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' style='overflow:auto;'>
|
|
<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(" 恢 复 ","恢复","doDefault()","","").getHtmlText()%>
|
|
</td>
|
|
<td width="40%" align="center">
|
|
<%=new Button(" 确 定 ","确定","doQuery()","","").getHtmlText()%>
|
|
</td>
|
|
<td width="30%" align="left">
|
|
<%=new Button(" 返 回 ","返回","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("请选择要新增的主菜单!");
|
|
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("菜单授权成功!");
|
|
top.close();
|
|
}else{
|
|
alert("菜单授权失败!");
|
|
} --%>
|
|
}
|
|
|
|
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"%> |