<%@ 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(obj){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            debugger
            if(validateForm.form()){
                if(obj == 1){
                    $("#inputForm").attr("action","${ctx}/caseinfo/caseInfo/caseInfoShare");
                }
                $("#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">
		<form:form id="inputForm" modelAttribute="caseInfo" action="${ctx}/caseinfo/caseInfo/caseInfoShare" method="post" class="form-horizontal">
		<form:hidden path="id"/>
			<div class="form-group layui-row first lw7">
				<div class="form-group-label"><h2>案例信息</h2></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 htmlEscape="false"  class="form-control layui-input required" readonly="true" value="${caseInfo.caseCategory.name}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12">
					<label class="layui-form-label double-line"><span class="require-item">*</span>案例名称：</label>
					<div class="layui-input-block">
						<div class="input-group">
							<input htmlEscape="false"  readonly="true"  class="form-control layui-input" value="${caseInfo.name}"/>
							<span class="input-group-btn">
								<label style="cursor: pointer;" class="form-status" onclick="openDialogView('查看案例详情', '${ctx}/caseinfo/caseInfo/form?id=${caseInfo.id}&tabId=0','90%','90%')">查看</label>
							</span>
						</div>

					</div>
				</div>
				<div class="layui-item layui-col-sm12">
					<label class="layui-form-label">案例类型：</label>
					<div class="layui-input-block">
						<input type="radio" value="1" class="i-checks" id="shareStatus" name="shareStatus" onclick="display(this.value)" checked="checked">
						<label>一般案例</label>
						<input type="radio" value="2" class="i-checks" id="shareStatus" name="shareStatus" onclick="display(this.value)" >
						<label>典型案例</label>
					</div>
				</div>
			</div>
	</form:form>

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