<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>私塾家</title>
	<!--<link th:href="@{/static/kmt/css/bootstrap.min.css}" rel="stylesheet">-->
	<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
		  integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<!--<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
			integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
			crossorigin="anonymous"></script>-->
	<link rel="stylesheet" type="text/css" th:href="@{/static/kmt/css/common.css}"/>
	<link rel="stylesheet" type="text/css" th:href="@{/static/kmt/css/header.css}"/>
	<script th:include="sys/common/metaCSS" th:remove="tag"></script>
	<script th:include="sys/common/metaJS" th:remove="tag"></script>
</head>
<style type="text/css">
	body{min-width:180px;}
	.btn{
		width: 100px;
	}
</style>
<body>
<div>
	<table class="table">
		<!--<caption>用户角色</caption>-->
		<!--<thead>
		<tr>
			<th>角色</th>
			<th></th>
		</tr>
		</thead>-->
		<tbody>
		<tr th:each="item:${list}">
			<td th:text="${item.userrole}"></td>
			<td></td>
			<td th:switch="${item.userrole}" >
				<!--<span th:case="学生"><a th:href="@{/sys/usercenter/studentDetail.html(id=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="家长"><a th:href="@{/sys/usercenter/parentDetail.html(parentUserId=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="在馆老师"><a th:href="@{/sys/usercenter/teacherDetail.html(id=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="一对一老师"><a th:href="@{/sys/usercenter/teacherDetail.html(id=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="在线老师"><a th:href="@{/sys/usercenter/teacherDetail.html(id=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="校长"><a th:href="@{/sys/usercenter/schoolmasterDetail.html(schoolmasterUserId=${item.id})}" class="tablelink" >详情</a></span>
				<span th:case="馆长"><a th:href="@{/sys/usercenter/curatorList.html}" class="tablelink" >详情</a></span>-->
				<span th:case="质检员"><a href="javascript:;" th:onclick="'untieRole(\''+${item.id}+'\')'" class="tablelink">解除身份</a></span>
			</td>
		</tr>
		</tbody>
	</table>
</div>

</body>
 <script type="text/javascript">
	 //设置iframe页面随父页面跳转
     $(document ).ready(function(){
         $("a" ).attr("target" , "_parent" );
     });

	 function untieRole(userId) {
		 parent.layer.confirm("您确定解除该身份?", {
			 icon: 4, btn: ['确定', '关闭'] //按钮
		 }, function () {
			 var url = "[[${sysUrl}]]/sys/usercenter/untieRole";
			 var params = {
				 'userId': userId
			 };
			 $.post(url, params, function (data) {
				 if (data.code == '999') {
					 parent.layer.msg("解除成功", {icon: 1});
					 closeWin();
				 } else {
					 parent.layer.msg(data.meta.message, {icon: 11});
				 }
			 });
		 });
	 }
 </script>
</HTML>