<%@ 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>
<div class="single-form">
		<c:choose>
			<c:when test="${not empty edit && edit}">
				<div class="container">
			</c:when>
			<c:otherwise>
				<div class="container view-form">
			</c:otherwise>
		</c:choose>
		<form:form id="inputForm" modelAttribute="workExampleIndices" action="${ctx}/workexample/workExampleIndices/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<form:hidden path="parent.id"/>
			<form:hidden path="parentIds"/>
			<form:hidden path="isDisable"/>
			<sys:message content="${message}"/>
		<div class="form-group layui-row first lw12">
			<div class="layui-item layui-col-sm12">
				<label class="layui-form-label"><span class="require-item">*</span>名称：</label>
				<div class="layui-input-block with-icon">
					<c:choose>
						<c:when test="${not empty edit && edit}">
							<form:input  path="name" htmlEscape="false"  class="form-control layui-input required"/>
						</c:when>
						<c:otherwise>
							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workExampleIndices.name}"/>
						</c:otherwise>
					</c:choose>
				</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 with-icon">
					<c:choose>
						<c:when test="${not empty edit && edit}">
							<form:input  path="orderNum" readonly="true" htmlEscape="false"  class="form-control layui-input required"/>
						</c:when>
						<c:otherwise>
							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workExampleIndices.orderNum}"/>
						</c:otherwise>
					</c:choose>
				</div>
			</div>
			<c:if test="${workExampleIndices.orderNum > 1000}">
				<div class="layui-item layui-col-sm12">
					<label class="layui-form-label"><span class="require-item">*</span>指标类型：</label>
					<div class="layui-input-block with-icon">
						<c:choose>
							<c:when test="${not empty edit && edit}">
								<form:select path="view" class="form-control required simple-select">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('example_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</c:when>
							<c:otherwise>
								<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workExampleIndices.view, 'example_type', '')}"/>
							</c:otherwise>
						</c:choose>

					</div>
				</div>
			</c:if>
			<div class="layui-item layui-col-sm12">
				<label class="layui-form-label"><span class="require-item">*</span>禁用状态：</label>
				<div class="layui-input-block with-icon">
					<c:choose>
						<c:when test="${workExampleIndices.isDisable eq 0}">
							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="启用"/>
						</c:when>
						<c:otherwise>
							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="禁用"/>
						</c:otherwise>
					</c:choose>

				</div>
			</div>
		</div>
		</form:form>
	</div>
</div>
</body>
</html>