<%@page pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/capskin0/component.jsp"%>
<h:css href="/gocom/cap/auth/base/css/style-custom.css" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>功能管理</title>
</head>
<body style='overflow:auto;overflow-x:hidden'>
<h:form id="query_form" name="query_form"
action="org.gocom.cap.auth.base.function.manageFunction.flow"
checkType="blur" target="_self" method="post"
οnsubmit="return checkForm(this);">
<input type="hidden" name="_eosFlowAction" value="pageQuery" />
<table align="center" border="0" width="100%" class="form_table">
<tr>
<td class="form_label">功能编号:</td>
<td colspan="1"><!-- <h:text property="capFunction/funcId" /> -->
<h:text property="criteria/_expr[1]/funcId" /> <h:hidden
property="criteria/_expr[1]/_op" value="like" /> <h:hidden
property="criteria/_expr[1]/_likeRule" value="all" /></td>
<td class="form_label">功能名称:</td>
<td colspan="1"><!-- <h:text property="capFunction/funcName" /> -->
<h:text property="criteria/_expr[2]/funcName" /> <h:hidden
property="criteria/_expr[2]/_op" value="like" /> <h:hidden
property="criteria/_expr[2]/_likeRule" value="all" /></td>
</tr>
<tr>
<td class="form_label">功能类型:</td>
<td colspan="1"><d:select id="funcTypeList" nullLabel="全部"
dictTypeId="COF_FUNCTYPE" property="criteria/_expr[3]/funcType"
styleClass="textbox" style="width:133px;" /></td>
<td class="form_label">调用入口:</td>
<td colspan="1"><!-- <h:text property="capFunction/funcAction" /> -->
<h:text property="criteria/_expr[4]/funcAction" /> <h:hidden
property="criteria/_expr[4]/_op" value="like" /> <h:hidden
property="criteria/_expr[4]/_likeRule" value="all" /></td>
</tr>
<tr>
<td class="form_label">验证权限:</td>
<td colspan="1"><h:select id="isCheckList"
property="criteria/_expr[5]/ischeck" styleClass="textbox"
style="width:133px;">
<h:option label="全部" value="" />
<h:option label="是" value="1" />
<h:option label="否" value="0" />
</h:select></td>
<td class="form_label">可定义菜单:</td>
<td colspan="1"><h:select id="isMenuList"
property="criteria/_expr[6]/ismenu" styleClass="textbox"
style="width:133px;">
<h:option label="全部" value="" />
<h:option label="是" value="1" />
<h:option label="否" value="0" />
</h:select></td>
</tr>
<tr class="form_bottom">
<td colspan="4" class="form_bottom"><input type="hidden"
name="criteria/_entity"
value="org.gocom.cap.auth.base.authmgr.CapFunction"> 每页显示 <h:text
size="2" property="page/length" value="10"
validateAttr="minValue=1;maxValue=100;type=integer;isNull=true" />
<input type="hidden" name="page/begin" value="0"> <input
type="hidden" name="page/isCount" value="true"> <input
type="submit" value="查询" class="button"></td>
</tr>
</table>
<h:hidden property="criteria/_orderby[1]/_sort" value="asc" />
<h:hidden property="criteria/_orderby[1]/_property" value="funcId" />
</h:form>
<br />
<h:form name="page_form"
action="org.gocom.cap.auth.base.function.manageFunction.flow"
method="post">
<input type="hidden" name="_eosFlowAction" value="pageQuery">
<h:hiddendata property="criteria" />
<h:hidden property="page/begin" />
<h:hidden property="page/length" />
<h:hidden property="page/count" />
<h:hidden property="page/isCount" />
<table align="center" border="0" width="100%" class="EOS_table">
<tr>
<th align="center">选择</th>
<th>功能编号</th>
<th>功能名称</th>
<th>功能类型</th>
<th>调用入口</th>
<th>验证权限</th>
<th>可定义菜单</th>
</tr>
<w:checkGroup id="group1">
<l:iterate property="capFunctions" id="id1">
<tr class="<l:output evenOutput='EOS_table_row' />">
<td align="center"><w:rowCheckbox>
<h:param name='select_objs/funcId' iterateId='id1'
property='funcId' indexed='true' />
</w:rowCheckbox></td>
<td><b:write iterateId="id1" property="funcId" /></td>
<td><b:write iterateId="id1" property="funcName" /></td>
<td><script>
var funcType = '<b:write iterateId="id1" property="funcType"/>';
if(funcType){
var options = $id("funcTypeList").options;
var len = options.length;
for(var i=0;i<len;i++){
var optionValue = options[i].value;
if(funcType == optionValue){
document.write(options[i].text);
break;
}
}
}
</script></td>
<td><b:write iterateId="id1" property="funcAction" /></td>
<td><script>
var ischeck = '<b:write iterateId="id1" property="ischeck"/>';
if(ischeck){
var options = $id("isCheckList").options;
var len = options.length;
for(var i=0;i<len;i++){
var optionValue = options[i].value;
if(ischeck == optionValue){
document.write(options[i].text);
break;
}
}
}
</script></td>
<td><script>
var ismenu = '<b:write iterateId="id1" property="ismenu"/>';
if(ismenu){
var options = $id("isMenuList").options;
var len = options.length;
for(var i=0;i<len;i++){
var optionValue = options[i].value;
if(ismenu == optionValue){
document.write(options[i].text);
break;
}
}
}
</script></td>
</tr>
</l:iterate>
</w:checkGroup>
<tr>
<td colspan="7" class="command_sort_area"><span
style="float:left"> <input type="button" value="增加"
οnclick="addFunc();" class="button"> <l:greaterThan
property="page/size" targetValue="0" compareType="number">
<input type="button" value="修改" οnclick="updateFunc();"
class="button">
</l:greaterThan> <l:greaterThan property="page/size" targetValue="0"
compareType="number">
<input type="button" value="删除" οnclick="deleteFunc();"
class="button">
</l:greaterThan> </span> <span style="float:right"> <l:equal property="page/isCount"
targetValue="true">
共
<b:write property="page/count" />
条记录 第
<b:write property="page/currentPage" />
页/
<b:write property="page/totalPage" />
页
</l:equal> <l:equal property="page/isCount" targetValue="false">
第
<b:write property="page/currentPage" />
页
</l:equal> <input type="button" class="button"
οnclick="firstPage('page', 'pageQuery', null, null, 'page_form');"
value="首页"
<l:equal property="page/isFirst" targetValue="true">disabled</l:equal>>
<input type="button" class="button"
οnclick="prevPage('page', 'pageQuery', null, null, 'page_form');"
value="上页"
<l:equal property="page/isFirst" targetValue="true">disabled</l:equal>>
<input type="button" class="button"
οnclick="nextPage('page', 'pageQuery', null, null, 'page_form');"
value="下页"
<l:equal property="page/isLast" targetValue="true">disabled</l:equal>>
<l:equal property="page/isCount" targetValue="true">
<input type="button" class="button"
οnclick="lastPage('page', 'pageQuery', null, null, 'page_form');"
value="尾页"
<l:equal property="page/isLast" targetValue="true">disabled</l:equal>>
</l:equal> </span></td>
</tr>
</table>
</h:form>
<script>
//回调函数,提交query_form表单
function callBack(){
$id("query_form").submit();
}
//织出增加功能窗口进行编辑
function addFunc(){
//弹出窗口进行编辑
showModalCenter(contextPath+"/gocom/cap/auth/base/function/addFunc.jsp", null, callBack, 650, 290, "增加功能");
}
//更新功能信息
function updateFunc(){
var g = $id("group1");
if (g.getSelectLength() != 1) {
alert("请选择一行记录!");
return;
}
var selectValue = g.getSelectParams("select_objs/funcId")[0];
showModalCenter("org.gocom.cap.auth.base.function.getFunctionById.flow?funcId=" + selectValue, null, callBack, 650, 290, "修改功能");
}
//删除功能
function deleteFunc(){
var g = $id("group1");
if (g.getSelectLength() < 1) {
alert("请选择记录!");
return;
}
if(confirm("是否删除所选功能?")){
var selectValues = g.getSelectParams("select_objs/funcId");
var myAjax = new Ajax("org.gocom.cap.auth.base.funcMgr.deleteFunc.biz");
myAjax.addParam("funcIds", selectValues);
/**myAjax.onSuccess = function(){
$id("query_form").submit();
};
myAjax.onFailure = function(xml){
alert("删除失败,请重新操作或联系系统管理员。");
};*/
myAjax.submit();
var returnNode =myAjax.getValue("root/data/ret");
if (returnNode == "true"){
$id("query_form").submit();
}else{
alert("删除失败,请重新操作或联系系统管理员。");
}
}
}
</script>
</body>
</html>