<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>
<link rel="stylesheet" href="https://www.17sucai.com/preview/1528155/2019-03-29/v/css/jsmodern.min.css">
<script src="https://www.17sucai.com/preview/1528155/2019-03-29/v/js/jsmodern.min.js"></script>

<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.config.js?version=1811271348"></script>
<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/ueditor.all.min.js?version=1812061808"></script>
<script type="text/javascript" src="https://www.sharingschool.com/dcui/tools/ueditor/lang/zh-cn/zh-cn.js?version=1811271348"></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;
	}
	
</style>




<body style="min-width: 100%;margin-top: 20px">
<div class="formbody">
	<form id="submitFrom" method="post" class="form-horizontal form-validate">
		<input type="hidden" name="id" id="id"  th:value="${trainUser.id}"/>
		<ul class="forminfo">
			 <li class="clearfix" >
				<label>权限：<b>*</b></label>
				<select class="scinput select_width"  name="roleType"  style="width: 345px;"  >
					<option value="1"  th:selected="${trainUser.roleType==1 ? true : false}">校长端</option>
					<option value="2"  th:selected="${trainUser.roleType==2 ? true : false}">老师端</option>
				</select>
		    </li>
			<li class="clearfix" >
				<label>手机号码：<b>*</b></label>
				<input type="text"  name="mobile" th:disabled="${trainUser.id!=null ? true : false}" class="dfinput fl" th:value="${trainUser.mobile}"/>
			</li>
			<li class="clearfix" >
				<label>密码：<b>*</b></label>
				<input type="password" name="password"  autocomplete="off" class="dfinput fl" id="password" />
			</li>
			<li class="clearfix" >
				<label>姓名：<b>*</b></label>
				<input type="text" name="name" class="dfinput fl" id="name" th:value="${trainUser.name}"/>
			</li>
			<li class="clearfix" >
				<label>校区：<b>*</b></label>
				<select class="scinput select_width"  name="libId"  style="width: 345px;"  >
					<option th:each="item:${libJoins}" th:value="${item.id}"  th:selected="${trainUser.libId eq item.id ? true : false}">[[${item.leagueName}]]</option>
				</select>
			</li>
			<li>
				<label>&nbsp;</label>
				<button type="button" class="btn" onclick="saveFrom()">保存</button>
				<button type="button" class="btn" onclick="closeWin();">取消</button>
			</li>
		</ul>
	</form>
</div>
</body>

<script type="text/javascript">
$(function () {

})

function closeWin() {
	parent.location.reload();
	parent.layer.close(parent.layer.getFrameIndex(window.name));
}

function saveFrom(){
	var url="[[${sysUrl}]]/sys/train/user/save";
	var params = $("#submitFrom").serialize();
	$.post(url,params,function(data){
		if(data.meta.success){
			parent.layer.msg("保存成功",{icon:1});
			parent.location.reload();
			parent.layer.close(parent.layer.getFrameIndex(window.name));
		}else{
			parent.layer.msg(data.meta.message,{icon:11});
		}
	});
}


</script>


</html>