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
8e33932e
Commit
8e33932e
authored
May 13, 2021
by
mayongxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
访问根路径修改
parent
297ab520
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
206 additions
and
41 deletions
+206
-41
.env
.env
+1
-1
UserManage.js
src/pages/userCenter/userManage/UserManage.js
+160
-37
index.js
src/services/index.js
+1
-1
api.js
src/services/userCenter/userManage/api.js
+42
-0
index.js
src/utils/request/index.js
+2
-2
No files found.
.env
View file @
8e33932e
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY=/Cityinterface:http://192.168.19.105:8049;/P
ublish
:http://192.168.19.105:8049;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049
PROXY=/Cityinterface:http://192.168.19.105:8049;/P
andaCore
:http://192.168.19.105:8049;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/
...
...
src/pages/userCenter/userManage/UserManage.js
View file @
8e33932e
...
...
@@ -47,7 +47,21 @@ import {
setOrgArea
,
getOrgArea
,
GetMapSetByGroupID
,
GetOUTreeNew
GetOUTreeNew
,
GetUserRelationListNew
,
GetUserByKeyNew
,
AddUserNew
,
AddOUNew
,
EditOneOUInfoNew
,
EditUserNew
,
UserStateOUNew
,
DeleteOUNew
,
SetUserRelationListNew
,
JumpToAnotherOUNew
,
DeleteUserNew
,
}
from
'@/services/userCenter/userManage/api'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
classnames
from
'classnames'
;
...
...
@@ -573,16 +587,36 @@ const UserManage = () => {
}
// 查找用户
const
submitSearchUser
=
()
=>
{
getUserByKey
(
searchWord
)
// getUserByKey(searchWord)
// .then(res => {
// if (res.success) {
// setSelectedRowKeys([]); // 重置选中用户数
// setCurrentOrgOperate(true); // 禁止当前机构操作
// setMultiOperate(true); // 禁用批量操作
// setOrgTitle('全部机构搜索结果'); // 设置表头
// setCurrentSelectOrg('-1'); // 清空选中机构
// setTableData(res.root);
// setTableLength(res.root.length);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
GetUserByKeyNew
({
key
:
searchWord
})
.
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
code
==
0
)
{
setSelectedRowKeys
([]);
// 重置选中用户数
setCurrentOrgOperate
(
true
);
// 禁止当前机构操作
setMultiOperate
(
true
);
// 禁用批量操作
setOrgTitle
(
'全部机构搜索结果'
);
// 设置表头
setCurrentSelectOrg
(
'-1'
);
// 清空选中机构
setTableData
(
res
.
root
);
setTableLength
(
res
.
root
.
length
);
setTableData
(
res
.
data
);
setTableLength
(
res
.
data
.
length
);
}
else
{
notification
.
error
({
message
:
'提交失败'
,
...
...
@@ -599,11 +633,30 @@ const UserManage = () => {
// 根据当前 userID 获取用户关联角色
const
getRoleList
=
()
=>
{
setLoading
(
true
);
getUserRelationList
(
currentUser
.
userID
)
// getUserRelationList(currentUser.userID)
// .then(res => {
// setLoading(false);
// if (res.success) {
// const { roleList, stationList } = res;
// setRolelist(roleList);
// setStationlist(stationList);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setLoading(false);
// setTableLoading(false);
// message.error(err);
// });
GetUserRelationListNew
({
userID
:
currentUser
.
userID
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
success
)
{
const
{
roleList
,
stationList
}
=
res
;
if
(
res
.
code
==
0
)
{
const
{
roleList
,
stationList
}
=
res
.
data
;
setRolelist
(
roleList
);
setStationlist
(
stationList
);
}
else
{
...
...
@@ -622,11 +675,30 @@ const UserManage = () => {
// 获取全部未勾选的角色列表与站点列表
const
getEmptyRoleList
=
()
=>
{
setLoading
(
true
);
getUserRelationList
(
''
)
// getUserRelationList('')
// .then(res => {
// setLoading(false);
// if (res.roleList && res.roleList.length > 0) {
// const { roleList, stationList } = res;
// setRolelist(roleList);
// setStationlist(stationList);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setLoading(false);
// setTableLoading(false);
// message.error(err);
// });
GetUserRelationListNew
({
userID
:
""
})
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
roleList
&&
res
.
roleList
.
length
>
0
)
{
const
{
roleList
,
stationList
}
=
res
;
if
(
res
.
code
==
0
)
{
const
{
roleList
,
stationList
}
=
res
.
data
;
setRolelist
(
roleList
);
setStationlist
(
stationList
);
}
else
{
...
...
@@ -643,28 +715,54 @@ const UserManage = () => {
});
};
// 提交-更改机构
const
submitChangeOrg
=
()
=>
addToOrg
(
currentUser
.
userID
,
currentUser
.
OUID
,
newOrgID
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
setChangeOrgVisible
(
false
);
// 跳转到新组织机构下的用户表
onSelect
([
newOrgID
]);
// setExpandedKeys([`${newOrgID}`]);
notification
.
success
({
message
:
'提交成功'
,
duration
:
2
,
});
}
else
{
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
message
.
error
(
err
);
});
const
submitChangeOrg
=
()
=>
{
// addToOrg(currentUser.userID, currentUser.OUID, newOrgID)
// .then(res => {
// if (res.success) {
// setChangeOrgVisible(false);
// // 跳转到新组织机构下的用户表
// onSelect([newOrgID]);
// // setExpandedKeys([`${newOrgID}`]);
// notification.success({
// message: '提交成功',
// duration: 2,
// });
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
JumpToAnotherOUNew
({
userID
:
currentUser
.
userID
,
oldOUID
:
currentUser
.
OUID
,
newOUID
:
newOrgID
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setChangeOrgVisible
(
false
);
// 跳转到新组织机构下的用户表
onSelect
([
newOrgID
]);
// setExpandedKeys([`${newOrgID}`]);
notification
.
success
({
message
:
'提交成功'
,
duration
:
2
,
});
}
else
{
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
msg
,
});
}
})
.
catch
(
err
=>
{
message
.
error
(
err
);
});
}
// 提交-批量更改机构
const
submitChangeOrgs
=
()
=>
addToOrgs
(
userIDs
,
orgIDs
,
newOrgID
)
...
...
@@ -726,9 +824,34 @@ const UserManage = () => {
};
// 提交-删除用户
const
submitDeleteUser
=
()
=>
{
postDeleteUser
(
currentUser
.
userID
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
// postDeleteUser(currentUser.userID)
// .then(res => {
// if (res.success) {
// setDeleteUserVisible(false);
// notification.success({
// message: '提交成功',
// duration: 2,
// });
// // eslint-disable-next-line no-unused-expressions
// currentSelectOrg === '-1'
// ? submitSearchUser()
// : onSelect([currentSelectOrg]);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setTableLoading(false);
// message.error(err);
// });
DeleteUserNew
({
userID
:
`"
${
currentUser
.
userID
}
"`
,
ouID
:
`"
${
currentUser
.
OUID
}
"`
}).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
setDeleteUserVisible
(
false
);
notification
.
success
({
message
:
'提交成功'
,
...
...
@@ -741,7 +864,7 @@ const UserManage = () => {
}
else
{
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
m
essage
,
description
:
res
.
m
sg
,
});
}
})
...
...
src/services/index.js
View file @
8e33932e
...
...
@@ -2,7 +2,7 @@ import { request } from '../utils/request';
const
CITY_SERVICE
=
'/Cityinterface/rest/services'
;
// export const CITY_SERVICE = '/Publish/GateWay/CityServer';
const
PUBLISH_SERVICE
=
'/P
ublish
/OMS'
;
const
PUBLISH_SERVICE
=
'/P
andaCore
/OMS'
;
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
const
get
=
async
(
url
,
params
,
options
=
{})
=>
request
({
...
...
src/services/userCenter/userManage/api.js
View file @
8e33932e
...
...
@@ -178,3 +178,45 @@ export const GetMapSetByGroupID = params =>
get
(
`
${
PUBLISH_SERVICE
}
/GetMapSetByGroupID`
,
params
)
export
const
GetOUTreeNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetOUTree`
,
params
)
export
const
GetUserRelationListNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetUserRelationList`
,
params
)
export
const
GetUserByKeyNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetUserByKey`
,
params
)
export
const
AddUserNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/AddUser`
,
params
)
export
const
AddOUNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/AddOUNew`
,
params
)
export
const
EditOneOUInfoNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/EditOneOUInfo`
,
params
)
export
const
JumpToAnotherOUNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/JumpToAnotherOU`
,
params
)
export
const
EditUserNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/EditUser`
,
params
)
export
const
UserStateOUNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/UserStateOU`
,
params
)
export
const
DeleteUserNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/DeleteUser`
,
params
)
export
const
SetUserRelationListNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/SetUserRelationList`
,
params
)
export
const
DeleteOUNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/DeleteOU`
,
params
)
src/utils/request/index.js
View file @
8e33932e
...
...
@@ -30,12 +30,12 @@ axios.defaults.withCredentials = true
axios
.
interceptors
.
request
.
use
(
function
(
request
){
const
token
=
localStorage
.
getItem
(
'token'
)
const
pandaPublish
=
localStorage
.
getItem
(
'panda-publish'
)
const
getWay
=
'/P
ublish
/GateWay'
const
getWay
=
'/P
andaCore
/GateWay'
if
(
token
){
request
.
headers
.
Authorization
=
'Bearer '
+
token
}
if
(
pandaPublish
){
if
(
request
.
url
!=
'/P
ublish
/OMS/OMSLogin'
&&
request
.
url
!=
'/Publish/OMS/FileCenter/SaveMobileApk'
&&
request
.
url
!=
'/Publish/OMS/GateWayConfig'
)
if
(
request
.
url
!=
'/P
andaCore
/OMS/OMSLogin'
&&
request
.
url
!=
'/Publish/OMS/FileCenter/SaveMobileApk'
&&
request
.
url
!=
'/Publish/OMS/GateWayConfig'
)
request
.
url
=
getWay
+
request
.
url
}
return
request
...
...
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