shenhao 5 years ago
parent
commit
3e76770927
1 changed files with 87 additions and 23 deletions
  1. 87 23
      src/main/resources/templates/sys/role/adminlist.html

+ 87 - 23
src/main/resources/templates/sys/role/adminlist.html

@@ -8,8 +8,15 @@
 	.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/bookList/adminlist.html}" method="post">
+	<form id="seachform" th:action="@{/sys/role/adminlist.html}" method="post">
 		<ul class="seachform">
 			<li>
 				<label>登录名/用户呢称</label>
@@ -21,7 +28,7 @@
 			</li>
 			<li>
 				<ul class="toolbar">
-					<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>选择</li>
+					<a th:href="@{/sys/role/adminAdd.html}"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>添加</li></a>
 				</ul>
 			</li>
 		</ul>
@@ -34,15 +41,25 @@
 			<th>用户呢称</th>
 			<th>状态</th>
 			<th>创建时间</th>
+			<th>操作</th>
 		</tr>
 		</thead>
 		<tbody>
 		<tr th:each="item:${list}" >
-			<td><input name="selectlist" type="radio" th:data-id="${item.get('id')}" /></td>
-			<td th:text="${item.login_name}" class="loginName"></td>
+			<td th:text="${itemStat.count}" ></td>
+			<td th:text="${item.login_name}"></td>
 			<td th:text="${item.nick_name}" ></td>
 			<td th:text="${item.status == 1 } ? '有效' : '停用' " ></td>
 			<td th:text="${#calendars.format(item.create_time,'yyyy-MM-dd HH:mm:ss')}" ></td>
+			<td>
+				<a href="javascript:;" th:onclick="'deleteById(\''+${item.id}+'\')'"  class="tablelink" >删除</a>
+				<a th:href="@{/sys/role/adminAdd.html(id=${item.id})}"  class="tablelink" >修改</a>
+				<a href="javascript:;" onclick="pushMenu();"  th:if="${item.login_name}=='admin'" class="tablelink"  >生成微信菜单</a>
+				<a href="javascript:;" onclick="getWebInfo(1);"  th:if="${item.login_name}=='admin'" class="tablelink"  >爬取标签信息</a>
+				<a href="javascript:;" onclick="getWebInfo(2);"  th:if="${item.login_name}=='admin'" class="tablelink"  >爬取标签信息2</a>
+				<a href="javascript:;"  th:if="${ #httpSession.getAttribute('admin') !=null  && #httpSession.getAttribute('admin').loginName eq 'admin'  }"  th:onclick="'adminRoleList(\''+${item.id}+'\')'" style="margin-right: 5px; width: 346px" class="tablelink" >分配权限</a>
+				<a href="javascript:;" th:onclick="'competenceAdmin(\''+${item.id}+'\')'" style="margin-right: 5px; width: 346px" class="tablelink" >关联组织架构</a>
+			</td>
 		</tr>
 		</tbody>
 	</table>
@@ -54,31 +71,78 @@
 </div>
 <script type="text/javascript">
 
-	$(function(){
-		$('ul.toolbar li.click').click(function () {
-			$.each($('[name=selectlist]'), function () {
-				if ($(this).prop('checked')) {
-					var loginName= $(this).parent().siblings(".loginName").html();
-					window.parent.document.getElementById("adminName").value=loginName;
-					window.parent.document.getElementById("adminId").value=loginName;
-					//children.window.close();
-					//window.close();
-					parent.location.reload();
-					parent.layer.close(parent.layer.getFrameIndex(window.name));
-				}
-			});
+	function competenceAdmin(id){
+		layer.open({
+			type: 2,
+			title: '关联组织架构',
+			shadeClose: false,
+			shade: 0.8,
+			offset: '60px',
+			area: ['670px', '520px'],
+			content: '[[${sysUrl}]]/sys/role/competenceAdmin.html?id='+id
+		});
+	}
+	function adminRoleList(id){
+		var url="./adminRoleList.html?id="+id;
+		window.open(url, 'newwindow', 'height=530, width=900, top=200, left=250, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
+	}
+	function deleteById(id){
+		layer.confirm("确定停用该用户?",
+				{icon: 4, btn: ['确定','取消']
+				}, function(){
+					$.ajax({
+						url: '[[${sysUrl}]]/sys/role/deleteAdmin',
+						type: "post",
+						data:{
+							'id': id
+						},
+						dataType: "json",
+						success:function(data){
 
+							if(data.meta.success){
+								layer.msg("删除成功",{icon:1});
+								setTimeout(function(){
+									window.location.href ='[[${sysUrl}]]/sys/role/adminlist.html';
+								},1000);
+							}else{
+								layer.msg(data.meta.message,{icon:11});
+							}
+						}
+					});
+				});
+	}
+
+
+	function pushMenu(){
+		parent.layer.open({
+			type: 2,
+			title: "修改微信菜单",
+			shadeClose: false,
+			shade: 0.8,
+			scrollbar: true,
+			area: ['43%', '60%'],
+			content: '[[${sysUrl}]]/sys/role/weixinMenu.html'
 		});
+	}
 
+	function getWebInfo(type){
+		$.ajax({
+			url: '[[${sysUrl}]]/sys/test/getWebInfo',
+			type: "post",
+			data:{
+				type:type
+			},
+			dataType: "json",
+			success:function(data){
 
-		$.each($('[name=selectlist]'), function () {
-			var loginName= $(this).parent().siblings(".loginName").html();
-			var loginName2=window.parent.document.getElementById("adminName").value;
-			if(loginName==loginName2){
-				$(this).prop('checked', true);
+				if(data.meta.success){
+					layer.msg("同步成功",{icon:1});
+				}else{
+					layer.msg(data.meta.message,{icon:11});
+				}
 			}
 		});
-	})
+	}
 </script>
 </body>
 </html>