Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fenghuo12
zheng
提交
1384226c
Z
zheng
项目概览
fenghuo12
/
zheng
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zheng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1384226c
编写于
2月 26, 2017
作者:
shuzheng5201314
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加用户组织、用户角色、用户权限按钮操作
上级
7ad1dc24
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
442 addition
and
19 deletion
+442
-19
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsUserController.java
...eng/upms/server/controller/manage/UpmsUserController.java
+94
-15
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/permission/index.jsp
...r/src/main/webapp/WEB-INF/jsp/manage/permission/index.jsp
+1
-1
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/index.jsp
...-server/src/main/webapp/WEB-INF/jsp/manage/user/index.jsp
+75
-3
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/organization.jsp
.../src/main/webapp/WEB-INF/jsp/manage/user/organization.jsp
+88
-0
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/permission.jsp
...er/src/main/webapp/WEB-INF/jsp/manage/user/permission.jsp
+96
-0
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/role.jsp
...s-server/src/main/webapp/WEB-INF/jsp/manage/user/role.jsp
+88
-0
未找到文件。
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/server/controller/manage/UpmsUserController.java
浏览文件 @
1384226c
...
...
@@ -8,15 +8,12 @@ import com.zheng.common.validator.LengthValidator;
import
com.zheng.common.validator.NotNullValidator
;
import
com.zheng.upms.common.constant.UpmsResult
;
import
com.zheng.upms.common.constant.UpmsResultConstant
;
import
com.zheng.upms.dao.model.UpmsUser
;
import
com.zheng.upms.dao.model.UpmsUserExample
;
import
com.zheng.upms.rpc.api.UpmsUserOrganizationService
;
import
com.zheng.upms.rpc.api.UpmsUserPermissionService
;
import
com.zheng.upms.rpc.api.UpmsUserRoleService
;
import
com.zheng.upms.rpc.api.UpmsUserService
;
import
com.zheng.upms.dao.model.*
;
import
com.zheng.upms.rpc.api.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.math.NumberUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -25,6 +22,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -44,14 +42,20 @@ public class UpmsUserController extends BaseController {
private
UpmsUserService
upmsUserService
;
@Autowired
private
Upms
UserRoleService
upmsUser
RoleService
;
private
Upms
RoleService
upms
RoleService
;
@Autowired
private
Upms
UserPermissionService
upmsUserPermiss
ionService
;
private
Upms
OrganizationService
upmsOrganizat
ionService
;
@Autowired
private
UpmsUserOrganizationService
upmsUserOrganizationService
;
@Autowired
private
UpmsUserRoleService
upmsUserRoleService
;
@Autowired
private
UpmsUserPermissionService
upmsUserPermissionService
;
@ApiOperation
(
value
=
"用户首页"
)
@RequiresPermissions
(
"upms:user:read"
)
@RequestMapping
(
value
=
"/index"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -59,13 +63,88 @@ public class UpmsUserController extends BaseController {
return
"/manage/user/index"
;
}
@ApiOperation
(
value
=
"用户授权"
)
@RequiresPermissions
(
"upms:user:permission"
)
@RequestMapping
(
value
=
"/permission/{id}"
,
method
=
RequestMethod
.
GET
)
public
String
permission
(
@PathVariable
(
"id"
)
int
id
,
ModelMap
modelMap
)
{
UpmsUser
user
=
upmsUserService
.
selectByPrimaryKey
(
id
);
modelMap
.
put
(
"user"
,
user
);
return
"/manage/user/permission"
;
@ApiOperation
(
value
=
"用户组织"
)
@RequiresPermissions
(
"upms:user:organization"
)
@RequestMapping
(
value
=
"/organization/{id}"
,
method
=
RequestMethod
.
GET
)
public
String
organization
(
@PathVariable
(
"id"
)
int
id
,
ModelMap
modelMap
)
{
// 所有组织
List
<
UpmsOrganization
>
upmsOrganizations
=
upmsOrganizationService
.
selectByExample
(
new
UpmsOrganizationExample
());
// 用户拥有组织
UpmsUserOrganizationExample
upmsUserOrganizationExample
=
new
UpmsUserOrganizationExample
();
upmsUserOrganizationExample
.
createCriteria
()
.
andUserIdEqualTo
(
id
);
List
<
UpmsUserOrganization
>
upmsUserOrganizations
=
upmsUserOrganizationService
.
selectByExample
(
upmsUserOrganizationExample
);
modelMap
.
put
(
"upmsOrganizations"
,
upmsOrganizations
);
modelMap
.
put
(
"upmsUserOrganizations"
,
upmsUserOrganizations
);
return
"/manage/user/organization"
;
}
@ApiOperation
(
value
=
"用户组织"
)
@RequiresPermissions
(
"upms:user:organization"
)
@RequestMapping
(
value
=
"/organization/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
organization
(
@PathVariable
(
"id"
)
int
id
,
HttpServletRequest
request
)
{
String
[]
organizationIds
=
request
.
getParameterValues
(
"organizationId"
);
// 删除旧记录
UpmsUserOrganizationExample
upmsUserOrganizationExample
=
new
UpmsUserOrganizationExample
();
upmsUserOrganizationExample
.
createCriteria
()
.
andUserIdEqualTo
(
id
);
upmsUserOrganizationService
.
deleteByExample
(
upmsUserOrganizationExample
);
// 增加新记录
if
(
null
!=
organizationIds
)
{
for
(
String
organizationId
:
organizationIds
)
{
if
(
StringUtils
.
isBlank
(
organizationId
))
{
continue
;
}
UpmsUserOrganization
upmsUserOrganization
=
new
UpmsUserOrganization
();
upmsUserOrganization
.
setUserId
(
id
);
upmsUserOrganization
.
setOrganizationId
(
NumberUtils
.
toInt
(
organizationId
));
upmsUserOrganizationService
.
insertSelective
(
upmsUserOrganization
);
}
}
return
new
UpmsResult
(
UpmsResultConstant
.
SUCCESS
,
""
);
}
@ApiOperation
(
value
=
"用户角色"
)
@RequiresPermissions
(
"upms:user:role"
)
@RequestMapping
(
value
=
"/role/{id}"
,
method
=
RequestMethod
.
GET
)
public
String
role
(
@PathVariable
(
"id"
)
int
id
,
ModelMap
modelMap
)
{
// 所有角色
List
<
UpmsRole
>
upmsRoles
=
upmsRoleService
.
selectByExample
(
new
UpmsRoleExample
());
// 用户拥有角色
UpmsUserRoleExample
upmsUserRoleExample
=
new
UpmsUserRoleExample
();
upmsUserRoleExample
.
createCriteria
()
.
andUserIdEqualTo
(
id
);
List
<
UpmsUserRole
>
upmsUserRoles
=
upmsUserRoleService
.
selectByExample
(
upmsUserRoleExample
);
modelMap
.
put
(
"upmsRoles"
,
upmsRoles
);
modelMap
.
put
(
"upmsUserRoles"
,
upmsUserRoles
);
return
"/manage/user/role"
;
}
@ApiOperation
(
value
=
"用户角色"
)
@RequiresPermissions
(
"upms:user:role"
)
@RequestMapping
(
value
=
"/role/{id}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
role
(
@PathVariable
(
"id"
)
int
id
,
HttpServletRequest
request
)
{
String
[]
roleIds
=
request
.
getParameterValues
(
"roleId"
);
// 删除旧记录
UpmsUserRoleExample
upmsUserRoleExample
=
new
UpmsUserRoleExample
();
upmsUserRoleExample
.
createCriteria
()
.
andUserIdEqualTo
(
id
);
upmsUserRoleService
.
deleteByExample
(
upmsUserRoleExample
);
// 增加新记录
if
(
null
!=
roleIds
)
{
for
(
String
roleId
:
roleIds
)
{
if
(
StringUtils
.
isBlank
(
roleId
))
{
continue
;
}
UpmsUserRole
upmsUserRole
=
new
UpmsUserRole
();
upmsUserRole
.
setUserId
(
id
);
upmsUserRole
.
setRoleId
(
NumberUtils
.
toInt
(
roleId
));
upmsUserRoleService
.
insertSelective
(
upmsUserRole
);
}
}
return
new
UpmsResult
(
UpmsResultConstant
.
SUCCESS
,
""
);
}
@ApiOperation
(
value
=
"用户列表"
)
...
...
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/permission/index.jsp
浏览文件 @
1384226c
...
...
@@ -106,7 +106,7 @@ function createAction() {
content
:
'
url:${basePath}/manage/permission/create
'
,
onContentReady
:
function
()
{
initMaterialInput
();
$
(
'
select
'
).
select2
(
{
placeholder
:
"
Select a state
"
}
);
$
(
'
select
'
).
select2
();
}
});
}
...
...
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/index.jsp
浏览文件 @
1384226c
...
...
@@ -21,7 +21,9 @@
<shiro:hasPermission
name=
"upms:user:create"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"createAction()"
><i
class=
"zmdi zmdi-plus"
></i>
新增用户
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:update"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"updateAction()"
><i
class=
"zmdi zmdi-edit"
></i>
编辑用户
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:delete"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"deleteAction()"
><i
class=
"zmdi zmdi-close"
></i>
删除用户
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:permission"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"permissionAction()"
><i
class=
"zmdi zmdi-key"
></i>
用户授权
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:organization"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"organizationAction()"
><i
class=
"zmdi zmdi-accounts-list"
></i>
用户组织
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:role"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"roleAction()"
><i
class=
"zmdi zmdi-accounts"
></i>
用户角色
</a></shiro:hasPermission>
<shiro:hasPermission
name=
"upms:user:permission"
><a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"permissionAction()"
><i
class=
"zmdi zmdi-key"
></i>
用户权限
</a></shiro:hasPermission>
</div>
<table
id=
"table"
></table>
</div>
...
...
@@ -233,8 +235,77 @@ function deleteAction() {
});
}
}
// 授权
// 用户组织
var
organizationDialog
;
var
organizationUserId
;
function
organizationAction
()
{
var
rows
=
$table
.
bootstrapTable
(
'
getSelections
'
);
if
(
rows
.
length
!=
1
)
{
$
.
confirm
({
title
:
false
,
content
:
'
请选择一条记录!
'
,
autoClose
:
'
cancel|3000
'
,
backgroundDismiss
:
true
,
buttons
:
{
cancel
:
{
text
:
'
取消
'
,
btnClass
:
'
waves-effect waves-button
'
}
}
});
}
else
{
organizationUserId
=
rows
[
0
].
userId
;
organizationDialog
=
$
.
dialog
({
animationSpeed
:
300
,
title
:
'
用户组织
'
,
content
:
'
url:${basePath}/manage/user/organization/
'
+
organizationUserId
,
onContentReady
:
function
()
{
initMaterialInput
();
$
(
'
select
'
).
select2
({
placeholder
:
'
请选择用户组织
'
,
allowClear
:
true
});
}
});
}
}
// 用户角色
var
roleDialog
;
var
roleUserId
;
function
roleAction
()
{
var
rows
=
$table
.
bootstrapTable
(
'
getSelections
'
);
if
(
rows
.
length
!=
1
)
{
$
.
confirm
({
title
:
false
,
content
:
'
请选择一条记录!
'
,
autoClose
:
'
cancel|3000
'
,
backgroundDismiss
:
true
,
buttons
:
{
cancel
:
{
text
:
'
取消
'
,
btnClass
:
'
waves-effect waves-button
'
}
}
});
}
else
{
roleUserId
=
rows
[
0
].
userId
;
roleDialog
=
$
.
dialog
({
animationSpeed
:
300
,
title
:
'
用户角色
'
,
content
:
'
url:${basePath}/manage/user/role/
'
+
roleUserId
,
onContentReady
:
function
()
{
initMaterialInput
();
$
(
'
select
'
).
select2
({
placeholder
:
'
请选择用户角色
'
,
allowClear
:
true
});
}
});
}
}
// 用户权限
var
permissionDialog
;
var
permissionUserId
;
function
permissionAction
()
{
var
rows
=
$table
.
bootstrapTable
(
'
getSelections
'
);
if
(
rows
.
length
!=
1
)
{
...
...
@@ -251,10 +322,11 @@ function permissionAction() {
}
});
}
else
{
permissionUserId
=
rows
[
0
].
userId
;
permissionDialog
=
$
.
dialog
({
animationSpeed
:
300
,
title
:
'
用户授权
'
,
content
:
'
url:${basePath}/manage/user/permission/
'
+
rows
[
0
].
u
serId
,
content
:
'
url:${basePath}/manage/user/permission/
'
+
permissionU
serId
,
onContentReady
:
function
()
{
initMaterialInput
();
}
...
...
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/organization.jsp
0 → 100644
浏览文件 @
1384226c
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
uri=
"http://java.sun.com/jstl/core_rt"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/fmt"
prefix=
"fmt"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags"
prefix=
"spring"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags/form"
prefix=
"form"
%>
<%@taglib
prefix=
"shiro"
uri=
"http://shiro.apache.org/tags"
%>
<c:set
var=
"basePath"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<div
id=
"organizationDialog"
class=
"crudDialog"
>
<form
id=
"organizationForm"
method=
"post"
>
<div
class=
"form-group"
>
<select
id=
"organizationId"
name=
"organizationId"
multiple=
"multiple"
style=
"width: 100%"
>
<c:forEach
var=
"upmsOrganization"
items=
"
${
upmsOrganizations
}
"
>
<option
value=
"${upmsOrganization.organizationId}"
<c:forEach
var=
"upmsUserOrganization"
items=
"
${
upmsUserOrganizations
}
"
><c:if
test=
"
${
upmsOrganization
.
organizationId
==
upmsUserOrganization
.
organizationId
}
"
>
selected=
"selected"
</c:if></c:forEach>>
${upmsOrganization.name}
</option>
</c:forEach>
</select>
</div>
<div
class=
"form-group text-right dialog-buttons"
>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"organizationSubmit();"
>
保存
</a>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"organizationDialog.close();"
>
取消
</a>
</div>
</form>
</div>
<script>
function
organizationSubmit
()
{
$
.
ajax
({
type
:
'
post
'
,
url
:
'
${basePath}/manage/user/organization/
'
+
organizationUserId
,
data
:
$
(
'
#organizationForm
'
).
serialize
(),
beforeSend
:
function
()
{
},
success
:
function
(
result
)
{
if
(
result
.
code
!=
1
)
{
if
(
result
.
data
instanceof
Array
)
{
$
.
each
(
result
.
data
,
function
(
index
,
value
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
value
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
});
}
else
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
result
.
data
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
}
else
{
organizationDialog
.
close
();
$table
.
bootstrapTable
(
'
refresh
'
);
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
textStatus
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
});
}
</script>
\ No newline at end of file
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/permission.jsp
0 → 100644
浏览文件 @
1384226c
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
uri=
"http://java.sun.com/jstl/core_rt"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/fmt"
prefix=
"fmt"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags"
prefix=
"spring"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags/form"
prefix=
"form"
%>
<%@taglib
prefix=
"shiro"
uri=
"http://shiro.apache.org/tags"
%>
<c:set
var=
"basePath"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<div
id=
"permissionDialog"
class=
"crudDialog"
>
<form
id=
"permissionForm"
method=
"post"
>
<div
class=
"form-group"
>
<select
id=
"systemId"
name=
"systemId"
>
<option
value=
"0"
>
请选择系统
</option>
<c:forEach
var=
"upmsSystem"
items=
"
${
upmsSystems
}
"
>
<option
value=
"${upmsSystem.systemId}"
>
${upmsSystem.title}
</option>
</c:forEach>
</select>
</div>
<div
class=
"form-group text-right dialog-buttons"
>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"permissionSubmit();"
>
保存
</a>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"permissionDialog.close();"
>
取消
</a>
</div>
</form>
</div>
<script>
function
permissionSubmit
()
{
$
.
ajax
({
type
:
'
post
'
,
url
:
'
${basePath}/manage/user/permission
'
,
data
:
$
(
'
#permissionForm
'
).
serialize
(),
beforeSend
:
function
()
{
if
(
$
(
'
#name
'
).
val
()
==
''
)
{
$
(
'
#name
'
).
focus
();
return
false
;
}
if
(
$
(
'
#title
'
).
val
()
==
''
)
{
$
(
'
#title
'
).
focus
();
return
false
;
}
},
success
:
function
(
result
)
{
if
(
result
.
code
!=
1
)
{
if
(
result
.
data
instanceof
Array
)
{
$
.
each
(
result
.
data
,
function
(
index
,
value
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
value
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
});
}
else
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
result
.
data
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
}
else
{
permissionDialog
.
close
();
$table
.
bootstrapTable
(
'
refresh
'
);
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
textStatus
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
});
}
</script>
\ No newline at end of file
zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/user/role.jsp
0 → 100644
浏览文件 @
1384226c
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<%@ taglib
uri=
"http://java.sun.com/jstl/core_rt"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/fmt"
prefix=
"fmt"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags"
prefix=
"spring"
%>
<%@ taglib
uri=
"http://www.springframework.org/tags/form"
prefix=
"form"
%>
<%@taglib
prefix=
"shiro"
uri=
"http://shiro.apache.org/tags"
%>
<c:set
var=
"basePath"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<div
id=
"roleDialog"
class=
"crudDialog"
>
<form
id=
"roleForm"
method=
"post"
>
<div
class=
"form-group"
>
<select
id=
"organizationId"
name=
"organizationId"
multiple=
"multiple"
style=
"width: 100%"
>
<c:forEach
var=
"upmsRole"
items=
"
${
upmsRoles
}
"
>
<option
value=
"${upmsRole.roleId}"
<c:forEach
var=
"upmsUserRole"
items=
"
${
upmsUserRoles
}
"
><c:if
test=
"
${
upmsRole
.
roleId
==
upmsUserRole
.
roleId
}
"
>
selected=
"selected"
</c:if></c:forEach>>
${upmsRole.title}
</option>
</c:forEach>
</select>
</div>
<div
class=
"form-group text-right dialog-buttons"
>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"roleSubmit();"
>
保存
</a>
<a
class=
"waves-effect waves-button"
href=
"javascript:;"
onclick=
"roleDialog.close();"
>
取消
</a>
</div>
</form>
</div>
<script>
function
roleSubmit
()
{
$
.
ajax
({
type
:
'
post
'
,
url
:
'
${basePath}/manage/user/role/
'
+
roleUserId
,
data
:
$
(
'
#roleForm
'
).
serialize
(),
beforeSend
:
function
()
{
},
success
:
function
(
result
)
{
if
(
result
.
code
!=
1
)
{
if
(
result
.
data
instanceof
Array
)
{
$
.
each
(
result
.
data
,
function
(
index
,
value
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
value
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
});
}
else
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
result
.
data
.
errorMsg
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
}
else
{
roleDialog
.
close
();
$table
.
bootstrapTable
(
'
refresh
'
);
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
$
.
confirm
({
theme
:
'
dark
'
,
animation
:
'
rotateX
'
,
closeAnimation
:
'
rotateX
'
,
title
:
false
,
content
:
textStatus
,
buttons
:
{
confirm
:
{
text
:
'
确认
'
,
btnClass
:
'
waves-effect waves-button waves-light
'
}
}
});
}
});
}
</script>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录