Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
b86ffb0b
Commit
b86ffb0b
authored
Dec 15, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1215
parent
ed5c95b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
23 deletions
+24
-23
Permissiontree.jsx
src/components/PermissionTree/Permissiontree.jsx
+18
-18
index.jsx
src/pages/setting/role/index.jsx
+4
-4
columns.js
src/pages/system/field/columns.js
+1
-0
system.js
src/services/system.js
+1
-1
No files found.
src/components/PermissionTree/Permissiontree.jsx
View file @
b86ffb0b
...
...
@@ -5,9 +5,9 @@ import { doFetch } from '@/utils/doFetch';
import
{
useRequest
}
from
'ahooks'
;
const
TreeNode
=
Tree
.
TreeNode
;
const
initState
=
{
pc
Tree
:
[],
pcCheckedKeys
:
[],
pcHalfCheckedKeys
:
[],
pc
List
:
[],
havepremIdList
:
[],
haveParentIdList
:
[],
appTree
:
[],
appCheckedKeys
:
[],
appHalfCheckedKeys
:
[],
...
...
@@ -22,8 +22,8 @@ function reducer(state, action) {
case
'changePc'
:
newState
=
{
...
state
,
pcCheckedKeys
:
[...
action
.
checkedKeys
],
pcHalfCheckedKeys
:
[...
action
.
halfCheckedKeys
],
havepremIdList
:
[...
action
.
checkedKeys
],
haveParentIdList
:
[...
action
.
halfCheckedKeys
],
};
break
;
case
'changeApp'
:
...
...
@@ -43,9 +43,9 @@ function reducer(state, action) {
case
'reset'
:
newState
=
{
...
state
,
pc
Tree
:
[...
action
.
pcTree
],
pcCheckedKeys
:
[...
action
.
pcCheckedKeys
],
pcHalfCheckedKeys
:
[...
action
.
pcHalfCheckedKeys
],
pc
List
:
[...
action
.
pcList
],
havepremIdList
:
[...
action
.
havepremIdList
],
haveParentIdList
:
[...
action
.
haveParentIdList
],
// appTree: [...action.appTree],
// appCheckedKeys: [...action.appCheckedKeys],
// appHalfCheckedKeys: [...action.appHalfCheckedKeys]
...
...
@@ -68,9 +68,9 @@ const Permissiontree = (props) => {
const
{
id
,
close
,
treeType
}
=
props
,
[
state
,
dispatch
]
=
useReducer
(
reducer
,
initState
),
{
pc
Tree
,
pcCheckedKeys
,
pcHalfCheckedKeys
,
pc
List
,
havepremIdList
,
haveParentIdList
,
appTree
,
appCheckedKeys
,
appHalfCheckedKeys
,
...
...
@@ -104,7 +104,7 @@ const Permissiontree = (props) => {
manual
:
true
,
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
'0000'
)
{
message
.
success
(
'权限配置成功!'
)
message
.
success
(
'权限配置成功!'
)
;
close
();
}
},
...
...
@@ -122,8 +122,8 @@ const Permissiontree = (props) => {
roleTree
({
roleId
:
id
}).
then
((
res
)
=>
{
if
(
res
.
code
==
'0000'
)
{
let
data
=
res
?.
data
||
{};
const
{
pc
Tree
,
pcCheckedKeys
,
pcHalfCheckedKeys
}
=
data
;
dispatch
({
type
:
'reset'
,
pc
Tree
,
pcCheckedKeys
,
pcHalfCheckedKeys
});
const
{
pc
List
,
havepremIdList
,
haveParentIdList
}
=
data
;
dispatch
({
type
:
'reset'
,
pc
List
,
havepremIdList
,
haveParentIdList
});
}
});
}
else
{
...
...
@@ -138,10 +138,10 @@ const Permissiontree = (props) => {
}
const
saveData
=
()
=>
{
run
({
url
:
'/sysRolePermission/save'
,
url
:
'/
auth/
sysRolePermission/save'
,
params
:
{
roleId
:
id
,
permissionIds
:
[...
pcCheckedKeys
,
...
pcHalfCheckedKeys
],
permissionIds
:
[...
havepremIdList
,
...
haveParentIdList
],
},
});
};
...
...
@@ -156,10 +156,10 @@ const Permissiontree = (props) => {
<
Tree
checkable
defaultExpandAll=
{
false
}
checkedKeys=
{
pcCheckedKeys
}
checkedKeys=
{
havepremIdList
}
onCheck=
{
pcCheck
}
>
{
loop
(
pc
Tree
||
[])
}
{
loop
(
pc
List
||
[])
}
</
Tree
>
</
div
>
{
/* <div style={{ flex: 1, minHeight: 100 }}>
...
...
src/pages/setting/role/index.jsx
View file @
b86ffb0b
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-15
09:46:05
* @Last Modified time: 2022-12-15
13:52:19
*/
import
*
as
React
from
'react'
;
...
...
@@ -144,7 +144,7 @@ function Role(props) {
onFinish
:
async
(
vals
)
=>
{
//console.log(vals);
let
res
=
await
doFetch
({
url
:
'/auth/sysPermission/queryAll'
,
url
:
'/auth/sys
Role
Permission/queryAll'
,
params
:
{
...
vals
},
});
//console.log(res);
...
...
@@ -311,7 +311,7 @@ function Role(props) {
<
Drawer
title=
"角色权限"
onClose=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
authorityOpen
:
false
,
}));
...
...
@@ -321,7 +321,7 @@ function Role(props) {
<
PermissionTree
id=
{
drawer
?.
item
?.
id
}
close=
{
()
=>
{
set
d
rawer
((
s
)
=>
({
set
D
rawer
((
s
)
=>
({
...
s
,
authorityOpen
:
false
,
item
:
null
,
...
...
src/pages/system/field/columns.js
View file @
b86ffb0b
...
...
@@ -84,6 +84,7 @@ function getcolumns(setdrawer) {
{
title
:
'排序号'
,
dataIndex
:
'sort'
,
valueType
:
'digit'
,
formItemProps
:
{
rules
:
[
{
...
...
src/services/system.js
View file @
b86ffb0b
...
...
@@ -88,7 +88,7 @@ export async function sectionSelectByShops(params) {
}
//授权前查询权限树
export
async
function
roleTree
(
params
)
{
return
request
(
`/
ngic-
auth/sysRolePermission/queryAll`
,
{
return
request
(
`/
emspro/
auth/sysRolePermission/queryAll`
,
{
method
:
'POST'
,
data
:
params
,
});
...
...
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