Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
2c334d6c
Commit
2c334d6c
authored
Feb 23, 2018
by
李家智
Browse files
role test
parent
af7608e0
Changes
9
Hide whitespace changes
Inline
Side-by-side
admin-console/src/main/java/com/ibeetl/admin/console/web/query/RoleQuery.java
View file @
2c334d6c
...
@@ -14,7 +14,7 @@ public class RoleQuery extends PageParam {
...
@@ -14,7 +14,7 @@ public class RoleQuery extends PageParam {
@Query
(
name
=
"名称"
,
display
=
true
)
@Query
(
name
=
"名称"
,
display
=
true
)
private
String
name
;
private
String
name
;
@Query
(
name
=
"业务角色类型"
,
type
=
Query
.
TYPE_DICT
,
dict
=
CoreDictType
.
ROLE_TYPE
)
@Query
(
name
=
"业务角色类型"
,
type
=
Query
.
TYPE_DICT
,
dict
=
CoreDictType
.
ROLE_TYPE
)
private
Integer
type
;
private
String
type
;
public
String
getCode
()
{
public
String
getCode
()
{
...
@@ -33,13 +33,15 @@ public class RoleQuery extends PageParam {
...
@@ -33,13 +33,15 @@ public class RoleQuery extends PageParam {
this
.
name
=
name
;
this
.
name
=
name
;
}
}
public
Integer
getType
()
{
public
String
getType
()
{
return
type
;
return
type
;
}
}
public
void
setType
(
Integer
type
)
{
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
this
.
type
=
type
;
}
}
}
}
admin-console/src/main/resources/static/js/admin/role/add.js
View file @
2c334d6c
...
@@ -8,7 +8,7 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
...
@@ -8,7 +8,7 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
this
.
initSubmit
();
this
.
initSubmit
();
},
},
initSubmit
:
function
(){
initSubmit
:
function
(){
$
(
"
#addButton
"
).
click
(
function
(){
$
(
"
#addButton
"
).
click
(
$
(
"
#addForm
"
),
function
(){
roleApi
.
addRole
(
function
(){
roleApi
.
addRole
(
function
(){
parent
.
window
.
dataReload
();
parent
.
window
.
dataReload
();
Common
.
info
(
"
添加成功
"
);
Common
.
info
(
"
添加成功
"
);
...
...
admin-console/src/main/resources/static/js/admin/role/edit.js
View file @
2c334d6c
...
@@ -8,8 +8,8 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
...
@@ -8,8 +8,8 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
this
.
initSubmit
();
this
.
initSubmit
();
},
},
initSubmit
:
function
(){
initSubmit
:
function
(){
$
(
"
#
add
Button
"
).
click
(
function
(){
$
(
"
#
update
Button
"
).
click
(
function
(){
roleApi
.
updateRole
(
function
(){
roleApi
.
updateRole
(
$
(
"
#updateForm
"
),
function
(){
parent
.
window
.
dataReload
();
parent
.
window
.
dataReload
();
Common
.
info
(
"
更新成功
"
);
Common
.
info
(
"
更新成功
"
);
Lib
.
closeFrame
();
Lib
.
closeFrame
();
...
@@ -18,7 +18,7 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
...
@@ -18,7 +18,7 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
});
});
$
(
"
#
add
Button-cancel
"
).
click
(
function
(){
$
(
"
#
update
Button-cancel
"
).
click
(
function
(){
Lib
.
closeFrame
();
Lib
.
closeFrame
();
});
});
}
}
...
...
admin-console/src/main/resources/static/js/admin/role/index.js
View file @
2c334d6c
...
@@ -21,7 +21,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
...
@@ -21,7 +21,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
height
:
'
full-280
'
,
height
:
'
full-280
'
,
method
:
'
post
'
,
method
:
'
post
'
,
url
:
Common
.
CTX
+
'
/admin/role/list.json
'
//数据接口
url
:
Common
.
CTX
+
'
/admin/role/list.json
'
//数据接口
,
page
:
{
"
layout
"
:[
'
count
'
,
'
prev
'
,
'
page
'
,
'
next
'
]}
//开启分页
,
page
:
Lib
.
tablePage
//开启分页
,
limit
:
10
,
,
limit
:
10
,
cols
:
[
[
//表头
cols
:
[
[
//表头
{
{
...
...
admin-console/src/main/resources/static/js/admin/role/roleApi.js
View file @
2c334d6c
/*访问后台的代码*/
/*访问后台的代码*/
layui
.
define
([],
function
(
exports
)
{
layui
.
define
([],
function
(
exports
)
{
var
api
=
{
var
api
=
{
updateRole
:
function
(
callback
){
updateRole
:
function
(
form
,
callback
){
Lib
.
submitForm
(
$
(
'
#updateF
orm
'
)
,{},
callback
)
Lib
.
submitForm
(
"
/admin/role/update.json
"
,
f
orm
,{},
callback
)
},
},
addRole
:
function
(
callback
){
addRole
:
function
(
form
,
callback
){
Lib
.
submitForm
(
$
(
'
#addF
orm
'
)
,{},
callback
)
Lib
.
submitForm
(
"
/admin/role/add.json
"
,
f
orm
,{},
callback
)
},
},
del
:
function
(
ids
,
callback
){
del
:
function
(
ids
,
callback
){
Common
.
post
(
"
/admin/role/delete.json
"
,{
"
ids
"
:
ids
},
function
(){
Common
.
post
(
"
/admin/role/delete.json
"
,{
"
ids
"
:
ids
},
function
(){
...
...
admin-console/src/main/resources/static/js/admin/role/roleFn.js
View file @
2c334d6c
...
@@ -56,7 +56,6 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
...
@@ -56,7 +56,6 @@ layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
roleApi
.
queryFunctionByRole
(
roleId
,
function
(
fnIds
){
roleApi
.
queryFunctionByRole
(
roleId
,
function
(
fnIds
){
for
(
var
i
=
0
;
i
<
fnIds
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
fnIds
.
length
;
i
++
){
var
node
=
zTreeObj
.
getNodesByParam
(
"
id
"
,
fnIds
[
i
]);
var
node
=
zTreeObj
.
getNodesByParam
(
"
id
"
,
fnIds
[
i
]);
// zTreeObj.selectNode(node[0]);
zTreeObj
.
checkNode
(
node
[
0
],
true
,
true
);
zTreeObj
.
checkNode
(
node
[
0
],
true
,
true
);
}
}
});
});
...
...
admin-console/src/main/resources/static/js/admin/role/roleUser.js
View file @
2c334d6c
...
@@ -7,21 +7,22 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
...
@@ -7,21 +7,22 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
init
:
function
(
roleId
){
init
:
function
(
roleId
){
this
.
initTable
(
roleId
);
this
.
initTable
(
roleId
);
this
.
initSearchForm
();
this
.
initClose
();
this
.
initClose
();
},
},
initClose
:
function
(){
initClose
:
function
(){
$
(
"
#close
"
).
click
(
function
(){
$
(
"
#close
"
).
click
(
function
(){
Lib
.
closeFrame
();
Lib
.
closeFrame
();
});
});
},
},
initTable
:
function
(
roleId
){
initTable
:
function
(
roleId
){
userTable
=
table
.
render
({
userTable
=
table
.
render
({
elem
:
'
#userTable
'
,
elem
:
'
#userTable
'
,
height
:
'
full-180
'
,
height
:
'
full-180
'
,
method
:
'
post
'
,
method
:
'
post
'
,
url
:
Common
.
CTX
+
'
/admin/role/user/list.json?roleId=
'
+
roleId
//数据接口
url
:
Common
.
CTX
+
'
/admin/role/user/list.json?roleId=
'
+
roleId
//数据接口
,
page
:
{
"
layout
"
:[
'
count
'
,
'
prev
'
,
'
page
'
,
'
next
'
]}
//开启分页
,
page
:
Lib
.
tablePage
//开启分页
,
limit
:
10
,
,
limit
:
10
,
cols
:
[
[
//表头
cols
:
[
[
//表头
{
{
...
...
admin-console/src/main/resources/templates/admin/role/add.html
View file @
2c334d6c
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/role/"}){ -->
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/role/"}){ -->
<form
class=
"layui-form layui-form-pane"
id=
"addForm"
<form
class=
"layui-form layui-form-pane"
id=
"addForm"
>
action=
"/admin/role/add.json"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称
</label>
<label
class=
"layui-form-label"
>
角色名称
</label>
...
...
admin-console/src/main/resources/templates/admin/role/edit.html
View file @
2c334d6c
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/role/"}){ -->
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/role/"}){ -->
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
<form
class=
"layui-form layui-form-pane"
id=
"updateForm"
>
action=
"/admin/role/update.json"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称
</label>
<label
class=
"layui-form-label"
>
角色名称
</label>
...
...
Write
Preview
Supports
Markdown
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