
<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="com.blueland.bpm.engine.config.model.*"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<title>流程操作权限编辑</title>
<script>
	function changeFunc(){
		var selOpScopeVals="";
		var opScopeVal="";
		selOpScopeVals=$("#opScopeSel").val();
		if(selOpScopeVals=="点击进行多选"){
			selOpScopeVals="";
		}
		if(selOpScopeVals!=""){
			for(var i=0;i<selOpScopeVals.length;i++){
				if(i==0){
					opScopeVal+=";"+selOpScopeVals[i]+";";
				}else{
					opScopeVal+=selOpScopeVals[i]+";";
				}
			}
		}
		$("#opScope").val(opScopeVal);
	}
</script>
</head>
<body class="white-page">
<form action="${ctx}/actInfo/activityOperatePower/update.do" method="post">
	<div class="main-container" id="main-container">
		<div class="panel panel-primary">
			<div class="panel-body">
				<table class='table table-bordered form-table' border="0" cellspacing="0"
					   cellpadding="0" id="myTable">
					<!-- 存放隐藏域的区域 -->

					<!-- 存放表单的区域 -->
					<tr>
						<td>环节权限ID<font color="red">*</font>：
						</td>
						<td><input type="text" id="opId" name="opId" readonly="readonly" value="${activityOperatePower.opId}" />
						</td>
					</tr>
					<tr>
						<td>环节权限名称<font color="red">*</font>：
						</td>
						<td><input type="text" name="opName"
								   value="${activityOperatePower.opName}" id="opName"  style="width: 400px"/></td>
					</tr>
					<tr  style="display: none">
						<td>环节权限控制处理器：</td>
						<td><input type="text" name="opClassPath"
								   value="${activityOperatePower.opClassPath}" id="opClassPath"
								   style="width: 400px"/></td>
					</tr>
					<tr>
						<td>环节权限类型<font color="red">*</font>：
						</td>
						<td><select id="opType" name="opType" style="width: 300px">
							<c:forEach items="${activityOperatePower.opTypeMap}" var="item">
								<option ${activityOperatePower.opType== item.key?"selected":""} value="${item.key }">${item.value}</option>
							</c:forEach>
						</select></td>
					</tr>
					<tr>
						<td>环节权限范围<font color="red">*</font>：</td>
						<td>
							<select onchange="changeFunc()" id="opScopeSel" name="opScopeSel" autoWidth="true" style="width:250px;" multiple>
								<c:forEach items="${activityOperatePower.opScopeMap}" var="item">
									<option ${item.key=='0'?'rel=exclusive':''} ${fn:indexOf(activityOperatePower.opScope, item.key)!=-1?"selected":""} value="${item.key }">${item.value}</option>
								</c:forEach>
							</select></td>
						<input type="hidden" id="opScope" name="opScope"  value="${activityOperatePower.opScope }"/>
					</tr>
					<tr style="display: none">
						<td>环节权限父ID：</td>
						<td><input type="text" name="opParentId"
								   value="${activityOperatePower.opParentId}" id="opParentId"
						/></td>
					</tr>

					<tr>
						<td>环节权限排序：</td>
						<td><input type="text" name="opSort"
								   value="${activityOperatePower.opSort}" id="opSort"  /></td>
					</tr>
					<tr>
						<td>默认是否与环节绑定：</td>
						<td>
							<select id="opDefaultBind" name="opDefaultBind" style="width: 300px">
								<c:forEach items="${activityOperatePower.opDefaultBindMap}" var="item">
									<option ${activityOperatePower.opDefaultBind== item.key?"selected":""} value="${item.key }">${item.value}</option>
								</c:forEach>
							</select>
						</td>
					</tr>

					<tr>
						<td>备注：</td>

						<td><textarea rows="" cols="" name="opRemark" value="${activityOperatePower.opRemark}" id="opRemark"></textarea></td>

					</tr>
				</table>

				<div class="col-md-offset-1 col-md-9" style="text-align: center;">
					<button id="submitButton" class="btn btn-sm btn-primary" name="submitButton" type="submit">
						<span class="icon_save">保存</span>
						<i class="ace-icon fa fa-save bigger-110"></i>
					</button>
					<button type="button" class="btn btn-sm btn-primary"
							onclick="window.location='${ctx}/actInfo/activityOperatePower/list.do'">
						<span class="icon_back">返回</span>
						<i class="ace-icon fa fa-arrow-left"></i>
					</button>
				</div>
			</div>
		</div>
	</div>
</form>
</body>
</html>
