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
f9ace883
Commit
f9ace883
authored
Nov 13, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 菜单管理
parent
837f551e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
6 deletions
+159
-6
AppMenu.js
src/pages/appConfig/AppMenu.js
+143
-2
SevenParams.js
src/pages/appConfig/SevenParams.js
+1
-1
UserManage.js
src/pages/userCenter/UserManage.js
+15
-3
No files found.
src/pages/appConfig/AppMenu.js
View file @
f9ace883
...
...
@@ -31,7 +31,7 @@ import ListCardItem from '../orgnazation/listCardItem';
import
styles
from
'./AppMenu.less'
;
import
PicturesWall
from
'@/components/Upload/index'
;
const
SevenParams
=
()
=>
{
const
AppMenu
=
()
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 菜单树
...
...
@@ -47,6 +47,7 @@ const SevenParams = () => {
const
[
addMenuVisible
,
setAddMenuVisible
]
=
useState
(
false
);
const
[
addMenuGroupVisible
,
setAddMenuGroupVisible
]
=
useState
(
false
);
const
[
tipVisible
,
setTipVisible
]
=
useState
(
false
);
const
[
deleteMenuVisible
,
setDeleteMenuVisible
]
=
useState
(
false
);
const
[
addMenuForm
]
=
Form
.
useForm
();
...
...
@@ -534,8 +535,148 @@ const SevenParams = () => {
<
/div
>
<
div
className
=
{
styles
.
previewContainer
}
>
界面预览
<
/div
>
{
/* 必填项提示 */
}
<
Modal
title
=
"提示"
visible
=
{
tipVisible
}
onCancel
=
{()
=>
setTipVisible
(
false
)}
width
=
"300px"
styles
=
{{
zIndex
:
999999
}}
centered
footer
=
{[
<
Button
key
=
"back"
type
=
"primary"
onClick
=
{()
=>
setTipVisible
(
false
)}
>
关闭
<
/Button>
,
]}
>
<
p
>
标记
<
span
className
=
{
styles
.
redText
}
>*<
/span>的为必填
项
<
/p
>
<
/Modal
>
{
/* 添加菜单 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
addMenuVisible
}
onOk
=
{
submitAddMenu
}
onCancel
=
{()
=>
setAddMenuVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
Form
form
=
{
addMenuForm
}
labelCol
=
{{
span
:
4
}}
>
<
Form
.
Item
name
=
"menuName"
label
=
"菜单名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"shortName"
label
=
"菜单别名"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单别名"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"imageUrl"
label
=
"菜单图标"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"pageUrl"
label
=
"功能路径"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
<
Form
.
Item
name
=
"funParam"
label
=
"功能参数"
>
<
Input
placeholder
=
"请输入功能参数"
/>
<
/Form.Item
>
<
/Form
>
<
ListCardItem
itemid
=
"1"
key
=
"1"
userList
=
{
rolelist
}
OUName
=
"关联角色"
getValueCallback
=
{
getRoleValueCallback
}
/
>
<
/Modal
>
{
/* 添加菜单组 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
addMenuGroupVisible
}
onOk
=
{
submitAddMenuGroup
}
onCancel
=
{()
=>
setAddMenuGroupVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
Form
form
=
{
addMenuGroupForm
}
labelCol
=
{{
span
:
4
}}
>
<
Form
.
Item
name
=
"menuName"
label
=
"分组名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入分组名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"shortName"
label
=
"分组别名"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入分组别名"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"imageUrl"
label
=
{
menuLabel
}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
{
/* 添加菜单组,label名称为在线图标才有离线图标 */
}
{
menuLabel
===
'在线图标'
&&
(
<
Form
.
Item
name
=
"offlineImgUrl"
label
=
"离线图标"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入离线图标"
/>
<
/Form.Item
>
)}
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
<
Form
.
Item
name
=
"funParam"
label
=
"功能参数"
>
<
Input
placeholder
=
"请输入功能参数"
/>
<
/Form.Item
>
<
/Form
>
<
/Modal
>
{
/* 删除菜单 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
deleteMenuVisible
}
onOk
=
{
submitDeleteMenu
}
onCancel
=
{()
=>
setDeleteMenuVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
span
>
确定删除?
<
/span
>
<
/Modal
>
<
/div
>
);
};
export
default
SevenParams
;
export
default
AppMenu
;
src/pages/appConfig/SevenParams.js
View file @
f9ace883
...
...
@@ -208,7 +208,7 @@ const SevenParams = () => {
form
=
{
sevenForm
}
labelCol
=
{{
span
:
2
,
offset
:
2
}}
wrapperCol
=
{{
span
:
16
,
offset
:
1
}}
style
=
{{
height
:
'calc(100vh - 300px)'
}}
style
=
{{
height
:
'calc(100vh - 300px)'
,
overflow
:
'auto'
}}
onFinish
=
{
submitSevenParams
}
initialValues
=
{{
ellipseType
:
'1'
,
transType
:
'1'
}}
>
...
...
src/pages/userCenter/UserManage.js
View file @
f9ace883
...
...
@@ -78,7 +78,7 @@ const UserManage = () => {
const
[
deleteUserVisible
,
setDeleteUserVisible
]
=
useState
(
false
);
const
[
orgTitle
,
setOrgTitle
]
=
useState
(
'机构'
);
const
[
tableTitle
,
setTableTitle
]
=
useState
(
'
机构
'
);
const
[
tableTitle
,
setTableTitle
]
=
useState
(
'
0
'
);
const
[
orgID
,
setOrgID
]
=
useState
();
const
[
newOrgID
,
setNewOrgID
]
=
useState
();
const
[
currentUser
,
setCurrentUser
]
=
useState
({});
...
...
@@ -303,6 +303,12 @@ const UserManage = () => {
onSelect
([
res
[
0
].
id
]);
setTreeState
(
false
);
}
}
else
{
setTreeLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
...
...
@@ -328,9 +334,9 @@ const UserManage = () => {
setOrgID
(
props
[
0
]
||
currentSelectOrg
);
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
.
then
(
res
=>
{
if
(
res
.
IsSuccess
)
{
if
(
res
.
code
===
0
)
{
setTableLoading
(
false
);
const
temp
=
flatten
(
getUsers
(
res
.
D
ata
));
const
temp
=
flatten
(
getUsers
(
res
.
d
ata
));
console
.
log
(
temp
);
setTableTitle
(
temp
.
length
);
const
table
=
temp
.
map
((
item
,
index
)
=>
{
...
...
@@ -341,6 +347,12 @@ const UserManage = () => {
return
item
;
});
setTableData
(
table
);
}
else
{
setTreeLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
...
...
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