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
d73ede3b
Commit
d73ede3b
authored
May 13, 2024
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '搭建平台操作权限接口修改'
parent
0f9e7ea2
Pipeline
#88446
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
24 deletions
+127
-24
OpePermissions.jsx
...pages/userCenter/roleManage/SelectUser/OpePermissions.jsx
+116
-21
SelectUser.less
src/pages/userCenter/roleManage/SelectUser/SelectUser.less
+1
-1
api.js
src/services/RoleManage/api.js
+10
-2
No files found.
src/pages/userCenter/roleManage/SelectUser/OpePermissions.jsx
View file @
d73ede3b
...
@@ -11,8 +11,15 @@ import {
...
@@ -11,8 +11,15 @@ import {
Space
,
Space
,
Checkbox
,
Checkbox
,
notification
,
notification
,
Radio
,
Popconfirm
,
}
from
'antd'
;
}
from
'antd'
;
import
{
getRolePermission
,
updateRolePermission
}
from
'@/services/RoleManage/api'
;
import
{
getRolePermission
,
updateRolePermission
,
getRolePermissionTable
,
updateRolePermissionTable
,
}
from
'@/services/RoleManage/api'
;
import
styles
from
'./SelectUser.less'
;
import
styles
from
'./SelectUser.less'
;
const
CheckboxGroup
=
Checkbox
.
Group
;
const
CheckboxGroup
=
Checkbox
.
Group
;
...
@@ -24,6 +31,7 @@ const OpePermissions = props => {
...
@@ -24,6 +31,7 @@ const OpePermissions = props => {
const
[
option
,
setOption
]
=
useState
([]);
const
[
option
,
setOption
]
=
useState
([]);
const
[
groupList
,
setGroupList
]
=
useState
([]);
const
[
groupList
,
setGroupList
]
=
useState
([]);
const
[
keepGroupList
,
setKeepGroupList
]
=
useState
([]);
const
[
keepGroupList
,
setKeepGroupList
]
=
useState
([]);
const
[
value4
,
setValue4
]
=
useState
(
'BI'
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getInitialData
();
getInitialData
();
...
@@ -51,9 +59,30 @@ const OpePermissions = props => {
...
@@ -51,9 +59,30 @@ const OpePermissions = props => {
});
});
};
};
const
getTableData
=
()
=>
{
setLoading
(
true
);
getRolePermissionTable
({
roleId
:
roleID
})
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setLoading
(
false
);
setOption
(
res
.
data
.
dicPermissions
);
setGroupList
(
res
.
data
.
projectPermission
);
setKeepGroupList
(
res
.
data
.
projectPermission
);
getAllData
(
res
.
data
.
projectPermission
);
}
else
{
setOption
([]);
setGroupList
([]);
getAllData
({});
}
})
.
catch
(
err
=>
{
setLoading
(
false
);
});
};
const
getAllData
=
val
=>
{
const
getAllData
=
val
=>
{
let
obj
=
{
预览
:
[],
编辑
:
[],
发布
:
[],
删除
:
[],
导出
:
[]
};
let
obj
=
{
预览
:
[],
编辑
:
[],
发布
:
[],
删除
:
[],
导出
:
[]
};
val
.
map
(
i
=>
{
val
?
.
map
(
i
=>
{
if
(
i
.
permission
.
indexOf
(
'预览'
)
!==
-
1
)
{
if
(
i
.
permission
.
indexOf
(
'预览'
)
!==
-
1
)
{
obj
.
预览
=
[...
obj
.
预览
,
i
.
projectName
];
obj
.
预览
=
[...
obj
.
预览
,
i
.
projectName
];
}
}
...
@@ -172,32 +201,82 @@ const OpePermissions = props => {
...
@@ -172,32 +201,82 @@ const OpePermissions = props => {
permission
:
item
.
permission
.
toString
(),
permission
:
item
.
permission
.
toString
(),
});
});
});
});
updateRolePermission
({
roleId
:
roleID
,
permissons
:
arr
}).
then
(
res
=>
{
if
(
value4
===
'BI'
)
{
if
(
res
.
code
===
0
)
{
updateRolePermission
({
roleId
:
roleID
,
permissons
:
arr
}).
then
(
res
=>
{
notification
.
success
({
if
(
res
.
code
===
0
)
{
message
:
'提示'
,
notification
.
success
({
duration
:
3
,
message
:
'提示'
,
description
:
'设置成功'
,
duration
:
3
,
});
description
:
'设置成功'
,
getInitialData
();
});
}
else
{
getInitialData
();
notification
.
error
({
}
else
{
message
:
'提示'
,
notification
.
error
({
duration
:
3
,
message
:
'提示'
,
description
:
res
.
msg
,
duration
:
3
,
});
description
:
res
.
msg
,
}
});
});
}
});
}
else
{
updateRolePermissionTable
({
roleId
:
roleID
,
permissons
:
arr
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'设置成功'
,
});
getTableData
();
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
});
}
}
else
{
}
else
{
message
.
warning
(
'请更改后再保存!'
);
message
.
warning
(
'请更改后再保存!'
);
}
}
};
};
const
optionsWithDisabled
=
[
{
label
:
'BI操作权限'
,
value
:
'BI'
,
},
{
label
:
'报表操作权限'
,
value
:
'Table'
,
},
];
const
onChange4
=
({
target
:
{
value
}
})
=>
{
setGroupList
([]);
setKeepGroupList
([]);
setCheckAll
({});
if
(
value
===
'BI'
)
{
getInitialData
();
}
else
{
getTableData
();
}
setValue4
(
value
);
};
return
(
return
(
<>
<>
{
/* 头部搜索框 */
}
{
/* 头部搜索框 */
}
<
div
className=
{
styles
.
header
}
>
<
div
className=
{
styles
.
header
}
>
<
div
>
<
div
>
<
Radio
.
Group
options=
{
optionsWithDisabled
}
onChange=
{
onChange4
}
value=
{
value4
}
optionType=
"button"
buttonStyle=
"solid"
style=
{
{
marginRight
:
'20px'
}
}
/>
<
Checkbox
<
Checkbox
style=
{
{
marginRight
:
'20px'
}
}
style=
{
{
marginRight
:
'20px'
}
}
checked=
{
checkAll
?.
全选
}
checked=
{
checkAll
?.
全选
}
...
@@ -236,9 +315,25 @@ const OpePermissions = props => {
...
@@ -236,9 +315,25 @@ const OpePermissions = props => {
导出全选
导出全选
</
Checkbox
>
</
Checkbox
>
</
div
>
</
div
>
<
Button
onClick=
{
onFinish
}
type=
"primary"
htmlType=
"submit"
>
<
Popconfirm
提交
placement=
"bottomRight"
</
Button
>
title=
{
<
p
>
确定修改
<
span
style=
{
{
color
:
'#1685FF'
}
}
>
{
value4
===
'BI'
?
'BI'
:
'报表'
}
</
span
>
操作权限吗?
</
p
>
}
okText=
"确认"
cancelText=
"取消"
onConfirm=
{
()
=>
{
onFinish
();
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
提交
</
Button
>
</
Popconfirm
>
</
div
>
</
div
>
<
div
className=
{
styles
.
pushTestContent
}
>
<
div
className=
{
styles
.
pushTestContent
}
>
<
div
className=
{
styles
.
leftContent
}
>
<
div
className=
{
styles
.
leftContent
}
>
...
...
src/pages/userCenter/roleManage/SelectUser/SelectUser.less
View file @
d73ede3b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
display: flex;
display: flex;
justify-content: space-between;
justify-content: space-between;
align-items: center;
align-items: center;
padding: 0
20px
;
padding: 0;
}
}
.pushTestContent {
.pushTestContent {
.ant-table-body {
.ant-table-body {
...
...
src/services/RoleManage/api.js
View file @
d73ede3b
...
@@ -58,10 +58,18 @@ export const getWebConfigTypes = params =>
...
@@ -58,10 +58,18 @@ export const getWebConfigTypes = params =>
// 菜单拖拽
// 菜单拖拽
export
const
DragGroup
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/UserCenter/DragGroup`
,
params
);
export
const
DragGroup
=
params
=>
post
(
`
${
PUBLISH_SERVICE
}
/UserCenter/DragGroup`
,
params
);
// 获取角色拥有的工程权限
// 获取
BI
角色拥有的工程权限
export
const
getRolePermission
=
params
=>
export
const
getRolePermission
=
params
=>
get
(
`/PandaView/publish/RolePermission/GetRolePermission`
,
params
);
get
(
`/PandaView/publish/RolePermission/GetRolePermission`
,
params
);
// 更新角色工程权限
// 更新
BI
角色工程权限
export
const
updateRolePermission
=
params
=>
export
const
updateRolePermission
=
params
=>
post
(
`/PandaView/publish/RolePermission/UpdateRolePermission`
,
params
);
post
(
`/PandaView/publish/RolePermission/UpdateRolePermission`
,
params
);
// 获取报表角色拥有的工程权限
export
const
getRolePermissionTable
=
params
=>
get
(
`/PandaView/publish/ReportRolePermission/GetRolePermission`
,
params
);
// 更新报表角色工程权限
export
const
updateRolePermissionTable
=
params
=>
post
(
`/PandaView/publish/ReportRolePermission/UpdateRolePermission`
,
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