<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>工作流角色信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		var validateForm;
		function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $("#inputForm").submit();
			  return true;
		  }
	
		  return false;
		}
		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="sysRoleActivity" action="${ctx}/sys/sysroleactivity/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>

			<div class="form-group layui-row first">
				<div class="form-group-label"><h2>基础信息</h2></div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>角色名称：</label>
					<div class="layui-input-block">
						<form:input path="name" htmlEscape="false"  readonly="true"  class="form-control required layui-input "/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>编码：</label>
					<div class="layui-input-block">
						<form:input path="sort" readonly="true" htmlEscape="false" minlength="4" maxlength="4" class="layui-input form-control number required"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12">
					<label class="layui-form-label"><span class="require-item">*</span>角色类型：</label>
					<div class="layui-input-block">
						<input readonly="true" htmlEscape="false" class="layui-input form-control" value="${fns:getDictLabel(sysRoleActivity.type, 'sys_role_type', '')}" />
					</div>
				</div>
				<div class="layui-item layui-col-sm12 with-textarea">
					<label class="layui-form-label">备注信息：</label>
					<div class="layui-input-block">
						<form:textarea path="remarks" readonly="true" htmlEscape="false" rows="4"    class="form-control "/>
					</div>
				</div>
			</div>
			<div class="form-group layui-row">
				<div class="form-group-label"><h2>工作流明细</h2></div>
				<div class="layui-item layui-col-xs12 form-table-container" >
					<table id="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
						<thead>
						<tr>
								<%--<th width="30%"  style="text-align: center;">模块类型</th>--%>
							<th width="50%"  style="text-align: center;">工作流类型</th>
							<th width="50%"  style="text-align: center;">工作流环节</th>
						</tr>
						</thead>
						<tbody id="activityList">
						<c:if test="${not empty sysRoleActivity.activityList}">
							<c:forEach items="${sysRoleActivity.activityList}" var="activity" varStatus="index">
								<tr>
										<%--<td>
                                                ${activity.processKey}
                                        </td>--%>
									<td >
											${activity.activityName}
									</td>
									<td>
											${activity.name}
									</td>
								</tr>
							</c:forEach>
						</c:if>
						</tbody>
					</table>
				</div>
			</div>
			<div class="form-group layui-row">
				<div class="form-group-label"><h2>关联岗位明细</h2></div>
				<div class="layui-item layui-col-xs12 form-table-container" >
					<table id="contentTable3" class="table table-bordered table-condensed no-bottom-margin details">
						<thead>
						<tr>
							<th width="30%"  style="text-align: center;">岗位名称</th>
							<th width="30%"  style="text-align: center;">归属部门</th>
							<th width="40%"  style="text-align: center;">数据范围</th>
						</tr>
						</thead>
						<tbody id="roleList">
						<c:if test="${not empty sysRoleActivity.roleList}">
							<c:forEach items="${sysRoleActivity.roleList}" var="role" varStatus="index">
								<tr>
									<td style="text-align: center;">
											${role.name}
									</td>
									<td style="text-align: center;">
											${role.office.topCompany}
									</td>
									<td style="text-align: center;">
											${fns:getDictLabel(role.dataScope, 'sys_data_scope', '无')}
									</td>
								</tr>
							</c:forEach>
						</c:if>
						</tbody>
					</table>
				</div>
			</div>
		</form:form>

	</div>
</div>
</body>
</html>