Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
2478683b
提交
2478683b
authored
2月 24, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 用户更新
上级
7de87b66
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
10 行删除
+21
-10
SysUserController.java
...in/java/io/dataease/controller/sys/SysUserController.java
+2
-2
SysUserGridResponse.java
...dataease/controller/sys/response/SysUserGridResponse.java
+2
-0
SysUserService.java
...src/main/java/io/dataease/service/sys/SysUserService.java
+9
-1
user.vue
frontend/src/business/components/settings/sys/user.vue
+8
-7
没有找到文件。
backend/src/main/java/io/dataease/controller/sys/SysUserController.java
浏览文件 @
2478683b
...
@@ -37,13 +37,13 @@ public class SysUserController {
...
@@ -37,13 +37,13 @@ public class SysUserController {
}
}
@ApiOperation
(
"更新用户"
)
@ApiOperation
(
"更新用户"
)
@PostMapping
(
"/updat"
)
@PostMapping
(
"/updat
e
"
)
public
void
update
(
@RequestBody
SysUserCreateRequest
request
){
public
void
update
(
@RequestBody
SysUserCreateRequest
request
){
sysUserService
.
update
(
request
);
sysUserService
.
update
(
request
);
}
}
@ApiOperation
(
"更新用户"
)
@ApiOperation
(
"更新用户"
)
@PostMapping
(
"/
updat
/{userId}"
)
@PostMapping
(
"/
delete
/{userId}"
)
public
void
delete
(
@PathVariable
(
"userId"
)
Long
userId
){
public
void
delete
(
@PathVariable
(
"userId"
)
Long
userId
){
sysUserService
.
delete
(
userId
);
sysUserService
.
delete
(
userId
);
}
}
...
...
backend/src/main/java/io/dataease/controller/sys/response/SysUserGridResponse.java
浏览文件 @
2478683b
...
@@ -13,4 +13,6 @@ public class SysUserGridResponse extends SysUser {
...
@@ -13,4 +13,6 @@ public class SysUserGridResponse extends SysUser {
private
SysUserDept
dept
;
private
SysUserDept
dept
;
private
List
<
Long
>
roleIds
;
}
}
backend/src/main/java/io/dataease/service/sys/SysUserService.java
浏览文件 @
2478683b
...
@@ -12,6 +12,7 @@ import io.dataease.commons.utils.CodingUtil;
...
@@ -12,6 +12,7 @@ import io.dataease.commons.utils.CodingUtil;
import
io.dataease.controller.sys.request.SysUserCreateRequest
;
import
io.dataease.controller.sys.request.SysUserCreateRequest
;
import
io.dataease.controller.sys.request.UserGridRequest
;
import
io.dataease.controller.sys.request.UserGridRequest
;
import
io.dataease.controller.sys.response.SysUserGridResponse
;
import
io.dataease.controller.sys.response.SysUserGridResponse
;
import
io.dataease.controller.sys.response.SysUserRole
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
@Service
public
class
SysUserService
{
public
class
SysUserService
{
...
@@ -37,7 +39,13 @@ public class SysUserService {
...
@@ -37,7 +39,13 @@ public class SysUserService {
private
ExtSysUserMapper
extSysUserMapper
;
private
ExtSysUserMapper
extSysUserMapper
;
public
List
<
SysUserGridResponse
>
query
(
UserGridRequest
request
){
public
List
<
SysUserGridResponse
>
query
(
UserGridRequest
request
){
return
extSysUserMapper
.
query
(
request
);
List
<
SysUserGridResponse
>
lists
=
extSysUserMapper
.
query
(
request
);
lists
.
forEach
(
item
->
{
List
<
SysUserRole
>
roles
=
item
.
getRoles
();
List
<
Long
>
roleIds
=
roles
.
stream
().
map
(
SysUserRole:
:
getRoleId
).
collect
(
Collectors
.
toList
());
item
.
setRoleIds
(
roleIds
);
});
return
lists
;
}
}
@Transactional
@Transactional
...
...
frontend/src/business/components/settings/sys/user.vue
浏览文件 @
2478683b
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<ms-table-pagination
:change=
"search"
:current-page
.
sync=
"currentPage"
:page-size
.
sync=
"pageSize"
:total=
"total"
/>
<ms-table-pagination
:change=
"search"
:current-page
.
sync=
"currentPage"
:page-size
.
sync=
"pageSize"
:total=
"total"
/>
</el-card>
</el-card>
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:title=
"
$t('user.create
')"
:visible
.
sync=
"dialogVisible"
width=
"570px"
@
closed=
"handleClose"
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:title=
"
formType=='add' ? $t('user.create') : $t('user.modify
')"
:visible
.
sync=
"dialogVisible"
width=
"570px"
@
closed=
"handleClose"
:destroy-on-close=
"true"
>
:destroy-on-close=
"true"
>
<el-form
ref=
"createUserForm"
:inline=
"true"
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"66px"
>
<el-form
ref=
"createUserForm"
:inline=
"true"
:model=
"form"
:rules=
"rule"
size=
"small"
label-width=
"66px"
>
...
@@ -63,10 +63,6 @@
...
@@ -63,10 +63,6 @@
<el-input
v-model=
"form.email"
/>
<el-input
v-model=
"form.email"
/>
</el-form-item>
</el-form-item>
<!-- <el-form-item :label="$t('commons.password')" prop="password" >
<el-input v-model="form.password" autocomplete="new-password" show-password
:placeholder="$t('user.input_password')" style="width: 175px;"/>
</el-form-item> -->
<el-form-item
label=
"性别"
>
<el-form-item
label=
"性别"
>
<el-radio-group
v-model=
"form.gender"
style=
"width: 178px"
>
<el-radio-group
v-model=
"form.gender"
style=
"width: 178px"
>
<el-radio
label=
"男"
>
男
</el-radio>
<el-radio
label=
"男"
>
男
</el-radio>
...
@@ -244,7 +240,8 @@ export default {
...
@@ -244,7 +240,8 @@ export default {
depts
:
null
,
depts
:
null
,
roles
:
[],
roles
:
[],
roleDatas
:
[],
roleDatas
:
[],
userRoles
:
[]
userRoles
:
[],
formType
:
'add'
}
}
},
},
activated
()
{
activated
()
{
...
@@ -255,12 +252,14 @@ export default {
...
@@ -255,12 +252,14 @@ export default {
},
},
methods
:
{
methods
:
{
create
()
{
create
()
{
this
.
formType
=
'add'
this
.
form
=
Object
.
assign
({},
this
.
defaultForm
);
this
.
form
=
Object
.
assign
({},
this
.
defaultForm
);
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
listenGoBack
(
this
.
handleClose
);
listenGoBack
(
this
.
handleClose
);
},
},
edit
(
row
)
{
edit
(
row
)
{
this
.
formType
=
'modify'
this
.
dialogVisible
=
true
;
this
.
dialogVisible
=
true
;
this
.
form
=
Object
.
assign
({},
row
);
this
.
form
=
Object
.
assign
({},
row
);
...
@@ -288,7 +287,8 @@ export default {
...
@@ -288,7 +287,8 @@ export default {
createUser
(
createUserForm
)
{
createUser
(
createUserForm
)
{
this
.
$refs
[
createUserForm
].
validate
(
valid
=>
{
this
.
$refs
[
createUserForm
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
result
=
this
.
$post
(
this
.
createPath
,
this
.
form
,
()
=>
{
const
url
=
this
.
formType
==
'add'
?
this
.
createPat
:
this
.
updatePath
this
.
result
=
this
.
$post
(
url
,
this
.
form
,
()
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
));
this
.
$success
(
this
.
$t
(
'commons.save_success'
));
this
.
search
();
this
.
search
();
this
.
dialogVisible
=
false
;
this
.
dialogVisible
=
false
;
...
@@ -346,6 +346,7 @@ export default {
...
@@ -346,6 +346,7 @@ export default {
})
})
},
},
handleClose
()
{
handleClose
()
{
this
.
formType
=
'add'
this
.
form
=
{};
this
.
form
=
{};
removeGoBackListener
(
this
.
handleClose
);
removeGoBackListener
(
this
.
handleClose
);
this
.
editPasswordVisible
=
false
;
this
.
editPasswordVisible
=
false
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论