onLineUserList.vm
6.87 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
##set($page_title="列表")
##set($crumbs="首页:/home,用户列表")
##详情
#set($url_out = "/user/forceOffLine.do")
##查询地址
#set($url_list = "/user/onLineUser.do")
<div class="row">
<div class="col-xs-12">
<div class="table-header">
线上用户列表
</div>
<div class="table-responsive">
<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
<div class="row">
<div class="col-sm-6" style="width:100%">
<div id="sample-table-2_length" class="dataTables_length">
<form action="$url_list" id="form" method="post">
<input type="hidden" name="currPage" value="0" />
<div class="row">
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-1 control-label text-right">ID: </label>
<div class="col-xs-3">
<input type="text" name="param[id]" value="$!{query.param.id}" class="form-control"/>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">用户名: </label>
<div class="col-xs-7">
<input type="text" name="param[userName]" value="$!{query.param.userName}" class="form-control"/>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-xs-3 control-label text-right">真实姓名: </label>
<div class="col-xs-7">
<input type="text" name="param[realName]" value="$!{query.param.realName}" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="clearfix">
<span class="pull-right">
<input type="submit" value="查询结果" />
<input type="button" value="重置条件" onclick="cleanForm('form');"/>
</span>
</div>
</div>
</form>
</div>
</div>
</div>
<table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
<thead>
<tr role="row">
<th>ID</th>
<th>用户名</th>
<th>真实姓名</th>
<th>登陆时间</th>
<th><i class="icon-time bigger-110 hidden-480"></i>操作</th>
</tr>
</thead>
<tbody id="sample-table-tbody" role="alert" aria-live="polite" aria-relevant="all">
</tbody>
</table>
## <div class="row">
## <div class="col-sm-6">
## <div class="dataTables_paginate paging_bootstrap">
## <div class="pull-right">
## #page($!{model.totalPage}, $!{model.currPage})
## </div>
## <span class="pull-right" style="line-height: 33px;">
## #set($tmpPage = $model.currPage + 1)
## 查询出$!{model.totalSize}条数据,共$!{model.totalPage}页,当前第$!{tmpPage}页
## </span>
## </div>
## </div>
## </div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(function($) {
$('table th input:checkbox').on('click' , function(){
var that = this;
$(this).closest('table').find('tr > td:first-child input:checkbox')
.each(function(){
this.checked = that.checked;
$(this).closest('tr').toggleClass('selected');
});
});
})
function cleanForm(id) {
var form = $("#" + id);
form.find("input[type=text]").each(function() {
var obj = $(this);
obj.val("");
});
form.find("select").each(function() {
var obj = $(this);
obj.val("20");
});
$("input[class='form-control form-time']").each(function() {
var obj = $(this);
obj.val("");
});
}
$(document).ready(function() {
var data = $!{data};
var query = $!{query};
var list = data;
if (query.param.userName != "" && query.param.userName != undefined) {
for(var i=0; i<data.length; i++) {
if(data[i].userName == query.param.userName) {
list = new Array();
list[0] = data[i];
break;
} else {
list=[];
}
}
}
if (query.param.realName != "" && query.param.realName != undefined) {
for(var i=0; i<data.length; i++) {
if(data[i].realName == query.param.realName) {
list = new Array();
list[0] = data[i];
break;
} else {
list=[];
}
}
}
var r = "";
for(var i=0; i<list.length; i++) {
r = r+"<tr><td>"+list[i].id+"</td><td>"+list[i].userName+"</td><td>"+list[i].realName+"</td><td>"+list[i].lastLoginTime+'</td><td><div class="action-buttons"><a class="red" href="${url_out}?id='+list[i].id+'" onclick="return confirm(\'确定强制下线?\');"><i class="fa fa-trash"></i>强制下线</a></div></td></tr>';
}
$("#sample-table-tbody").html(r);
});
</script>
<script src="$!{webUtils.getAssetsPath('/date/WdatePicker.js')}"></script>
<script src="$!{webUtils.getAssetsPath('/ace1.3/assets/js/diligrp.form.js')}"></script>