<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/storyTaskList.html}" method="post">
	<input type="hidden" name="EQ_storyId" th:value="${search.get('EQ_storyId')}">
	<ul class="seachform">
		<li>
			<label>标题</label>
			<input name="LIKE_title" type="text" class="scinput" th:value="${search.get('LIKE_title')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/story/storyTaskAdd.html(storyId=${search.get('EQ_storyId')})}"><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/storyList.html}"><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>
	                <th>古诗注释</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.imgTitle}" th:text="${item.imgTitle} ? (${#strings.length(item.imgTitle)} &gt; 10 ? ${#strings.substring(item.imgTitle,0,10)} :${item.imgTitle} ) :'' ">
					</td>
					<!--
					 <td th:title="${item.title}" th:text="${item.title} ? (${#strings.length(item.title)} &gt; 10 ? ${#strings.substring(item.title,0,10)} :${item.title} ) :'' ">
					</td>
					<td th:title="${item.titleLong}" th:text="${item.titleLong} ? (${#strings.length(item.titleLong)} &gt; 10 ? ${#strings.substring(item.titleLong,0,10)} :${item.titleLong} ) :'' ">
					</td>
					<td th:title="${item.voiceTitle}" th:text="${item.voiceTitle} ? (${#strings.length(item.voiceTitle)} &gt; 10 ? ${#strings.substring(item.voiceTitle,0,10)} :${item.voiceTitle} ) :'' ">
					</td> -->
					
					<td th:title="${item.gsAims}" th:text="${item.gsAims} ? (${#strings.length(item.gsAims)} &gt; 10 ? ${#strings.substring(item.gsAims,0,10)} :${item.gsAims} ) :'' ">
					</td>
					<td th:title="${item.gsText}" th:text="${item.gsText} ? (${#strings.length(item.gsText)} &gt; 10 ? ${#strings.substring(item.gsText,0,10)} :${item.gsText} ) :'' ">
					</td>
					<td th:title="${item.gsNote}" th:text="${item.gsNote} ? (${#strings.length(item.gsNote)} &gt; 10 ? ${#strings.substring(item.gsNote,0,10)} :${item.gsNote} ) :'' ">
					</td>
					<td th:title="${item.gsFanyi}" th:text="${item.gsFanyi} ? (${#strings.length(item.gsFanyi)} &gt; 10 ? ${#strings.substring(item.gsFanyi,0,10)} :${item.gsFanyi} ) :'' ">
					</td>
					
					
					<td  >
					  <audio th:if="${item.voice !=null && item.voice !=''}"  controls="controls" th:src="${imgUrl}+''+${item.voice}" ></audio>
					</td>
					<!-- <td th:title="${item.taskName}" th:text="${item.taskName} ? (${#strings.length(item.taskName)} &gt; 10 ? ${#strings.substring(item.taskName,0,10)} :${item.taskName} ) :'' ">
					</td> -->
					<td th:text="${item.daysNum}" ></td>
					<td  class="imgtd div">
							<img  th:if="${item.qrCode}!=null" th:src="${imgUrl}+''+${item.qrCode}" style="width: 50px;height: 50px;" />
					</td>
					<td>
					 <a th:href="@{/sys/story/storyTaskAdd.html(id=${item.id})}" class="tablelink" >修改</a>
					 <a href="javascript:;" th:onclick="'deleteById(\''+${item.id}+'\')'"  class="tablelink" >删除</a>
					<!--  
					 <a th:href="@{/sys/story/storyTaskImg.html(EQ_objectId=${item.id},EQ_storyId=${item.storyId})}" class="tablelink" >图片列表</a>
					 <a th:href="@{/sys/story/storyCardList.html(EQ_storyTaskId=${item.id},EQ_storyId=${item.storyId})}" class="tablelink" >打卡列表</a>
					  -->
					 <a th:href="@{/sys/story/storyTaskTopicList.html(EQ_storyTaskId=${item.id},EQ_storyId=${item.storyId})}" 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/storyTaskDelete',
			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>