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
c386d214
Commit
c386d214
authored
Aug 25, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '角色管理限制内置角色权限'
parent
87b9cd2f
Pipeline
#78042
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
71 deletions
+89
-71
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+89
-71
No files found.
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
c386d214
...
...
@@ -31,6 +31,7 @@ import {
UserAddOutlined
,
WindowsOutlined
,
IeOutlined
,
InfoCircleOutlined
,
}
from
'@ant-design/icons'
;
import
{
setMenuToRole
,
...
...
@@ -101,19 +102,18 @@ const SiteManage = () => {
const
{
node
}
=
treenode
;
const
{
roleID
:
id
}
=
node
;
console
.
log
(
node
);
debugger
;
setItemObj
(
node
);
if
(
node
.
BuiltInRole
)
{
setKeyValue
(
'0'
);
}
setUserNewVisible
(
true
);
console
.
log
(
id
);
if
(
id
)
{
setSaveTreeId
(
id
);
if
(
node
.
BuiltInRole
===
true
&&
keyValue
==
1
)
{
setRoleID
(
''
);
setDescrip
(
'内置角色不可配置菜单权限'
);
setFlagSearch
(
0
);
}
else
{
setRoleID
(
id
);
setFlagSearch
(
1
);
}
setRoleID
(
id
);
setFlagSearch
(
1
);
setValueList
([...
valueList
]);
console
.
log
([...
valueList
]);
}
else
{
...
...
@@ -284,7 +284,7 @@ const SiteManage = () => {
{
afterStr
}
</
div
>
)
:
(
<
div
className=
{
styles
.
titleTop
}
>
{
i
.
title
}
</
div
>
<
div
className=
{
styles
.
titleTop
}
>
{
i
.
title
}
12
</
div
>
)
}
<
div
className=
{
styles
.
tip
}
>
{
i
.
roleID
&&
(
...
...
@@ -295,12 +295,15 @@ const SiteManage = () => {
onClick=
{
e
=>
editorUser
(
e
,
i
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
i
)
}
/>
</
Tooltip
>
{
!
i
.
BuiltInRole
&&
(
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
i
)
}
/>
</
Tooltip
>
)
}
{
/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
...
...
@@ -369,7 +372,16 @@ const SiteManage = () => {
{
afterStr
}
</
div
>
)
:
(
<
div
className=
{
styles
.
titleTop
}
>
{
itemRole
.
title
}
</
div
>
<
div
className=
{
styles
.
titleTop
}
>
{
itemRole
.
title
}
{
itemRole
.
description
&&
(
<
Tooltip
title=
{
itemRole
.
description
}
>
<
InfoCircleOutlined
style=
{
{
color
:
'rgb(24, 144, 255)'
,
marginLeft
:
'5px'
,
marginTop
:
'3px'
}
}
/>
</
Tooltip
>
)
}
</
div
>
)
}
<
div
className=
{
styles
.
tip
}
>
{
itemRole
.
roleID
&&
(
...
...
@@ -380,12 +392,15 @@ const SiteManage = () => {
onClick=
{
e
=>
editorUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
{
!
itemRole
.
BuiltInRole
&&
(
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
)
}
{
/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
...
...
@@ -429,12 +444,15 @@ const SiteManage = () => {
onClick=
{
e
=>
editorUser
(
e
,
item
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
item
)
}
/>
</
Tooltip
>
{
!
item
.
BuiltInRole
&&
(
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
,
marginTop
:
'5px'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
item
)
}
/>
</
Tooltip
>
)
}
{
/* <Tooltip title="关联用户" className={styles.fs}>
<UserAddOutlined
style={{ fontSize: '16px', color: '#1890FF', marginTop: '5px' }}
...
...
@@ -528,14 +546,8 @@ const SiteManage = () => {
setItemObj
(
aa
);
if
(
itemObj
.
roleID
===
currentSelectId
[
0
])
{
if
(
prop
==
true
)
{
if
(
keyValue
==
0
)
{
setRoleID
(
currentSelectId
);
setFlagSearch
(
1
);
}
else
{
setRoleID
(
''
);
setDescrip
(
'内置角色不可配置菜单权限'
);
setFlagSearch
(
0
);
}
setRoleID
(
currentSelectId
);
setFlagSearch
(
1
);
}
else
{
setRoleID
(
currentSelectId
);
setFlagSearch
(
1
);
...
...
@@ -752,14 +764,8 @@ const SiteManage = () => {
setKeyValue
(
key
);
const
{
roleID
:
id
}
=
itemObj
;
if
(
id
)
{
if
(
itemObj
.
BuiltInRole
===
true
&&
key
==
1
)
{
setRoleID
(
''
);
setDescrip
(
'内置角色不可配置菜单权限'
);
setFlagSearch
(
0
);
}
else
{
setRoleID
(
id
);
setFlagSearch
(
1
);
}
setRoleID
(
id
);
setFlagSearch
(
1
);
}
else
{
setRoleID
(
''
);
setDescrip
(
'当前未选中角色'
);
...
...
@@ -954,39 +960,51 @@ const SiteManage = () => {
</
div
>
)
}
</
TabPane
>
<
TabPane
tab=
"菜单权限"
key=
"1"
>
{
flagSearch
==
1
?
(
<
Search
style=
{
{
width
:
260
}
}
allowClear
value=
{
searchWord
}
placeholder=
{
placeholder
}
// onSearch=
{
handleSearch
}
onChange=
{
handleChange
}
enterButton
/>
)
:
(
<
span
/>
)
}
{
roleID
?
(
<
div
className=
{
styles
.
cardBoxR
}
>
<
ListCard
roleID=
{
roleID
}
loading=
{
loading
}
checkList=
{
valueList
}
dataList=
{
dataList
}
searchWord=
{
searchWord
}
onCommit=
{
handleCommit
}
btnLoading=
{
btnLoading
}
hasData=
{
hasData
}
{
!
itemObj
.
BuiltInRole
&&
(
<
TabPane
tab=
"菜单权限"
key=
"1"
>
{
flagSearch
==
1
?
(
<
Search
style=
{
{
width
:
260
}
}
allowClear
value=
{
searchWord
}
placeholder=
{
placeholder
}
// onSearch=
{
handleSearch
}
onChange=
{
handleChange
}
enterButton
/>
</
div
>
)
:
(
<
span
/>
)
}
{
roleID
?
(
<
div
className=
{
styles
.
cardBoxR
}
>
<
ListCard
roleID=
{
roleID
}
loading=
{
loading
}
checkList=
{
valueList
}
dataList=
{
dataList
}
searchWord=
{
searchWord
}
onCommit=
{
handleCommit
}
btnLoading=
{
btnLoading
}
hasData=
{
hasData
}
/>
</
div
>
)
:
(
<
div
className=
{
styles
.
cardBoxH
}
>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
{
descrip
}
/>
</
div
>
)
}
</
TabPane
>
)
}
{
/* <TabPane tab="菜单权限优化" key="2">
{roleID ? (
<div className={styles.cardBoxR} />
) : (
<div className={styles.cardBoxH}>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
</div>
)}
</
TabPane
>
</TabPane>
*/
}
</
Tabs
>
</
Card
>
</
div
>
...
...
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