Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
474ce1a3
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看板
提交
474ce1a3
编写于
8月 29, 2018
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
角色查询完成,角色添加界面完成50%
上级
95ecfe7d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
324 addition
and
17 deletion
+324
-17
skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveRoleDao.java
...src/main/java/com/skyeye/authority/dao/SysEveRoleDao.java
+12
-0
skyeye-service/src/main/java/com/skyeye/authority/service/SysEveRoleService.java
.../java/com/skyeye/authority/service/SysEveRoleService.java
+10
-0
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveRoleServiceImpl.java
.../skyeye/authority/service/impl/SysEveRoleServiceImpl.java
+43
-0
skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveRoleController.java
...com/skyeye/authority/controller/SysEveRoleController.java
+34
-0
skyeye-web/src/main/resources/dbmapper/SysEveRoleMapper.xml
skyeye-web/src/main/resources/dbmapper/SysEveRoleMapper.xml
+24
-0
skyeye-web/src/main/resources/mapping/reqmapping.xml
skyeye-web/src/main/resources/mapping/reqmapping.xml
+5
-0
skyeye-web/src/main/webapp/assets/json/desktopmenu.json
skyeye-web/src/main/webapp/assets/json/desktopmenu.json
+3
-3
skyeye-web/src/main/webapp/js/syseverole/syseveroleadd.js
skyeye-web/src/main/webapp/js/syseverole/syseveroleadd.js
+133
-0
skyeye-web/src/main/webapp/js/syseverole/syseverolelist.js
skyeye-web/src/main/webapp/js/syseverole/syseverolelist.js
+14
-14
skyeye-web/src/main/webapp/tpl/syseverole/syseveroleadd.html
skyeye-web/src/main/webapp/tpl/syseverole/syseveroleadd.html
+46
-0
未找到文件。
skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveRoleDao.java
0 → 100644
浏览文件 @
474ce1a3
package
com.skyeye.authority.dao
;
import
java.util.List
;
import
java.util.Map
;
import
com.github.miemiedev.mybatis.paginator.domain.PageBounds
;
public
interface
SysEveRoleDao
{
public
List
<
Map
<
String
,
Object
>>
querySysRoleList
(
Map
<
String
,
Object
>
map
,
PageBounds
pageBounds
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/authority/service/SysEveRoleService.java
0 → 100644
浏览文件 @
474ce1a3
package
com.skyeye.authority.service
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
public
interface
SysEveRoleService
{
public
void
querySysRoleList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveRoleServiceImpl.java
0 → 100644
浏览文件 @
474ce1a3
package
com.skyeye.authority.service.impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.miemiedev.mybatis.paginator.domain.PageBounds
;
import
com.github.miemiedev.mybatis.paginator.domain.PageList
;
import
com.skyeye.authority.dao.SysEveRoleDao
;
import
com.skyeye.authority.service.SysEveRoleService
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
@Service
public
class
SysEveRoleServiceImpl
implements
SysEveRoleService
{
@Autowired
private
SysEveRoleDao
sysEveRoleDao
;
/**
*
* @Title: querySysMenuList
* @Description: 获取角色列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
querySysRoleList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
List
<
Map
<
String
,
Object
>>
beans
=
sysEveRoleDao
.
querySysRoleList
(
map
,
new
PageBounds
(
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
())));
PageList
<
Map
<
String
,
Object
>>
beansPageList
=
(
PageList
<
Map
<
String
,
Object
>>)
beans
;
int
total
=
beansPageList
.
getPaginator
().
getTotalCount
();
outputObject
.
setBeans
(
beans
);
outputObject
.
settotal
(
total
);
}
}
skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveRoleController.java
0 → 100644
浏览文件 @
474ce1a3
package
com.skyeye.authority.controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.skyeye.authority.service.SysEveRoleService
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
@Controller
public
class
SysEveRoleController
{
@Autowired
private
SysEveRoleService
sysEveRoleService
;
/**
*
* @Title: querySysMenuList
* @Description: 获取角色列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/SysEveRoleController/querySysRoleList"
)
@ResponseBody
public
void
querySysRoleList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
sysEveRoleService
.
querySysRoleList
(
inputObject
,
outputObject
);
}
}
skyeye-web/src/main/resources/dbmapper/SysEveRoleMapper.xml
0 → 100644
浏览文件 @
474ce1a3
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.skyeye.authority.dao.SysEveRoleDao"
>
<select
id=
"querySysRoleList"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.role_name roleName,
a.role_desc roleDesc,
CONVERT(a.create_time, char) createTime,
IFNULL((SELECT b.role_name FROM sys_eve_role b WHERE a.role_parent_id = b.id), '主角色') parentName
FROM
sys_eve_role a
WHERE 1 = 1
<if
test=
"roleName != '' and roleName != null"
>
AND a.role_name LIKE '%${roleName}%'
</if>
<if
test=
"parentId != '' and parentId != null and parentId != '0'.toString()"
>
AND role_parent_id = #{parentId}
</if>
ORDER BY a.create_time DESC
</select>
</mapper>
\ No newline at end of file
skyeye-web/src/main/resources/mapping/reqmapping.xml
浏览文件 @
474ce1a3
...
...
@@ -61,5 +61,10 @@
<url
id=
"sys012"
path=
"/post/SysEveMenuController/queryTreeSysMenuMationBySimpleLevel"
val=
"异步加载树查看同级菜单"
>
<property
id=
"parentId"
name=
"parentId"
ref=
"required"
var=
"父菜单ID"
/>
</url>
<url
id=
"sys013"
path=
"/post/SysEveRoleController/querySysRoleList"
val=
"获取角色列表"
>
<property
id=
"limit"
name=
"limit"
ref=
"required"
var=
"分页参数,每页多少条数据"
/>
<property
id=
"page"
name=
"page"
ref=
"required"
var=
"分页参数,第几页"
/>
<property
id=
"roleName"
name=
"roleName"
ref=
""
var=
"角色名称"
/>
</url>
</controller>
\ No newline at end of file
skyeye-web/src/main/webapp/assets/json/desktopmenu.json
浏览文件 @
474ce1a3
...
...
@@ -58,9 +58,9 @@
"id"
:
2
},
{
"title"
:
"角色管理"
,
"pageURL"
:
"../../tpl/syseve
user/syseveuser
list.html"
,
"name"
:
"角色管理"
,
"title"
:
"角色管理
11
"
,
"pageURL"
:
"../../tpl/syseve
role/syseverole
list.html"
,
"name"
:
"角色管理
1
"
,
"icon"
:
"fa-th-large"
,
"openType"
:
2
,
"maxOpen"
:
-1
,
...
...
skyeye-web/src/main/webapp/js/syseverole/syseveroleadd.js
0 → 100644
浏览文件 @
474ce1a3
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
.
$
;
var
parentId
=
"
0
"
;
form
.
render
();
//菜单级别变化事件
form
.
on
(
'
radio(menuLevel)
'
,
function
(
data
)
{
var
val
=
data
.
value
;
if
(
val
==
'
1
'
){
//创世菜单
$
(
"
#parentIdBox
"
).
addClass
(
"
layui-hide
"
);
}
else
if
(
val
==
'
2
'
){
parentId
=
"
0
"
;
$
(
"
#lockParentSel
"
).
html
(
""
);
$
(
"
#parentIdBox
"
).
removeClass
(
"
layui-hide
"
);
loadChildMenu
();
}
else
{
top
.
winui
.
window
.
msg
(
'
状态值错误
'
,
{
icon
:
2
,
time
:
2000
});
}
});
//系统菜单同步
form
.
on
(
'
switch(isNecessary)
'
,
function
(
data
)
{
//同步开关值
$
(
data
.
elem
).
val
(
data
.
elem
.
checked
);
});
form
.
on
(
'
select(selectParent)
'
,
function
(
data
){
if
(
data
.
value
!=
parentId
){
if
(
isNull
(
data
.
value
)
||
data
.
value
==
'
请选择
'
){
layui
.
$
(
data
.
elem
).
parent
(
'
dd
'
).
nextAll
().
remove
();
if
(
layui
.
$
(
data
.
elem
).
parent
(
'
dd
'
).
prev
().
children
(
'
select[class=menuParent]
'
).
length
>
0
){
parentId
=
layui
.
$
(
data
.
elem
).
parent
(
'
dd
'
).
prev
().
children
(
'
select[class=menuParent]
'
)[
0
].
value
;
}
else
{
parentId
=
"
0
"
;
}
}
else
{
layui
.
$
(
data
.
elem
).
parent
(
'
dd
'
).
nextAll
().
remove
();
parentId
=
data
.
value
;
loadChildMenu
();
}
}
});
form
.
on
(
'
submit(formAddMenu)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
params
=
{
menuName
:
$
(
"
#menuName
"
).
val
(),
titleName
:
$
(
"
#menuTitle
"
).
val
(),
menuIcon
:
$
(
"
#menuIcon
"
).
val
(),
menuUrl
:
$
(
"
#menuUrl
"
).
val
(),
menuType
:
data
.
field
.
menuType
};
if
(
data
.
field
.
menuLevel
==
'
1
'
){
//创世菜单
params
.
parentId
=
'
0
'
;
}
else
if
(
data
.
field
.
menuLevel
==
'
2
'
){
//子菜单
var
$menu
=
layui
.
$
(
'
.menuParent
'
);
var
str
=
""
;
for
(
var
i
=
0
;
i
<
$menu
.
length
;
i
++
){
if
(
!
isNull
(
$menu
[
i
].
value
)
&&
$menu
[
i
].
value
!=
'
请选择
'
){
str
+=
$menu
[
i
].
value
+
"
,
"
;
}
}
if
(
isNull
(
str
)){
//父菜单为空
top
.
winui
.
window
.
msg
(
"
请至少选择一级父菜单
"
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
else
{
params
.
parentId
=
str
;
}
}
else
{
top
.
winui
.
window
.
msg
(
'
状态值错误
'
,
{
icon
:
2
,
time
:
2000
});
}
if
(
$
(
"
#menuSysType
"
).
val
()
==
'
true
'
){
params
.
menuSysType
=
'
1
'
;
}
else
{
params
.
menuSysType
=
'
2
'
;
}
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
sys007
"
,
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
;
});
//加载同级菜单
function
loadChildMenu
(){
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
sys009
"
,
params
:{
parentId
:
parentId
},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
'
<dd><select class="menuParent" lay-filter="selectParent" lay-search=""><option value="">请选择</option>
'
;
for
(
var
i
=
0
;
i
<
json
.
rows
.
length
;
i
++
){
str
+=
'
<option value="
'
+
json
.
rows
[
i
].
id
+
'
">
'
+
json
.
rows
[
i
].
menuName
+
'
---------
'
+
getMenuLevelName
(
json
.
rows
[
i
].
menuLevel
)
+
'
</option>
'
;
}
str
+=
'
</select></dd>
'
;
$
(
"
#lockParentSel
"
).
append
(
str
);
form
.
render
(
'
select
'
);
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
//获取菜单级别
function
getMenuLevelName
(
level
){
if
(
level
==
'
0
'
){
return
"
创世菜单
"
;
}
else
{
return
level
+
"
级子菜单
"
;
}
}
//初始化加载隐藏创世菜单
$
(
"
#parentIdBox
"
).
addClass
(
"
layui-hide
"
);
//取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
(){
parent
.
layer
.
close
(
index
);
});
});
});
\ No newline at end of file
skyeye-web/src/main/webapp/js/syseverole/syseverolelist.js
浏览文件 @
474ce1a3
...
...
@@ -15,18 +15,18 @@ layui.config({
id
:
'
messageTable
'
,
elem
:
'
#messageTable
'
,
method
:
'
post
'
,
url
:
reqBasePath
+
'
sys0
06
'
,
where
:{
menuName
:
$
(
"
#menuName
"
).
val
(),
menuUrl
:
$
(
"
#menuUrl
"
).
val
()},
url
:
reqBasePath
+
'
sys0
13
'
,
where
:{
roleName
:
$
(
"
#roleName
"
).
val
()},
even
:
true
,
//隔行变色
page
:
true
,
limits
:
[
8
,
16
,
24
,
32
,
40
,
48
,
56
],
limit
:
8
,
cols
:
[[
{
field
:
'
id
'
,
type
:
'
checkbox
'
},
{
field
:
'
menuName
'
,
title
:
'
角色名称
'
,
width
:
120
},
{
field
:
'
menuIcon
'
,
title
:
'
角色描述
'
,
width
:
520
},
{
field
:
'
roleName
'
,
title
:
'
角色名称
'
,
width
:
120
},
{
field
:
'
roleDesc
'
,
title
:
'
角色描述
'
,
width
:
520
},
{
field
:
'
parentName
'
,
title
:
'
父角色
'
,
width
:
150
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
180
},
{
field
:
'
userName
'
,
title
:
'
创建人
'
,
width
:
150
},
{
title
:
'
操作
'
,
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
120
,
toolbar
:
'
#tableBar
'
}
]]
});
...
...
@@ -53,8 +53,8 @@ layui.config({
//删除
function
del
(
data
,
obj
){
var
msg
=
obj
?
'
确认删除
菜单【
'
+
obj
.
data
.
menu
Name
+
'
】吗?
'
:
'
确认删除选中数据吗?
'
;
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
'
删除
系统菜单
'
},
function
(
index
)
{
var
msg
=
obj
?
'
确认删除
角色【
'
+
obj
.
data
.
role
Name
+
'
】吗?
'
:
'
确认删除选中数据吗?
'
;
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
'
删除
角色
'
},
function
(
index
)
{
layer
.
close
(
index
);
//向服务端发送删除指令
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
sys011
"
,
params
:{
rowId
:
data
.
id
},
type
:
'
json
'
,
callback
:
function
(
json
){
...
...
@@ -68,12 +68,12 @@ layui.config({
});
}
//编辑
//编辑
角色
function
edit
(
data
){
rowId
=
data
.
id
;
_openNewWindows
({
url
:
"
../../tpl/sysevemenu/sysevemenuedit.html
"
,
title
:
"
编辑
用户
"
,
title
:
"
编辑
角色
"
,
pageId
:
"
sysevemenuedit
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
...
...
@@ -90,11 +90,11 @@ layui.config({
loadTable
();
});
//新增
菜单
//新增
角色
$
(
"
body
"
).
on
(
"
click
"
,
"
#addBean
"
,
function
(){
_openNewWindows
({
url
:
"
../../tpl/syseve
menu/sysevemenu
add.html
"
,
title
:
"
新增
菜单
"
,
url
:
"
../../tpl/syseve
role/syseverole
add.html
"
,
title
:
"
新增
角色
"
,
pageId
:
"
sysevemenuadd
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
...
...
@@ -107,8 +107,8 @@ layui.config({
});
function
loadTable
(){
table
.
reload
(
"
messageTable
"
,
{
where
:{
menuName
:
$
(
"
#menuName
"
).
val
(),
menuUrl
:
$
(
"
#menuUrl
"
).
val
()}});
table
.
reload
(
"
messageTable
"
,
{
where
:{
roleName
:
$
(
"
#roleName
"
).
val
()}});
}
exports
(
'
syseve
menu
list
'
,
{});
exports
(
'
syseve
role
list
'
,
{});
});
skyeye-web/src/main/webapp/tpl/syseverole/syseveroleadd.html
0 → 100644
浏览文件 @
474ce1a3
<!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"
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"menuName"
name=
"menuName"
win-verify=
"required"
placeholder=
"请输入角色名称"
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
角色描述
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"menuTitle"
name=
"menuTitle"
win-verify=
"required"
placeholder=
"请输入窗口标题"
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
权限分配
</label>
<div
class=
"layui-input-block winui-radio"
>
<ul
id=
"treeDemo"
class=
"ztree fsTree"
method=
"get"
isRoot=
"1"
url=
"sys012"
treeIdKey=
"id"
inputs=
"parentId"
treePIdKey=
"pId"
clickCallbackInputs=
"parentId:$id"
treeName=
"name"
></ul>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddMenu"
>
确定
</button>
<button
class=
"winui-btn"
id=
"cancle"
>
取消
</button>
</div>
</div>
</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/syseverole/
'
}).
use
(
'
syseveroleadd
'
);
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录