list.jsp
6.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath %>resource/css/base.css" rel="stylesheet">
<link rel="stylesheet" href="<%=basePath %>resource/easyui/uimaker/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath %>resource/easyui/uimaker/icon.css">
<link rel="stylesheet" href="<%=basePath %>resource/css/providers.css">
<link rel="stylesheet" href="<%=basePath %>resource/css/form.css">
</head>
<body>
<table id="dg" style="width:100%;" title="<spring:message code="user.list"/>" data-options="
rownumbers:true,
singleSelect:false,
autoRowHeight:false,
pagination:true,
fitColumns:true,
striped:true,
collapsible:true,
toolbar:'#tb',
pageSize:10">
<thead>
<tr>
<th field="id" checkbox="true"></th>
<th field="." formatter="editFormat" width="50"><spring:message code="opt.edit" /></th>
<th field="loginaccount" sortable="true" width="110"><spring:message code="user.loginaccount" /></th>
<th field="realName" width="226"><spring:message code="user.fullname" /></th>
<th field="mobile" width="112"><spring:message code="user.mobile" /></th>
<th field="email" width="170"><spring:message code="user.email" /></th>
<th field="rolename" width="130"><spring:message code="user.role" /></th>
</tr>
</thead>
</table>
<div id="tb" style="padding:0 30px;">
<form id="searchForm">
<table class="search_form_table">
<tr>
<td class="klabel"><spring:message code="user.loginaccount" /></td>
<td class="kcontent"><input type="text" name="search_LIKE_loginaccount"></td>
<td class="klabel"><spring:message code="user.mobile" /></td>
<td class="kcontent"><input type="text" name="search_LIKE_mobile"></td>
<td class="kbutton">
<a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a>
<%-- <a href="javascript:editRow()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add"><spring:message code="opt.add" /></a>
<a href="javascript:doDelete()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red" iconCls="icon-no"><spring:message code="opt.delete" /></a> --%>
</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/easyui/easyui-lang-${pageContext.response.locale}.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/js/tools.js"></script>
<!--弹出层引入的JS-->
<script type="text/javascript" src="<%=basePath %>resource/layer-v3.0.3/layer/layer.js"></script>
<script type="text/javascript">
document.onkeydown = function(){
if(event.keyCode == 13){
event.keyCode =9;
}
}
$('#dg').datagrid({
url:'<%=basePath %>system/user/grid.json',
queryParams:$("#searchForm").serializeJson()
});
function editFormat(val,row,index){
var html='<a href="javascript:void(0)" style="text-decoration:none;" onclick="editRow('+row.id+')"><i class="iconfont"></i></a>'
html += '<a href="javascript:void(0)" style="text-decoration:none;" onclick="changepassword('+row.id+')">重置密码</a>'
return html;
}
function editRow(id){
//这个是跳转到九州的页面去修改密码
// window.open("http://www.zzcargo.com/index.php?r=member%2Fsite%2Freset-pwd");
// return;
//以下内容暂时不用
if(id==undefined){
window.location.href='<%=basePath %>system/user/edit?id=';
}else{
window.location.href='<%=basePath %>system/user/edit?id='+id;
}
}
function changepassword(id) {
window.location.href='<%=basePath %>system/user/changepassword?id='+id;
}
function doSearch(){
$('#dg').datagrid("options").queryParams=$("#searchForm").serializeJson();
$('#dg').datagrid("reload");
}
function getIds() {
var ids = [];
var rows = $("#dg").datagrid('getChecked');
$.each(rows,function(key,v){
ids.push(v.id);
});
return ids;
}
function doDelete(){
var rows = $("#dg").datagrid('getChecked');
if(rows.length==0){
layer.open({content:"<spring:message code="opt.selectone" />"});
return false;
}
layer.confirm("<spring:message code="opt.confirmdel" />?", {btn:['<spring:message code="opt.confirm" />','<spring:message code="opt.cancel" />']},function () {
$.post("<%=basePath %>system/user/delete",{ids:getIds().join(",")},function(data){
if(data.status == 200) {
layer.confirm("<spring:message code="opt.delsuccess" />!",{btn:['<spring:message code="opt.confirm" />','<spring:message code="opt.cancel" />']},function(){
window.location.href="<%=basePath %>system/user/list";
})
}else{
layer.open({content:"<spring:message code="opt.delfailed" />!"});
}
},"json");
});
}
</script>
</body>
</html>