<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>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 220px;
	}
	.date_width{
	     width: 150px;
	}
	
	.tablelist th,td{
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	.tablelist td a{
    	text-decoration: underline;
	}
	img{
		margin-left: 3px;
	}
</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/poster/template/list.html}" method="post">
	<input type="hidden" name="pageSize" id="pageSize" value="10" />
	<ul class="seachform">
			<li>
			 <label>模板名称</label>
			  <input name="LIKE_templateName" type="text" class="scinput" th:value="${search.LIKE_templateName}"  />
		    </li>
			<li>
				<input type="button" class="scbtn" value="查询" />
			</li>
			<li>
				<ul class="toolbar">
					<a href="javascript:;" onclick="edit('')">
						<li class="click"><span><img th:src="@{/static/sys/images/t01.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 >logo1坐标信息</th>
		    	<th >logo2坐标信息</th>
		    	<th >二维码1坐标信息</th>
		    	<th >二维码2坐标信息</th>
		    	<th >联系人坐标信息</th>
		    	<th >地址坐标信息</th>
		    	<th >模板宽度(px)</th>
		    	<th >字体大小(px)</th>
		    	<th >操作 </th>
		    </tr> 
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count+((page.pageNo-1)*page.pageSize) }"></td>
				<td th:title="${item.templateName}" th:text="${item.templateName}"></td>
				<td>
					<img th:each="image:${#strings.listSplit(item.backImg,',')}" style="width: 50px;height: 50px;" th:src="${imgUrl+image}">
				</td>
				<td th:text="${item.createTime}"></td>
				<td th:text="${item.logoPosition}"></td>
				<td th:text="${item.logoPosition2}"></td>
				<td th:text="${item.qrcodePosition1}"></td>
				<td th:text="${item.qrcodePosition2}"></td>
				<td th:text="${item.numberPosition}"></td>
				<td th:text="${item.addressPosition}"></td>
				<td th:text="${item.backLength}"></td>
				<td th:text="${item.fontSize}"></td>
				<td >
					<a style="color: red" th:href="${'javascript:activityDel(''' + item.id + ''')'}"  class="tablelink">删除</a>
					<a  th:href="${'javascript:edit(''' + 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 edit(id){
		var title="添加活动";
		if(id!=null && id!='' && id!=undefined){
			title="编辑活动";
		}
		parent.layer.open({
		    type: 2,
		    title: title,
		    closeBtn: 1, //不显示关闭按钮
		    shift: 0.8,
		    offset: '100px',
		    area: ['50%', '60%'],
		    content: '[[${sysUrl}]]/sys/poster/template/edit.html?id='+id
		});
	}
	
	function activityDel(id){
		parent.layer.confirm("您确定要删除活动?", {
			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
		}, function(){
			var url="[[${sysUrl}]]/sys/poster/template/del?id="+id;
			var params ={};
			$.post(url,params,function(data){
				if(data.meta.success){
					parent.layer.msg("删除成功",{icon:1});
					location.reload();
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
				}
			});
		});
	}
	function exportAll() {
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/poster/exportDetail";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/poster/activity/list.html";
		},3000);
	}
	
	
	
	
</script>

</html>