<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/knowHowDetailKdList.html}" method="post">
	<input type="hidden" name="EQ_howId" th:value="${search.get('EQ_howId')}">
	<input type="hidden" name="EQ_howDetailsId" th:value="${search.get('EQ_howDetailsId')}">
		<input type="hidden" name="EQ_courseName" th:value="${search.get('EQ_courseName')}">
	<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="semester" >
					     <option value=""    >全部</option>
					      <option value="1"  th:selected="${ search.get('semester') eq '1' }"  >上学期</option>
						 <option  value="2"  th:selected="${ search.get('semester') eq '2' }" >下学期</option>
					</select>
		</li>
		<li>
		<label>版本</label>
					<select class="scinput select_width" name="banben" >
					     <option value=""   >全部</option>
					     
					     <option th:each="version:${versions['数学'] }"  th:selected="${search.get('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('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('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('banben') eq '1' && search.get('EQ_courseName')  eq '数学' }"  >北师大</option> -->
<!-- 						 <option  value="2" th:selected="${ search.get('banben') eq '2' && search.get('EQ_courseName')  eq '数学' }"  >人教版</option> -->
<!-- 						 <option  value="5" th:selected="${ search.get('banben') eq '5' && search.get('EQ_courseName')  eq '数学' }"  >江苏版</option> -->
<!-- 						 <option  value="6" th:selected="${ search.get('banben') eq '6' && search.get('EQ_courseName')  eq '数学' }"  >思维拓展</option> -->
						 
<!-- 						 <option  value="2" th:selected="${ search.get('banben') eq '2' && search.get('EQ_courseName')  eq '语文' }"  >人教(部编)</option> -->

<!-- 						 <option value="2" th:selected="${ search.get('banben') eq '2' && search.get('EQ_courseName') eq '英语' }"   >教科版</option> -->
<!-- 						 <option  value="3" th:selected="${ search.get('banben') eq '3' }"  >沪教版（新）</option> -->
<!-- 						 <option  value="7" th:selected="${ search.get('banben') eq '7' }"  >朗文版</option> -->
<!-- 						 <option  value="8" th:selected="${ search.get('banben') eq '8' }"  >人教版（PEP）</option> -->
<!-- 						  <option  value="9" th:selected="${ search.get('banben') eq '9' }"  >牛津版</option> -->
					</select>
		</li>
		<li>
			<label>考点内容</label>
			<input name="LIKE_name" type="text" class="scinput" th:value="${search.get('LIKE_name')}"/>
		</li>
		<li>
			<label>id</label>
			<input name="LIKE_id" type="text" class="scinput" th:value="${search.get('LIKE_id')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
				<ul class="toolbar"  th:onclick="'knowHowDetailAdd(\''+${search.get('EQ_howId')}+'\',\''+${search.get('EQ_howDetailsId')}+'\',\''+${search.get('EQ_courseName')}+'\')'">
					<li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>新增</li>
				</ul>
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/zuoyb/knowHowDetailList.html(EQ_howId=${search.get('EQ_howId')},EQ_howDetailsId=${search.get('EQ_howDetailsId')},EQ_courseName=${search.get('EQ_courseName')})}"><li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/goto.png}" /></span>返回</li></a>
				</ul>
		</li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th>序号</th>
		        <th>考点内容</th>
		        <th style="text-align: center;">排序</th>
		        <th>要点梳理</th>
		        <th>标签</th>
		        <th>图片</th>
		        <th>添加时间</th>
		        <th>操作</th>
					                
		    </tr>
		</thead>
		<tbody>
		
									<tr th:each="sort:${list}" >
										<td th:text="${sortStat.count}"    th:title="${sort.id}" ></td>
									   	<td  th:title="${sort.name}" th:text="${sort.name} ? (${#strings.length(sort.name)} &gt; 20 ? ${#strings.substring(sort.name,0,20)} :${sort.name} ) :'' " ></td>
									   	 <td style="text-align: center;"  >
												 <input type="number" th:value="${sort.num}" th:onBlur="'updateCourseNum(\''+${sort.id}+'\',\''+${sort.num}+'\',this,2)'"  class="dfinput" style="width: 70px; height: 30px;color: red;"  >
										</td>
									   	<td th:utext="${sort.ydsl} ? (${#strings.length(sort.ydsl)} &gt; 20 ? ${#strings.substring(sort.ydsl,0,20)} :${sort.ydsl} ) :'' "   th:title="${sort.ydsl}" ></td>
									   	 	<td th:text="${sort.label}" ></td>
									   	<td  class="imgtd">
							              <img  th:if="${sort.img !='' && sort.img !=null}" th:src="${imgUrl}+''+${sort.img}+'?x-oss-process=image/resize,m_lfit,h_100,w_100'" style="width: 50px;height: 50px;" />
					                      </td>
										<td  th:text="${#calendars.format(sort.create_time,'yyyy-MM-dd HH:mm')}" ></td>
										<td>
										 <a  th:href="@{/sys/zuoyb/knowHowDetailKdVersionList.html(EQ_howDetailsId=${sort.how_details_id},EQ_howDetailsKdId=${sort.id},EQ_howId=${sort.how_id},EQ_courseName=${search.get('EQ_courseName')})}"  class="tablelink" >考点版本</a>
										 <a href="javascript:;"   th:onclick="'updateById(\''+${sort.id}+'\')'"  class="tablelink" >修改</a>
				   					 </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 updateCourseNum(id,oldNum,_this,type){
	var num = $(_this).val();
	if(num == oldNum){
		return false;
	}
	if(num ==''|| num ==null){
		return false;
	}
	$(_this).removeAttr("onBlur");
	$.ajax({
		url : "[[${sysUrl}]]/sys/zuoyb/updateKnowHowDetailKdNum",
		type : "post",
		data : {
			id : id,
			num : num
		},
		dataType : "json",
		success : function(data) {
			if(data.meta.success){
				 parent.layer.msg('操作成功',{icon:1});
				 $(_this).attr("onBlur","updateCourseNum("+id+","+num+",this,"+type+")");
			}else{
				parent.layer.msg('操作失败',{icon: 9})
				$(_this).attr("onBlur","updateCourseNum("+id+","+oldNum+",this,"+type+")");
			}
		}
	});
}


function knowHowDetailAdd(howId,howDetailsId,courseName){
	layer.open({
	    type: 2,
	    title: "添加考点",
	    closeBtn: 1, //不显示关闭按钮
	    shift: 0.8,
	    //offset: '100px',
	    area: ['100%', '100%'],
	    content: "[[${sysUrl}]]/sys/zuoyb/knowHowDetailKdAdd.html?howId="+howId+"&howDetailsId="+howDetailsId+"&courseName="+courseName
	});
}
function updateById(id){
	layer.open({
	    type: 2,
	    title: "修改考点",
	    closeBtn: 1, //不显示关闭按钮
	    shift: 0.8,
	    //offset: '100px',
	    area: ['100%', '100%'],
	    content: "[[${sysUrl}]]/sys/zuoyb/knowHowDetailKdAdd.html?id="+id
	});
}

</script>
</html>