Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
f15bf0b7
Commit
f15bf0b7
authored
Dec 08, 2018
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色管理修改页面
parent
ede7696b
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
68 deletions
+57
-68
src/main/java/cn/stylefeng/guns/modular/system/controller/RoleController.java
+10
-11
src/main/java/cn/stylefeng/guns/modular/system/controller/UserMgrController.java
+1
-1
src/main/java/cn/stylefeng/guns/modular/system/factory/UserFactory.java
+1
-1
src/main/java/cn/stylefeng/guns/modular/system/model/RoleDto.java
+38
-0
src/main/java/cn/stylefeng/guns/modular/system/model/UserDto.java
+1
-1
src/main/webapp/WEB-INF/login.html
+2
-2
src/main/webapp/WEB-INF/system/role/role_add.html
+1
-8
src/main/webapp/WEB-INF/system/role/role_edit.html
+1
-8
src/main/webapp/assets/modular/system/role/role_add.js
+1
-18
src/main/webapp/assets/modular/system/role/role_edit.js
+1
-18
No files found.
src/main/java/cn/stylefeng/guns/modular/system/controller/RoleController.java
View file @
f15bf0b7
...
@@ -28,6 +28,7 @@ import cn.stylefeng.guns.core.log.LogObjectHolder;
...
@@ -28,6 +28,7 @@ import cn.stylefeng.guns.core.log.LogObjectHolder;
import
cn.stylefeng.guns.core.util.CacheUtil
;
import
cn.stylefeng.guns.core.util.CacheUtil
;
import
cn.stylefeng.guns.modular.system.entity.Role
;
import
cn.stylefeng.guns.modular.system.entity.Role
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.model.RoleDto
;
import
cn.stylefeng.guns.modular.system.service.RoleService
;
import
cn.stylefeng.guns.modular.system.service.RoleService
;
import
cn.stylefeng.guns.modular.system.service.UserService
;
import
cn.stylefeng.guns.modular.system.service.UserService
;
import
cn.stylefeng.guns.modular.system.warpper.RoleWarpper
;
import
cn.stylefeng.guns.modular.system.warpper.RoleWarpper
;
...
@@ -38,13 +39,11 @@ import cn.stylefeng.roses.kernel.model.exception.ServiceException;
...
@@ -38,13 +39,11 @@ import cn.stylefeng.roses.kernel.model.exception.ServiceException;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.validation.Valid
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -130,11 +129,10 @@ public class RoleController extends BaseController {
...
@@ -130,11 +129,10 @@ public class RoleController extends BaseController {
@BussinessLog
(
value
=
"添加角色"
,
key
=
"name"
,
dict
=
RoleDict
.
class
)
@BussinessLog
(
value
=
"添加角色"
,
key
=
"name"
,
dict
=
RoleDict
.
class
)
@Permission
(
Const
.
ADMIN_NAME
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
@ResponseBody
public
ResponseData
add
(
@Valid
Role
role
,
BindingResult
result
)
{
public
ResponseData
add
(
Role
role
)
{
if
(
result
.
hasErrors
())
{
throw
new
ServiceException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
role
.
setRoleId
(
null
);
role
.
setRoleId
(
null
);
this
.
roleService
.
insert
(
role
);
this
.
roleService
.
insert
(
role
);
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
...
@@ -146,14 +144,15 @@ public class RoleController extends BaseController {
...
@@ -146,14 +144,15 @@ public class RoleController extends BaseController {
@BussinessLog
(
value
=
"修改角色"
,
key
=
"name"
,
dict
=
RoleDict
.
class
)
@BussinessLog
(
value
=
"修改角色"
,
key
=
"name"
,
dict
=
RoleDict
.
class
)
@Permission
(
Const
.
ADMIN_NAME
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
@ResponseBody
public
ResponseData
edit
(
@Valid
Role
role
,
BindingResult
result
)
{
public
ResponseData
edit
(
RoleDto
roleDto
)
{
if
(
result
.
hasErrors
())
{
throw
new
ServiceException
(
BizExceptionEnum
.
REQUEST_NULL
);
Role
old
=
this
.
roleService
.
selectById
(
roleDto
.
getRoleId
()
);
}
BeanUtil
.
copyProperties
(
roleDto
,
old
);
this
.
roleService
.
updateById
(
role
);
this
.
roleService
.
updateById
(
old
);
//删除缓存
//删除缓存
CacheUtil
.
removeAll
(
Cache
.
CONSTANT
);
CacheUtil
.
removeAll
(
Cache
.
CONSTANT
);
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
...
...
src/main/java/cn/stylefeng/guns/modular/system/controller/UserMgrController.java
View file @
f15bf0b7
...
@@ -30,8 +30,8 @@ import cn.stylefeng.guns.core.shiro.ShiroKit;
...
@@ -30,8 +30,8 @@ import cn.stylefeng.guns.core.shiro.ShiroKit;
import
cn.stylefeng.guns.core.shiro.ShiroUser
;
import
cn.stylefeng.guns.core.shiro.ShiroUser
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.factory.UserFactory
;
import
cn.stylefeng.guns.modular.system.factory.UserFactory
;
import
cn.stylefeng.guns.modular.system.model.UserDto
;
import
cn.stylefeng.guns.modular.system.service.UserService
;
import
cn.stylefeng.guns.modular.system.service.UserService
;
import
cn.stylefeng.guns.modular.system.transfer.UserDto
;
import
cn.stylefeng.guns.modular.system.warpper.UserWarpper
;
import
cn.stylefeng.guns.modular.system.warpper.UserWarpper
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
cn.stylefeng.roses.core.datascope.DataScope
;
import
cn.stylefeng.roses.core.datascope.DataScope
;
...
...
src/main/java/cn/stylefeng/guns/modular/system/factory/UserFactory.java
View file @
f15bf0b7
...
@@ -19,7 +19,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -19,7 +19,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.stylefeng.guns.core.common.constant.state.ManagerStatus
;
import
cn.stylefeng.guns.core.common.constant.state.ManagerStatus
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.entity.User
;
import
cn.stylefeng.guns.modular.system.
transfer
.UserDto
;
import
cn.stylefeng.guns.modular.system.
model
.UserDto
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
src/main/java/cn/stylefeng/guns/modular/system/model/RoleDto.java
0 → 100644
View file @
f15bf0b7
package
cn
.
stylefeng
.
guns
.
modular
.
system
.
model
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 角色信息
*
* @author fengshuonan
* @Date 2018/12/8 18:16
*/
@Data
public
class
RoleDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
roleId
;
/**
* 父角色id
*/
private
Long
pid
;
/**
* 角色名称
*/
private
String
name
;
/**
* 提示
*/
private
String
description
;
/**
* 序号
*/
private
Integer
sort
;
}
src/main/java/cn/stylefeng/guns/modular/system/
transfer
/UserDto.java
→
src/main/java/cn/stylefeng/guns/modular/system/
model
/UserDto.java
View file @
f15bf0b7
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
cn
.
stylefeng
.
guns
.
modular
.
system
.
transfer
;
package
cn
.
stylefeng
.
guns
.
modular
.
system
.
model
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
src/main/webapp/WEB-INF/login.html
View file @
f15bf0b7
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
<form
class=
"form-horizontal form-material"
id=
"loginform"
action=
"${ctxPath}/login"
method=
"post"
>
<form
class=
"form-horizontal form-material"
id=
"loginform"
action=
"${ctxPath}/login"
method=
"post"
>
<h3
class=
"box-title m-b-30"
>
Guns管理系统
</h3>
<h3
class=
"box-title m-b-30"
>
Guns管理系统
</h3>
@if(isNotEmpty(
description
)){
@if(isNotEmpty(
tips
)){
<h5
class=
"box-title m-b-30"
style=
"color: red;"
>
${
description
}
</h5>
<h5
class=
"box-title m-b-30"
style=
"color: red;"
>
${
tips
}
</h5>
@}
@}
<div
class=
"form-group "
>
<div
class=
"form-group "
>
...
...
src/main/webapp/WEB-INF/system/role/role_add.html
View file @
f15bf0b7
...
@@ -25,16 +25,9 @@
...
@@ -25,16 +25,9 @@
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<h5>
部门名称
<span
class=
"text-danger"
>
*
</span></h5>
<div
class=
"controls"
>
<input
v-model=
"deptName"
id=
"detpName"
\@
click=
"showDeptSelectTree"
type=
"text"
class=
"form-control"
autocomplete=
"off"
>
<input
v-model=
"deptId"
type=
"hidden"
class=
"form-control"
>
</div>
</div>
<div
class=
"form-group"
>
<h5>
排序
</h5>
<h5>
排序
</h5>
<div
class=
"controls"
>
<div
class=
"controls"
>
<input
v-model=
"
num
"
type=
"text"
class=
"form-control"
>
<input
v-model=
"
sort
"
type=
"text"
class=
"form-control"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/system/role/role_edit.html
View file @
f15bf0b7
...
@@ -25,16 +25,9 @@
...
@@ -25,16 +25,9 @@
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<h5>
部门名称
<span
class=
"text-danger"
>
*
</span></h5>
<div
class=
"controls"
>
<input
v-model=
"deptName"
id=
"detpName"
\@
click=
"showDeptSelectTree"
type=
"text"
class=
"form-control"
autocomplete=
"off"
>
<input
v-model=
"deptId"
type=
"hidden"
class=
"form-control"
>
</div>
</div>
<div
class=
"form-group"
>
<h5>
排序
</h5>
<h5>
排序
</h5>
<div
class=
"controls"
>
<div
class=
"controls"
>
<input
v-model=
"
num
"
type=
"text"
class=
"form-control"
>
<input
v-model=
"
sort
"
type=
"text"
class=
"form-control"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/assets/modular/system/role/role_add.js
View file @
f15bf0b7
...
@@ -7,9 +7,7 @@ var RoleAddDlg = {
...
@@ -7,9 +7,7 @@ var RoleAddDlg = {
pName
:
""
,
pName
:
""
,
pid
:
""
,
pid
:
""
,
description
:
""
,
description
:
""
,
deptName
:
""
,
sort
:
""
deptId
:
""
,
num
:
""
}
}
};
};
...
@@ -33,9 +31,6 @@ RoleAddDlg.validateForm = function () {
...
@@ -33,9 +31,6 @@ RoleAddDlg.validateForm = function () {
if
(
!
(
data
.
pName
))
{
if
(
!
(
data
.
pName
))
{
return
"请输入上级名称"
;
return
"请输入上级名称"
;
}
}
if
(
!
data
.
deptName
)
{
return
"请输入部门名称"
;
}
if
(
!
data
.
description
)
{
if
(
!
data
.
description
)
{
return
"请输入别名"
;
return
"请输入别名"
;
}
}
...
@@ -67,18 +62,6 @@ $(function () {
...
@@ -67,18 +62,6 @@ $(function () {
submitForm
:
function
(
e
)
{
submitForm
:
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
},
},
showDeptSelectTree
:
function
()
{
var
formName
=
encodeURIComponent
(
"parent.RoleAddDlg.app.deptName"
);
var
formId
=
encodeURIComponent
(
"parent.RoleAddDlg.app.deptId"
);
var
treeUrl
=
encodeURIComponent
(
Feng
.
ctxPath
+
"/dept/tree"
);
layer
.
open
({
type
:
2
,
title
:
'部门选择'
,
area
:
[
'300px'
,
'350px'
],
content
:
Feng
.
ctxPath
+
'/system/commonTree?formName='
+
formName
+
"&formId="
+
formId
+
"&treeUrl="
+
treeUrl
});
},
showParentSelectTree
:
function
()
{
showParentSelectTree
:
function
()
{
var
formName
=
encodeURIComponent
(
"parent.RoleAddDlg.app.pName"
);
var
formName
=
encodeURIComponent
(
"parent.RoleAddDlg.app.pName"
);
var
formId
=
encodeURIComponent
(
"parent.RoleAddDlg.app.pid"
);
var
formId
=
encodeURIComponent
(
"parent.RoleAddDlg.app.pid"
);
...
...
src/main/webapp/assets/modular/system/role/role_edit.js
View file @
f15bf0b7
...
@@ -8,9 +8,7 @@ var RoleEditDlg = {
...
@@ -8,9 +8,7 @@ var RoleEditDlg = {
pName
:
""
,
pName
:
""
,
pid
:
""
,
pid
:
""
,
description
:
""
,
description
:
""
,
deptName
:
""
,
sort
:
""
deptId
:
""
,
num
:
""
}
}
};
};
...
@@ -34,9 +32,6 @@ RoleEditDlg.validateForm = function () {
...
@@ -34,9 +32,6 @@ RoleEditDlg.validateForm = function () {
if
(
!
(
data
.
pName
))
{
if
(
!
(
data
.
pName
))
{
return
"请输入上级名称"
;
return
"请输入上级名称"
;
}
}
if
(
!
data
.
deptName
)
{
return
"请输入部门名称"
;
}
if
(
!
data
.
description
)
{
if
(
!
data
.
description
)
{
return
"请输入别名"
;
return
"请输入别名"
;
}
}
...
@@ -73,18 +68,6 @@ $(function () {
...
@@ -73,18 +68,6 @@ $(function () {
submitForm
:
function
(
e
)
{
submitForm
:
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
},
},
showDeptSelectTree
:
function
()
{
var
formName
=
encodeURIComponent
(
"parent.RoleEditDlg.app.deptName"
);
var
formId
=
encodeURIComponent
(
"parent.RoleEditDlg.app.deptId"
);
var
treeUrl
=
encodeURIComponent
(
Feng
.
ctxPath
+
"/dept/tree"
);
layer
.
open
({
type
:
2
,
title
:
'部门选择'
,
area
:
[
'300px'
,
'350px'
],
content
:
Feng
.
ctxPath
+
'/system/commonTree?formName='
+
formName
+
"&formId="
+
formId
+
"&treeUrl="
+
treeUrl
});
},
showParentSelectTree
:
function
()
{
showParentSelectTree
:
function
()
{
var
formName
=
encodeURIComponent
(
"parent.RoleEditDlg.app.pName"
);
var
formName
=
encodeURIComponent
(
"parent.RoleEditDlg.app.pName"
);
var
formId
=
encodeURIComponent
(
"parent.RoleEditDlg.app.pid"
);
var
formId
=
encodeURIComponent
(
"parent.RoleEditDlg.app.pid"
);
...
...
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