<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;}
</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/config/list.html}" method="post">
	<ul class="seachform">
		<li>
			<label>参数编码</label>
			<input name="LIKE_paramCode" type="text" class="scinput" th:value="${search.get('LIKE_paramCode')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/config/edit.html}"><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>操作</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count}" ></td>
				<td th:text="${item.paramCode}"></td>
				<td th:text="${item.paramVal}" ></td>
				<td th:text="${item.paramDesc}" ></td>
				<td>
					<a href="javascript:;" th:onclick="'deleteById(\''+${item.id}+'\')'"  class="tablelink" >删除</a>
					<a th:href="@{/sys/config/edit.html(id=${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>
<script type="text/javascript">
function deleteById(id){
	parent.layer.confirm("确定删除该系统参数吗？",
			{icon: 4, btn: ['确定','取消']
	}, function(){
		$.ajax({
			url: '[[${sysUrl}]]/sys/config/deleteConfig',
			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>
</body>
</html>