<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
<script src="js/jquery.form.min.js" th:src="@{/static/js/jquery.form.min.js}"></script>

 <style>
   body{min-width:180px;}
       .select1{
   		    width:100%;
		    height: 32px;
		    line-height: 32px;
		    border-top: solid 1px #a7b5bc;
		    border-left: solid 1px #a7b5bc;
		    border-right: solid 1px #ced9df;
		    border-bottom: solid 1px #ced9df;
		    opacity:1;
	        margin-bottom: 10px;
    	}
    	.btn{
    	  width: 100px;
    	}
     label.control-label-error {color: Red;}	
    </style>
</head>

<body>
<div class="formbody">
	<form id="submitFrom"   method="post" class="form-horizontal" enctype="multipart/form-data">
		     <input type="hidden" name="libId" id="libId" th:value="${libId}"/>
		<ul class="forminfo">
		       <li class="clearfix" id="clearfix">
				    <label>导入考点：<b>*</b></label>
					<input type="file"  name="file" id="myFile"/>
			   </li>
				<li>
					<label>&nbsp;</label>
					<button type="button" class="btn" onclick="roleFrom();">导入</button>
					<button type="button" class="btn" onclick="closeWin();">取消</button>
				</li>
		</ul>
	</form>
</div>
</body>
<script type="text/javascript">
function roleFrom(){
	var files = $("#myFile").val();
	if(files == ""){
		alert("请选择文件");
		return;
	}
	$('#saveAnswer').removeAttr("onclick");
	var url="[[${sysUrl}]]/sys/zuoyb/knowHowDetilsKdImportSave";
	var params = $("#submitFrom").serialize();
	 $("#submitFrom").ajaxSubmit({
		  type: 'post', // 提交方式 get/post 
	        url: url, // 需要提交的 url 
	        data:params, 
	        success: function(data) {
	        	if(data.meta.success){
					parent.layer.msg("导入成功",{icon:1});
					closeWin();
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
					closeWin();
				}
	        }
		});
}
function closeWin(){
	parent.location.reload();
	parent.layer.close(parent.layer.getFrameIndex(window.name));
}



</script>
</html>