<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> 
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 90px;
	}
	.date_width{
	     width: 100px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">后台系统管理</a></li>
		<li><a href="#">考点版本</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/zuoyb/getHowDetailsKdNameList.html}" method="post">
	<input type="hidden" name="EQ_libId" th:value="${search.get('EQ_libId')}">
	<input type="hidden" name="EQ_howId" th:value="${search.get('EQ_howId')}">
	<input type="hidden" id="sortId" name="sortId" th:value="${search.get('sortId')}">
	<input type="hidden" name="EQ_howDetailsKdId" th:value="${search.get('EQ_howDetailsKdId')}">
		<input type="hidden" name="EQ_courseName" th:value="${search.get('EQ_courseName')}">
		<input type="hidden" name="beforeHowdetailsKdId" th:value="${search.get('beforeHowdetailsKdId')}">
	<ul class="seachform">
		<li>
		<label>年级</label>
					<select class="scinput select_width" name="EQ_grade" >
					     <option value=""    >全部</option>
						 <option  th:each="sort:${grade}"  th:value="${sort.aliases}"   th:selected="${ sort.aliases  eq search.get('EQ_grade')  }"     th:text="${sort.name}" ></option>
					</select>
		</li>
		<li>
		<label>学期</label>
					<select class="scinput select_width" name="EQ_semester" >
					     <option value=""    >全部</option>
					      <option value="1"  th:selected="${ search.get('EQ_semester') eq '1' }"  >上学期</option>
						 <option  value="2"  th:selected="${ search.get('EQ_semester') eq '2' }" >下学期</option>
					</select>
		</li>
		<li>
		<label>版本</label>
					<select class="scinput select_width" name="EQ_banben" >
					     <option value=""   >全部</option>
					     
					     <option th:each="version:${versions['数学'] }"  th:selected="${search.get('EQ_banben') eq (version.versionType+'') && search.get('EQ_courseName') eq '数学'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
						 <option th:each="version:${versions['语文'] }"  th:selected="${search.get('EQ_banben') eq (version.versionType+'') && search.get('EQ_courseName') eq '语文'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
					 	 <option th:each="version:${versions['英语'] }"  th:selected="${search.get('EQ_banben') eq (version.versionType+'') && search.get('EQ_courseName') eq '英语'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
					     
					     
<!-- 						 <option value="1" th:selected="${ search.get('EQ_banben') eq '1'  && search.get('EQ_courseName')  eq '数学'  }"   >北师大</option> -->
<!-- 						 <option  value="2" th:selected="${ search.get('EQ_banben') eq '2' && search.get('EQ_courseName')  eq '数学' }"  >人教版</option> -->
<!-- 						 <option  value="5" th:selected="${ search.get('EQ_banben') eq '5' && search.get('EQ_courseName')  eq '数学' }"  >江苏版</option> -->
<!-- 						 <option  value="6" th:selected="${ search.get('EQ_banben') eq '6' && search.get('EQ_courseName')  eq '数学' }"  >思维拓展</option> -->
						 
<!-- 						 <option  value="2" th:selected="${ search.get('EQ_banben') eq '2' && search.get('EQ_courseName')  eq '语文' }"  >人教(部编)</option> -->
						 

<!-- 						 <option value="2" th:selected="${ search.get('EQ_banben') eq '2' && search.get('EQ_courseName') eq '英语' }"   >教科版</option> -->
<!-- 						 <option  value="3" th:selected="${ search.get('EQ_banben') eq '3' }"  >沪教版（新）</option> -->
<!-- 						 <option  value="7" th:selected="${ search.get('EQ_banben') eq '7' }"  >朗文版</option> -->
<!-- 						 <option  value="8" th:selected="${ search.get('EQ_banben') eq '8' }"  >人教版（PEP）</option> -->
<!-- 						 <option  value="9" th:selected="${ search.get('EQ_banben') eq '9' }"  >牛津版</option> -->
					</select>
		</li>
		<li>
			<label>考点</label>
			<input name="LIKE_alias" type="text" class="scinput" th:value="${search.get('LIKE_alias')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		
		<li>
				<ul class="toolbar" id="select">
					<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>选择</li>
				</ul>
		</li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		         <th><input type="checkbox"></th>
		        <th>序号</th>
		        <th>科目</th>
		        <th>版本</th>
		        <th>考点内容</th>
		        <th>年级</th>
		        <th>学期</th>
		        <th>排序</th>
		    </tr>
		</thead>
		<tbody>
		
									<tr th:each="sort:${list}" >
									    <td><input name="selectlist" type="radio" th:data-id="${sort.id}" th:checked="${ sort.id eq search.get('beforeHowdetailsKdId')  }" /></td>
									   	<td th:text="${sortStat.count}" ></td>
									   	<td th:text="${sort.course_name}" ></td>
										<td th:switch="${sort.type}" >
					  					  <span th:case="1" class="stylecss">北师大</span>
					  					  <span th:case="2" class="stylecss">人教版</span>
					    				  <span th:case="*" >其他</span>
										</td>
									   	<td th:text="${sort.alias}" ></td>
										
									   
										<td>
										 <span th:each="gr:${grade}"  th:if="${ gr.aliases eq (sort.grade_num+'') }"  th:text="${gr.name}"></span>
										 </td>
										<td th:switch="${sort.semester}" >
					  					  <span th:case="1" class="stylecss">上学期</span>
					  					  <span th:case="2" class="stylecss">下学期</span>
					    				  <span th:case="*" ></span>
										</td>
											<td th:text="${sort.num}" ></td>
									</tr>
		</tbody>
	</table>
	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>
</body>
<script type="text/javascript">
$(function(){
	 
	$('#select li.click').click(function () {
		$('[name=selectlist]:radio:checked').each(function() {
				 var id = $(this).attr('data-id');
				 console.log(id);
				 showIndex(id);
		  });	 
		 });		
	   });
	  



function showIndex(id){
	var content ="您确定要更换吗?";
	parent.layer.confirm(content, {
		icon: 4, btn: ['确定','关闭'] //按钮
	}, function(){
		var url="[[${sysUrl}]]/sys/zuoyb/updateBeforeKd";
		var sortId= $("#sortId").val();
		var params ={
			     	'beforeKdId' : id,
		            'sortId' : sortId
		         };
		$.post(url,params,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>