Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
2ddc42bf
Commit
2ddc42bf
authored
Nov 10, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix org operation bugs
parent
e1f52db7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
UserManage.js
src/pages/userCenter/UserManage.js
+22
-6
No files found.
src/pages/userCenter/UserManage.js
View file @
2ddc42bf
...
...
@@ -45,6 +45,8 @@ import {
deleteUser
as
postDeleteUser
,
setUserState
as
postSetUserState
,
editUser
as
postEditUser
,
submitAddOrg
as
postAddOrg
,
deleteOrg
as
postDeleteOrg
,
updateUserPassword
,
setUserRelation
,
}
from
'@/services/userCenter/userManage/api'
;
...
...
@@ -256,8 +258,7 @@ const UserManage = () => {
};
};
// 获取用户机构树
useEffect
(()
=>
{
const
updateTrees
=
()
=>
getUserTree
(
-
1
,
-
1
)
.
then
(
res
=>
{
setTreeLoading
(
false
);
...
...
@@ -275,6 +276,10 @@ const UserManage = () => {
setTreeLoading
(
false
);
message
.
error
(
err
);
});
// 获取用户机构树
useEffect
(()
=>
{
updateTrees
();
},
[]);
// 获取当前机构下所有用户
...
...
@@ -350,11 +355,13 @@ const UserManage = () => {
setRoleVisible
(
true
);
setCurrentUser
(
record
);
};
const
changeOrg
=
record
=>
{
setChangeOrgVisible
(
true
);
setTreeData2
(
treeData1
);
setCurrentUser
(
record
);
};
const
changePassword
=
record
=>
{
setPasswordVisible
(
true
);
passwordForm
.
setFieldsValue
({
...
...
@@ -362,6 +369,7 @@ const UserManage = () => {
});
setCurrentUser
(
record
);
};
const
editUser
=
record
=>
{
// console.log(record);
setEditUserVisible
(
true
);
...
...
@@ -373,14 +381,17 @@ const UserManage = () => {
});
setCurrentUser
(
record
);
};
const
freezeUser
=
record
=>
{
setFreezeUserVisible
(
true
);
setCurrentUser
(
record
);
};
const
deleteUser
=
record
=>
{
setDeleteUserVisible
(
true
);
setCurrentUser
(
record
);
};
// 查找用户
const
submitSearchUser
=
()
=>
{
getUserByKey
(
searchUserForm
.
getFieldValue
(
'key'
))
...
...
@@ -400,6 +411,7 @@ const UserManage = () => {
message
.
error
(
err
);
});
};
// 提交-添加用户
const
submitAddUser
=
()
=>
{
postAddUser
({
...
...
@@ -429,9 +441,10 @@ const UserManage = () => {
message
.
error
(
err
);
});
};
// 提交-添加下级机构
const
submitAddOrg
=
()
=>
{
submi
tAddOrg
(
pos
tAddOrg
(
orgID
,
addOrgForm
.
getFieldValue
(
'OUName'
),
addOrgForm
.
getFieldValue
(
'desrciption'
)
||
''
,
...
...
@@ -444,7 +457,7 @@ const UserManage = () => {
message
:
'提交成功'
,
});
// 重新获取机构树与用户表
getUserTree
(
-
1
,
-
1
).
then
(()
=>
{
updateTrees
(
).
then
(()
=>
{
// 只能是字符串,数字没有选择效果
onSelect
([
`
${
res
.
OUID
}
`
]);
});
...
...
@@ -459,6 +472,7 @@ const UserManage = () => {
message
.
error
(
err
);
});
};
// 提交-编辑当前机构
const
submitEditOrg
=
()
=>
editOrgInfo
(
...
...
@@ -486,8 +500,10 @@ const UserManage = () => {
.
catch
(
err
=>
{
message
.
error
(
err
);
});
// 提交删除机构
const
submitDeleteOrg
=
()
=>
d
eleteOrg
(
orgID
)
postD
eleteOrg
(
orgID
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
setDeleteOrgVisible
(
false
);
...
...
@@ -495,7 +511,7 @@ const UserManage = () => {
message
:
'提交成功'
,
});
// 重新获取机构树与用户表
getUserTree
(
-
1
,
-
1
);
updateTrees
(
);
}
else
{
notification
.
error
({
message
:
'提交失败'
,
...
...
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