Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
陈智峰
jinfa-admin
Commits
ab5e1594
Commit
ab5e1594
authored
Dec 08, 2022
by
前端-陈智峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 权限问题
parent
26cb711e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
detail.tsx
...ystemManage/ruleSettingManage/memberAuthManage/detail.tsx
+11
-7
No files found.
src/pages/systemManage/ruleSettingManage/memberAuthManage/detail.tsx
View file @
ab5e1594
...
@@ -38,7 +38,7 @@ const SetMemberAuth: React.FC<{}> = () => {
...
@@ -38,7 +38,7 @@ const SetMemberAuth: React.FC<{}> = () => {
// 编辑和预览模式下需回显数据
// 编辑和预览模式下需回显数据
const
fetchRoleDetail
=
async
()
=>
{
const
fetchRoleDetail
=
async
()
=>
{
// 10秒缓存
// 10秒缓存
const
res
=
await
getMemberPlatformRoleAuthTree
({
roleId
:
id
,
source
}
,
{
useCache
:
true
,
ttl
:
10
*
1000
}
)
const
res
=
await
getMemberPlatformRoleAuthTree
({
roleId
:
id
,
source
})
setCheckedIds
(()
=>
[...
res
[
'data'
][
'checkIds'
]])
setCheckedIds
(()
=>
[...
res
[
'data'
][
'checkIds'
]])
return
res
return
res
}
}
...
@@ -78,13 +78,22 @@ const SetMemberAuth: React.FC<{}> = () => {
...
@@ -78,13 +78,22 @@ const SetMemberAuth: React.FC<{}> = () => {
source
,
source
,
fetchItemDetailData
,
fetchItemDetailData
,
})
})
const
resset
=
()
=>
{
setFormValue
(
null
)
setButtonInfos
([])
setCheckedIds
([])
setDataExpand
([])
setDataSource
([])
}
useEffect
(()
=>
{
useEffect
(()
=>
{
resset
()
if
(
!
id
)
return
;
if
(
!
id
)
return
;
fetchRoleDetail
().
then
(
res
=>
{
fetchRoleDetail
().
then
(
res
=>
{
const
{
data
}
=
res
const
{
data
}
=
res
setFormValue
(
data
)
setFormValue
(
data
)
})
})
},
[])
},
[
source
])
//fix: 按钮权限不显示问题
//fix: 按钮权限不显示问题
const
formInitValue
=
nodeRecord
?
getTreeMaps
(
nodeRecord
.
key
)
:
null
const
formInitValue
=
nodeRecord
?
getTreeMaps
(
nodeRecord
.
key
)
:
null
...
@@ -219,8 +228,6 @@ const SetMemberAuth: React.FC<{}> = () => {
...
@@ -219,8 +228,6 @@ const SetMemberAuth: React.FC<{}> = () => {
// 菜单是否全选
// 菜单是否全选
const
isAllCheckedMenu
=
(
treeKeys
.
length
===
allTreeDataRef
.
current
?.
length
)
&&
(
treeKeys
.
length
!==
checkedIds
.
length
)
const
isAllCheckedMenu
=
(
treeKeys
.
length
===
allTreeDataRef
.
current
?.
length
)
&&
(
treeKeys
.
length
!==
checkedIds
.
length
)
console
.
log
(
currentAuthBtnKeys
,
nodeRecord
,
formInitValue
,
allTreeDataRef
.
current
,
treeKeys
)
// 展开数据与权限变动数据 整合
// 展开数据与权限变动数据 整合
const
ids
=
_expand
.
map
(
item
=>
item
[
'menuId'
])
const
ids
=
_expand
.
map
(
item
=>
item
[
'menuId'
])
const
params
=
_source
.
filter
(
item
=>
item
.
changed
).
map
(
item
=>
{
const
params
=
_source
.
filter
(
item
=>
item
.
changed
).
map
(
item
=>
{
...
@@ -261,9 +268,6 @@ const SetMemberAuth: React.FC<{}> = () => {
...
@@ -261,9 +268,6 @@ const SetMemberAuth: React.FC<{}> = () => {
// 更新角色权限
// 更新角色权限
await
postMemberPlatformRoleAuthUpdate
(
args
)
await
postMemberPlatformRoleAuthUpdate
(
args
)
console
.
log
(
dataExpand
,
dataSource
,
params
,
'params'
,
args
)
setLoading
(
false
)
setLoading
(
false
)
}
}
...
...
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