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
124932cc
Commit
124932cc
authored
Nov 12, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 冻结用户和app配置
parent
43cf21aa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
193 additions
and
27 deletions
+193
-27
AppMenu.js
src/pages/appConfig/AppMenu.js
+0
-0
AppMenu.less
src/pages/appConfig/AppMenu.less
+63
-0
index.js
src/pages/appConfig/index.js
+12
-11
UserManage.js
src/pages/userCenter/UserManage.js
+64
-13
api.js
src/services/appConfig/api.js
+43
-0
api.js
src/services/userCenter/userManage/api.js
+11
-3
No files found.
src/pages/appConfig/AppMenu.js
View file @
124932cc
This diff is collapsed.
Click to expand it.
src/pages/appConfig/AppMenu.less
0 → 100644
View file @
124932cc
.contentContainer{
// min-height: calc(100vh - 194px);
display: flex;
.menuContainer{
min-width: 300px;
.ant-tree-list{
padding: 10px;
border:1px solid #abaeb1;
height:calc(100vh - 300px);
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
}
}
}
.previewContainer{
margin-left: 12px;
flex: 1;
float: left;
// background: white;
.ant-table-pagination-right{
padding-right: 12px;
}
}
.ant-tree-treenode{
width: 100% !important;
.ant-tree-node-content-wrapper{
display: inline-block;
width: 100%;
}
.iconWraper1{
float: right;
span{
display: none;
}
}
}
.ant-tree-treenode:hover{
.iconWraper1>span{
margin-left: 12px;
font-size: 18px;
display: inline-block;
}
}
}
.redText{
color: red;
cursor: pointer;
}
// .ant-modal-root{
// .ant-tree-switcher{
// line-height: 1;
// color:#1890FF;
// }
// }
// .menuContainer{
// width: 300px;
// padding: 10px;
// background: #1890FF;
// }
\ No newline at end of file
src/pages/appConfig/index.js
View file @
124932cc
import
React
from
'react'
;
import
{
Tabs
}
from
'antd'
;
import
{
Tabs
,
Card
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
SevenParams
from
'./SevenParams'
;
//
import AppMenu from './AppMenu';
import
AppMenu
from
'./AppMenu'
;
const
AppConfigPage
=
()
=>
{
const
{
TabPane
}
=
Tabs
;
return
(
<
PageContainer
>
<
Tabs
defaultActiveKey
=
"1"
>
<
TabPane
tab
=
"七参数"
key
=
"1"
>
<
SevenParams
/>
<
/TabPane
>
<
TabPane
tab
=
"菜单管理"
key
=
"2"
>
{
/* <AppMenu /> */
}
123
<
/TabPane
>
<
/Tabs
>
<
Card
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
TabPane
tab
=
"应用配置"
key
=
"1"
>
<
SevenParams
/>
<
/TabPane
>
<
TabPane
tab
=
"菜单管理"
key
=
"2"
type
=
"card"
>
<
AppMenu
/>
<
/TabPane
>
<
/Tabs
>
<
/Card
>
<
/PageContainer
>
);
};
...
...
src/pages/userCenter/UserManage.js
View file @
124932cc
...
...
@@ -76,6 +76,7 @@ const UserManage = () => {
const
[
deleteUserVisible
,
setDeleteUserVisible
]
=
useState
(
false
);
const
[
orgTitle
,
setOrgTitle
]
=
useState
(
'机构'
);
const
[
tableTitle
,
setTableTitle
]
=
useState
(
'机构'
);
const
[
orgID
,
setOrgID
]
=
useState
();
const
[
newOrgID
,
setNewOrgID
]
=
useState
();
const
[
currentUser
,
setCurrentUser
]
=
useState
({});
...
...
@@ -118,6 +119,12 @@ const UserManage = () => {
key
:
'userName'
,
width
:
100
,
},
{
title
:
'所在机构'
,
dataIndex
:
'OUName'
,
key
:
'OUName'
,
width
:
150
,
},
{
title
:
'手机号码'
,
dataIndex
:
'phone'
,
...
...
@@ -141,7 +148,7 @@ const UserManage = () => {
title
:
'操作'
,
key
:
'action'
,
fixed
:
'right'
,
width
:
30
0
,
width
:
25
0
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<
Space
size
=
"middle"
>
...
...
@@ -169,12 +176,27 @@ const UserManage = () => {
style
=
{{
fontSize
:
'16px'
}}
/
>
<
/Tooltip
>
<
Tooltip
title
=
"冻结用户"
>
<
StopOutlined
onClick
=
{()
=>
freezeUser
(
record
)}
style
=
{{
fontSize
:
'16px'
,
color
:
'#1890FF'
}}
/
>
<
/Tooltip
>
{(
record
.
state
===
'0'
||
record
.
state
===
null
)
&&
(
<>
<
Tooltip
title
=
"冻结用户"
>
<
StopOutlined
onClick
=
{()
=>
freezeUser
(
record
)}
style
=
{{
fontSize
:
'16px'
,
color
:
'#1890FF'
}}
/
>
<
/Tooltip
>
<
/
>
)}
{
record
.
state
===
'1'
&&
(
<>
<
Tooltip
title
=
"解冻用户"
>
<
StopOutlined
onClick
=
{()
=>
freezeUser
(
record
)}
style
=
{{
fontSize
:
'16px'
}}
/
>
<
/Tooltip
>
<
/
>
)}
<
Tooltip
title
=
"删除用户"
>
<
DeleteTwoTone
onClick
=
{()
=>
deleteUser
(
record
)}
...
...
@@ -289,6 +311,7 @@ const UserManage = () => {
// 获取用户机构树
useEffect
(()
=>
{
setTreeLoading
(
true
);
updateTrees
();
},
[]);
...
...
@@ -303,9 +326,12 @@ const UserManage = () => {
setOrgID
(
props
[
0
]
||
currentSelectOrg
);
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
.
then
(
res
=>
{
if
(
res
.
s
uccess
)
{
if
(
res
.
IsS
uccess
)
{
setTableLoading
(
false
);
const
table
=
res
.
root
.
map
((
item
,
index
)
=>
{
const
temp
=
flatten
(
getUsers
(
res
.
Data
));
console
.
log
(
temp
);
setTableTitle
(
temp
.
length
);
const
table
=
temp
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
phone
=
item
.
phone
||
'-'
;
item
.
ddid
=
item
.
ddid
?
'已绑定'
:
'未绑定'
;
...
...
@@ -320,7 +346,25 @@ const UserManage = () => {
message
.
error
(
err
);
});
};
// 返回数据结构处理,扁平化
const
getUsers
=
orgObj
=>
{
let
result
=
orgObj
.
Users
;
result
.
map
(
item
=>
{
item
.
OUID
=
orgObj
.
GroupId
;
item
.
OUName
=
orgObj
.
GroupName
;
return
item
;
});
if
(
orgObj
.
Childs
.
length
>
0
)
result
=
[...
result
,
...
orgObj
.
Childs
.
map
(
o
=>
getUsers
(
o
))];
return
result
;
};
const
flatten
=
arr
=>
{
while
(
arr
.
some
(
item
=>
Array
.
isArray
(
item
)))
{
arr
=
[].
concat
(...
arr
);
}
return
arr
;
};
const
getTableTitle
=
()
=>
`当前机构用户总数(
${
tableTitle
}
)`
;
// 左侧目录树相关操作
const
searchUser
=
()
=>
{
setSearchUserVisible
(
true
);
...
...
@@ -586,7 +630,7 @@ const UserManage = () => {
});
};
const
submitChangeOrg
=
()
=>
addToOrg
(
currentUser
.
userID
,
org
ID
,
newOrgID
)
addToOrg
(
currentUser
.
userID
,
currentUser
.
OU
ID
,
newOrgID
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
setChangeOrgVisible
(
false
);
...
...
@@ -658,7 +702,13 @@ const UserManage = () => {
message
.
error
(
err
);
});
const
submitFreezeUser
=
()
=>
{
postSetUserState
(
currentUser
.
userID
,
+!
currentUser
.
state
)
let
state
=
''
;
if
(
currentUser
.
state
===
'0'
)
{
state
=
'1'
;
}
else
{
state
=
'0'
;
}
postSetUserState
(
currentUser
.
userID
,
state
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
setFreezeUserVisible
(
false
);
...
...
@@ -746,6 +796,7 @@ const UserManage = () => {
<
/div
>
<
div
className
=
{
styles
.
userContainer
}
>
<
Table
title
=
{
getTableTitle
}
bordered
columns
=
{
columns
}
dataSource
=
{
tableData
}
...
...
@@ -1008,7 +1059,7 @@ const UserManage = () => {
<
/Form
>
<
/Modal
>
<
Modal
title
=
"请确认
冻结用户
"
title
=
"请确认"
visible
=
{
freezeUserVisible
}
onOk
=
{
submitFreezeUser
}
onCancel
=
{()
=>
setFreezeUserVisible
(
false
)}
...
...
src/services/appConfig/api.js
View file @
124932cc
import
{
get
,
post
}
from
'@/services/index'
;
/** ***网站配置*** */
// 七参数初始化
export
const
getSevenParams
=
()
=>
get
(
`/Cityinterface/rest/services/OMS.svc/M_GetSevenParams`
,
{
...
...
@@ -19,3 +20,45 @@ export const postSevenParams = sevenFormData =>
`/Cityinterface/rest/services/OMS.svc/M_SetSevenParams?_version=9999`
,
sevenFormData
,
);
/** ***菜单管理*** */
// 获取菜单树
export
const
getTree
=
()
=>
get
(
`/Cityinterface/rest/services/OMS.svc/MiniAppSiteTree`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
node
:
-
2
,
userMode
:
'super'
,
// subSystemValue: '手持系统',
// subSystemName: '手持系统',
select
:
''
,
});
// 添加菜单
export
const
addMenuApi
=
(
menuID
,
menuName
,
shortName
,
imageUrl
,
pageUrl
,
funParam
,
)
=>
get
(
`/Cityinterface/rest/services/OMS.svc/MiniApp_AddMenu`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
parentID
:
menuID
,
menuName
,
shortName
,
imageUrl
,
pageUrl
,
funParam
,
subSystemValue
:
'miniapp'
,
relatedRoleList
:
''
,
});
// 添加菜单
export
const
getRoleList
=
()
=>
get
(
`/Cityinterface/rest/services/OMS.svc/P_GetRoleListPlain`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
subSystemValue
:
'miniapp'
,
});
src/services/userCenter/userManage/api.js
View file @
124932cc
import
{
get
,
post
}
from
'@/services/index'
;
//
import { get, post } from '@/services/index';
import
qs
from
'qs'
;
import
{
CITY_SERVICE
,
get
,
post
,
PUBLISH_SERVICE
}
from
'@/services/index'
;
export
const
getUserTree
=
(
selectOU
,
node
)
=>
get
(
`/Cityinterface/rest/services/OMS.svc/U_GetOUTree`
,
{
...
...
@@ -9,11 +10,18 @@ export const getUserTree = (selectOU, node) =>
node
,
});
// export const getOneOUUserListNew = OUID =>
// get(`/Cityinterface/rest/services/OMS.svc/U_GetOneOUUserListNew`, {
// _version: 9999,
// _dc: new Date().getTime(),
// OUID,
// });
export
const
getOneOUUserListNew
=
OUID
=>
get
(
`
/Cityinterface/rest/services/OMS.svc/U_GetOneOUUserListNew
`
,
{
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GroupUserList
`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
OUID
,
GroupId
:
OUID
,
});
/**
...
...
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