<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;}
	.uploadify {
    left: 1px;
   }
</style>
<style type="text/css">
		.head td{
			background:  repeat-x;
    height: 3px;
    line-height: 34px;
    border-bottom: solid 1px #b6cad2;
    text-indent: 21px;
    text-align: left;		
		}
	</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">运营管理</a></li>
		<li><a th:href="@{/sys/story/storyList.html}">打卡任务</a></li>
		<li><a  href="#">故事列表</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/story/storyTaskTopicList.html}" method="post">
	<input type="hidden" name="EQ_storyId" th:value="${search.get('EQ_storyId')}">
	<input type="hidden" name="EQ_storyTaskId" th:value="${search.get('EQ_storyTaskId')}">
	<ul class="seachform">
		<li>
			<label>内容</label>
			<input name="LIKE_name" type="text" class="scinput" th:value="${search.get('LIKE_name')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/story/storyTaskTopicAdd.html(storyId=${search.get('EQ_storyId')},storyTaskId=${search.get('EQ_storyTaskId')})}"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>新增</li></a>
				</ul>
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/story/storyTaskList.html(EQ_storyId=${search.get('EQ_storyId')})}"><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 style="width: 50px;">序号</th>
	                <th>内容</th>
	                <th>选项</th>
	               	<th>答案</th>
	               	<th>解析</th>
	                <th>题目标签</th>
	                <th>操作</th>
	                
	            </tr>
	        </thead>
            <tbody>
				<tr th:each="item:${list}" >
					<td th:text="${itemStat.count}" th:data-id="${item.id}" class="usercount"></td>
					<td th:title="${item.name}" th:text="${item.name} ? (${#strings.length(item.name)} &gt; 10 ? ${#strings.substring(item.name,0,10)} :${item.name} ) :'' ">
					</td>
					<td th:title="${item.opt}" th:text="${item.opt} ? (${#strings.length(item.opt)} &gt; 10 ? ${#strings.substring(item.opt,0,10)} :${item.opt} ) :'' ">
					</td>
					<td th:title="${item.answer}" th:text="${item.answer} ? (${#strings.length(item.answer)} &gt; 10 ? ${#strings.substring(item.answer,0,10)} :${item.answer} ) :'' ">
					</td>
					<td th:title="${item.resolve}" th:text="${item.resolve} ? (${#strings.length(item.resolve)} &gt; 10 ? ${#strings.substring(item.resolve,0,10)} :${item.resolve} ) :'' ">
					</td>
					<td  th:switch="${item.type}">
					   <span th:case="1">记忆</span>
					   <span th:case="2">文字</span>
					   <span th:case="3">鉴赏</span>
					   <span th:case="*">运用</span>
					</td>
					
					<td>
					 <a th:href="@{/sys/story/storyTaskTopicAdd.html(id=${item.id})}" class="tablelink" >修改</a>
					 <a href="javascript:;" th:onclick="'deleteById(\''+${item.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 deleteById(id){
	parent.layer.confirm("确定删除吗？",
			{icon: 4, btn: ['确定','取消']
	}, function(){
		$.ajax({
			url: '[[${sysUrl}]]/sys/story/storyTaskTopicDelete',
			type: "post",
			data:{
				'id': id
			},
			dataType: "json",
			success:function(data){
					
					if(data.meta.success){
						parent.layer.msg("删除成功",{icon:1});
				    	setTimeout(function(){
							location.reload();
						},1000);
					}else{
						parent.layer.msg(data.meta.message,{icon:11});
					}
			}
		});
	});
} 

</script>
</html>