Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
ee708ff4
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1433
Star
162
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ee708ff4
编写于
9月 18, 2018
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户绑定角色完成
上级
7da5dead
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
241 addition
and
6 deletion
+241
-6
skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java
...src/main/java/com/skyeye/authority/dao/SysEveUserDao.java
+9
-3
skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java
.../java/com/skyeye/authority/service/SysEveUserService.java
+4
-0
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java
.../skyeye/authority/service/impl/SysEveUserServiceImpl.java
+42
-0
skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java
...com/skyeye/authority/controller/SysEveUserController.java
+32
-0
skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml
skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml
+26
-0
skyeye-web/src/main/resources/mapping/reqmapping.xml
skyeye-web/src/main/resources/mapping/reqmapping.xml
+7
-0
skyeye-web/src/main/webapp/assets/images/noMation.png
skyeye-web/src/main/webapp/assets/images/noMation.png
+0
-0
skyeye-web/src/main/webapp/assets/lib/layui/css/layui.css
skyeye-web/src/main/webapp/assets/lib/layui/css/layui.css
+2
-1
skyeye-web/src/main/webapp/assets/lib/layui/layui.js
skyeye-web/src/main/webapp/assets/lib/layui/layui.js
+3
-0
skyeye-web/src/main/webapp/js/syseveuser/syseveuserlist.js
skyeye-web/src/main/webapp/js/syseveuser/syseveuserlist.js
+20
-1
skyeye-web/src/main/webapp/js/syseveuser/syseveuserrolebind.js
...e-web/src/main/webapp/js/syseveuser/syseveuserrolebind.js
+52
-0
skyeye-web/src/main/webapp/tpl/syseveuser/rolelist.tpl
skyeye-web/src/main/webapp/tpl/syseveuser/rolelist.tpl
+21
-0
skyeye-web/src/main/webapp/tpl/syseveuser/syseveuserlist.html
...ye-web/src/main/webapp/tpl/syseveuser/syseveuserlist.html
+1
-1
skyeye-web/src/main/webapp/tpl/syseveuser/syseveuserrolebind.html
...eb/src/main/webapp/tpl/syseveuser/syseveuserrolebind.html
+22
-0
未找到文件。
skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveUserDao.java
浏览文件 @
ee708ff4
...
...
@@ -11,15 +11,21 @@ public interface SysEveUserDao {
public
Map
<
String
,
Object
>
querySysUserLockStateById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
void
editSysUserLockStateToLockById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
editSysUserLockStateToLockById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
void
editSysUserLockStateToUnLockById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
editSysUserLockStateToUnLockById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
querySysUserMationToEditById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
void
editSysUserMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
editSysUserMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryMationByUserCode
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
List
<
Map
<
String
,
Object
>>
queryRoleList
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryBindRoleMationByUserId
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
editRoleIdsByUserId
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
...
...
skyeye-service/src/main/java/com/skyeye/authority/service/SysEveUserService.java
浏览文件 @
ee708ff4
...
...
@@ -20,6 +20,10 @@ public interface SysEveUserService {
public
void
queryUserMationBySession
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
deleteUserMationBySession
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
queryRoleAndBindRoleByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
editRoleIdsByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
...
...
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveUserServiceImpl.java
浏览文件 @
ee708ff4
package
com.skyeye.authority.service.impl
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -188,6 +189,47 @@ public class SysEveUserServiceImpl implements SysEveUserService{
public
void
deleteUserMationBySession
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
inputObject
.
removeSession
();
}
/**
*
* @Title: queryRoleAndBindRoleByUserId
* @Description: 获取角色和当前已经绑定的角色信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
queryRoleAndBindRoleByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
List
<
Map
<
String
,
Object
>>
roles
=
sysEveUserDao
.
queryRoleList
(
map
);
//获取角色列表
Map
<
String
,
Object
>
userRole
=
sysEveUserDao
.
queryBindRoleMationByUserId
(
map
);
//获取用户绑定的角色ID串
String
[]
roleIds
=
userRole
.
get
(
"roleIds"
).
toString
().
split
(
","
);
for
(
Map
<
String
,
Object
>
bean
:
roles
){
if
(
Arrays
.
asList
(
roleIds
).
contains
(
bean
.
get
(
"id"
).
toString
())){
bean
.
put
(
"isCheck"
,
"checked"
);
}
}
outputObject
.
setBeans
(
roles
);
outputObject
.
settotal
(
roles
.
size
());
}
/**
*
* @Title: editRoleIdsByUserId
* @Description: 编辑用户绑定的角色
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
editRoleIdsByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
sysEveUserDao
.
editRoleIdsByUserId
(
map
);
}
...
...
skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveUserController.java
浏览文件 @
ee708ff4
...
...
@@ -143,4 +143,36 @@ public class SysEveUserController {
sysEveUserService
.
deleteUserMationBySession
(
inputObject
,
outputObject
);
}
/**
*
* @Title: queryRoleAndBindRoleByUserId
* @Description: 获取角色和当前已经绑定的角色信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/SysEveUserController/queryRoleAndBindRoleByUserId"
)
@ResponseBody
public
void
queryRoleAndBindRoleByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
sysEveUserService
.
queryRoleAndBindRoleByUserId
(
inputObject
,
outputObject
);
}
/**
*
* @Title: editRoleIdsByUserId
* @Description: 编辑用户绑定的角色
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/SysEveUserController/editRoleIdsByUserId"
)
@ResponseBody
public
void
editRoleIdsByUserId
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
sysEveUserService
.
editRoleIdsByUserId
(
inputObject
,
outputObject
);
}
}
skyeye-web/src/main/resources/dbmapper/SysEveUserMapper.xml
浏览文件 @
ee708ff4
...
...
@@ -92,4 +92,30 @@
a.user_code = #{userCode}
</select>
<select
id=
"queryRoleList"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.role_name roleName,
a.role_desc roleDesc
FROM
sys_eve_role a
</select>
<select
id=
"queryBindRoleMationByUserId"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
IFNULL(a.role_id, "") roleIds
FROM
sys_eve_user a
WHERE
a.id = #{id}
</select>
<update
id=
"editRoleIdsByUserId"
parameterType=
"java.util.Map"
>
UPDATE sys_eve_user
<set>
role_id = #{roleIds}
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
skyeye-web/src/main/resources/mapping/reqmapping.xml
浏览文件 @
ee708ff4
...
...
@@ -94,5 +94,12 @@
<url
id=
"sys018"
path=
"/post/SysEveRoleController/deleteSysRoleMationById"
val=
"删除角色"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"角色ID"
/>
</url>
<url
id=
"sys019"
path=
"/post/SysEveUserController/queryRoleAndBindRoleByUserId"
val=
"获取角色和当前已经绑定的角色信息"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"账号ID"
/>
</url>
<url
id=
"sys020"
path=
"/post/SysEveUserController/editRoleIdsByUserId"
val=
"编辑用户绑定的角色"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"账号ID"
/>
<property
id=
"roleIds"
name=
"roleIds"
ref=
"required"
var=
"角色ID串"
/>
</url>
</controller>
\ No newline at end of file
skyeye-web/src/main/webapp/assets/images/noMation.png
0 → 100644
浏览文件 @
ee708ff4
11.0 KB
skyeye-web/src/main/webapp/assets/lib/layui/css/layui.css
浏览文件 @
ee708ff4
...
...
@@ -764,7 +764,8 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
.layui-form-checked
[
lay-skin
=
"primary"
]
i
{
border-color
:
#5FB878
;
background-color
:
#5FB878
;
color
:
#fff
;}
.layui-checkbox-disbaled
[
lay-skin
=
"primary"
]
span
{
background
:
none
!important
;
color
:
#c2c2c2
;}
.layui-checkbox-disbaled
[
lay-skin
=
"primary"
]
:hover
i
{
border-color
:
#d2d2d2
;}
.layui-form-item
.layui-form-checkbox
[
lay-skin
=
"primary"
]
{
margin-top
:
10px
;}
.layui-form-item
.layui-form-checkbox
[
lay-skin
=
"primary"
]
{
margin-top
:
10px
;
margin-right
:
10px
;
float
:
left
;}
.cbxmenu-font
{
margin-top
:
10px
;
float
:
left
;}
/* 复选框-开关风格 */
.layui-form-switch
{
position
:
relative
;
display
:
inline-block
;
vertical-align
:
middle
;
height
:
22px
;
line-height
:
22px
;
width
:
42px
;
padding
:
0
5px
;
margin-top
:
8px
;
border
:
1px
solid
#d2d2d2
;
border-radius
:
20px
;
cursor
:
pointer
;
background-color
:
#fff
;
-webkit-transition
:
.1s
linear
;
transition
:
.1s
linear
;}
.layui-form-switch
i
{
position
:
absolute
;
left
:
5px
;
top
:
3px
;
width
:
16px
;
height
:
16px
;
border-radius
:
20px
;
background-color
:
#d2d2d2
;
-webkit-transition
:
.1s
linear
;
transition
:
.1s
linear
;}
...
...
skyeye-web/src/main/webapp/assets/lib/layui/layui.js
浏览文件 @
ee708ff4
...
...
@@ -12,6 +12,9 @@ var skyeyeVersion = "1.0.0-beta";
var
filePicType
=
[
'
png
'
,
'
jpg
'
,
'
gif
'
,
'
jpeg
'
,
'
PNG
'
,
'
JPG
'
,
'
GIF
'
,
'
JPEG
'
];
var
fileDocType
=
[
'
txt
'
,
'
docx
'
,
'
doc
'
,
'
xlsx
'
,
'
xls
'
,
'
pdf
'
,
'
ppt
'
,
'
TXT
'
,
'
DOCX
'
,
'
DOC
'
,
'
XLSX
'
,
'
XLS
'
,
'
PDF
'
,
'
PPT
'
];
//showmodel.js没有数据时的默认展示
var
noBeansMation
=
"
<div class='noMation col-lg-12 col-sm-12 col-xs-12'><img src='../../assets/images/noMation.png' style='max-width:100px'/><br/><font class='noMationFont'>暂无数据</font></div>
"
;
//动态引入获取IP的路径
document
.
write
(
"
<script type=
\"
text/javascript
\"
src=
\"
http://pv.sohu.com/cityjson?ie=utf-8
\"
></script>
"
);
...
...
skyeye-web/src/main/webapp/js/syseveuser/syseveuserlist.js
浏览文件 @
ee708ff4
...
...
@@ -57,7 +57,7 @@ layui.config({
{
field
:
'
roleName
'
,
title
:
'
角色
'
},
{
field
:
'
createName
'
,
title
:
'
创建人
'
,
width
:
120
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
180
},
{
title
:
'
操作
'
,
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
12
0
,
toolbar
:
'
#tableBar
'
}
{
title
:
'
操作
'
,
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
24
0
,
toolbar
:
'
#tableBar
'
}
]]
});
...
...
@@ -70,6 +70,8 @@ layui.config({
unlock
(
data
);
}
else
if
(
layEvent
===
'
edit
'
)
{
//编辑
edit
(
data
);
}
else
if
(
layEvent
===
'
bindRole
'
)
{
//绑定角色
bindRole
(
data
);
}
});
...
...
@@ -124,6 +126,23 @@ layui.config({
}});
}
//绑定角色
function
bindRole
(
data
){
rowId
=
data
.
id
;
_openNewWindows
({
url
:
"
../../tpl/syseveuser/syseveuserrolebind.html
"
,
title
:
"
绑定角色
"
,
pageId
:
"
syseveuserrolebind
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
top
.
winui
.
window
.
msg
(
"
操作成功
"
,
{
icon
:
1
,
time
:
2000
});
loadTable
();
}
else
if
(
refreshCode
==
'
-9999
'
)
{
top
.
winui
.
window
.
msg
(
"
操作失败
"
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
$
(
"
body
"
).
on
(
"
click
"
,
"
#reloadTable
"
,
function
(){
loadTable
();
});
...
...
skyeye-web/src/main/webapp/js/syseveuser/syseveuserrolebind.js
0 → 100644
浏览文件 @
ee708ff4
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
}).
define
([
'
table
'
,
'
jquery
'
,
'
winui
'
],
function
(
exports
)
{
winui
.
renderColor
();
layui
.
use
([
'
form
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
var
$
=
layui
.
$
;
showGrid
({
id
:
"
showForm
"
,
url
:
reqBasePath
+
"
sys019
"
,
params
:
{
rowId
:
parent
.
rowId
},
pagination
:
false
,
template
:
getFileContent
(
'
tpl/syseveuser/rolelist.tpl
'
),
ajaxSendLoadBefore
:
function
(
hdb
){},
ajaxSendAfter
:
function
(
json
){
form
.
render
();
form
.
on
(
'
submit(formEditBindRole)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
str
=
""
;
$
.
each
(
$
(
'
input[type=checkbox]:checked
'
),
function
(){
str
+=
$
(
this
).
val
()
+
"
,
"
;
});
if
(
isNull
(
str
)){
top
.
winui
.
window
.
msg
(
"
请选择角色
"
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
var
params
=
{
rowId
:
parent
.
rowId
,
roleIds
:
str
,
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
sys020
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
return
false
;
});
}
});
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
(){
parent
.
layer
.
close
(
index
);
});
});
});
\ No newline at end of file
skyeye-web/src/main/webapp/tpl/syseveuser/rolelist.tpl
0 → 100644
浏览文件 @
ee708ff4
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色
</label>
<div
class=
"layui-input-block"
>
<dl
class=
"menulist layui-form"
>
{
{
#
each
rows
}
}
<dt
style=
"width:100%"
>
<input
type=
"checkbox"
class=
"cbxmenu"
value=
"{
{
id
}
}"
lay-skin=
"primary"
lay-filter=
"cbxmenu"
{
{
isCheck
}
}
/>
<font
class=
"cbxmenu-font"
>
{
{
roleName
}
}
</font>
<h5
class=
"cbxmenu-font"
>
({
{
roleDesc
}
})
</h5>
<span
class=
"functions"
></span>
</dt>
{
{/
each
}
}
</dl>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formEditBindRole"
>
保存
</button>
<button
class=
"winui-btn"
id=
"cancle"
>
取消
</button>
</div>
</div>
\ No newline at end of file
skyeye-web/src/main/webapp/tpl/syseveuser/syseveuserlist.html
浏览文件 @
ee708ff4
...
...
@@ -33,13 +33,13 @@
<div
class=
"winui-tool"
>
<button
id=
"reloadTable"
class=
"winui-toolbtn"
><i
class=
"fa fa-refresh"
aria-hidden=
"true"
></i>
刷新数据
</button>
<button
id=
"addBean"
class=
"winui-toolbtn"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
新增用户
</button>
<button
id=
"deleteBeans"
class=
"winui-toolbtn"
><i
class=
"fa fa-trash"
aria-hidden=
"true"
></i>
删除选中
</button>
</div>
</div>
<div
style=
"margin:auto 10px;"
>
<table
id=
"messageTable"
lay-filter=
"messageTable"
></table>
<script
type=
"text/html"
id=
"tableBar"
>
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
edit
"
>
编辑
<
/a
>
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
bindRole
"
>
绑定角色
<
/a
>
{{
#
if
(
d
.
userLock
==
0
){
}}
<
a
class
=
"
layui-btn layui-btn-danger layui-btn-xs
"
lay
-
event
=
"
lock
"
>
锁定
<
/a
>
{{
#
}
else
if
(
d
.
userLock
==
1
){
}}
...
...
skyeye-web/src/main/webapp/tpl/syseveuser/syseveuserrolebind.html
0 → 100644
浏览文件 @
ee708ff4
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/font-awesome-4.7.0/css/font-awesome.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
style=
"width:600px;margin:0 auto;padding-top:20px;"
>
<form
class=
"layui-form"
action=
""
id=
"showForm"
>
</form>
</div>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/syseveuser/
'
}).
use
(
'
syseveuserrolebind
'
);
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录