Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
98c23549
authored
May 08, 2019
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
用户列表支持根据角色筛选
parent
a0012b29
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
5 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
xxl-job-admin/src/main/resources/static/js/user.index.1.js
xxl-job-admin/src/main/resources/templates/user/user.index.ftl
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java
View file @
98c23549
...
...
@@ -50,11 +50,11 @@ public class UserController {
@PermessionLimit
(
adminuser
=
true
)
public
Map
<
String
,
Object
>
pageList
(
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
int
start
,
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
int
length
,
String
username
)
{
String
username
,
int
role
)
{
// page list
List
<
XxlJobUser
>
list
=
xxlJobUserDao
.
pageList
(
start
,
length
,
username
);
int
list_count
=
xxlJobUserDao
.
pageListCount
(
start
,
length
,
username
);
List
<
XxlJobUser
>
list
=
xxlJobUserDao
.
pageList
(
start
,
length
,
username
,
role
);
int
list_count
=
xxlJobUserDao
.
pageListCount
(
start
,
length
,
username
,
role
);
// package result
Map
<
String
,
Object
>
maps
=
new
HashMap
<
String
,
Object
>();
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
View file @
98c23549
...
...
@@ -13,10 +13,12 @@ public interface XxlJobUserDao {
public
List
<
XxlJobUser
>
pageList
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"username"
)
String
username
);
@Param
(
"username"
)
String
username
,
@Param
(
"role"
)
int
role
);
public
int
pageListCount
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"username"
)
String
username
);
@Param
(
"username"
)
String
username
,
@Param
(
"role"
)
int
role
);
public
XxlJobUser
loadByUserName
(
@Param
(
"username"
)
String
username
);
...
...
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
View file @
98c23549
...
...
@@ -26,6 +26,9 @@
<if
test=
"username != null and username != ''"
>
AND t.username like CONCAT(CONCAT('%', #{username}), '%')
</if>
<if
test=
"role gt -1"
>
AND t.role = #{role}
</if>
</trim>
ORDER BY username ASC
LIMIT #{offset}, #{pagesize}
...
...
@@ -38,6 +41,9 @@
<if
test=
"username != null and username != ''"
>
AND t.username like CONCAT(CONCAT('%', #{username}), '%')
</if>
<if
test=
"role gt -1"
>
AND t.role = #{role}
</if>
</trim>
</select>
...
...
xxl-job-admin/src/main/resources/static/js/user.index.1.js
View file @
98c23549
...
...
@@ -11,6 +11,7 @@ $(function() {
data
:
function
(
d
)
{
var
obj
=
{};
obj
.
username
=
$
(
'#username'
).
val
();
obj
.
role
=
$
(
'#role'
).
val
();
obj
.
start
=
d
.
start
;
obj
.
length
=
d
.
length
;
return
obj
;
...
...
xxl-job-admin/src/main/resources/templates/user/user.index.ftl
View file @
98c23549
...
...
@@ -27,6 +27,16 @@
<div
class=
"row"
>
<div
class=
"col-xs-3"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
${I18n.user_role}
</span>
<select
class=
"form-control"
id=
"role"
>
<option
value=
"-1"
>
${I18n.system_all}
</option>
<option
value=
"0"
>
${I18n.user_role_admin}
</option>
<option
value=
"1"
>
${I18n.user_role_normal}
</option>
</select>
</div>
</div>
<div
class=
"col-xs-3"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
${I18n.user_username}
</span>
<input
type=
"text"
class=
"form-control"
id=
"username"
autocomplete=
"on"
>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment