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
b768069c
Commit
b768069c
authored
Nov 25, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: perf
parent
4fa7c8e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
248 additions
and
38 deletions
+248
-38
SiteConfig.jsx
src/pages/mobileConfig/SiteConfig.jsx
+2
-2
AddForm.jsx
src/pages/mobileConfig/menuconfig/AddForm.jsx
+110
-15
editForm.jsx
src/pages/mobileConfig/menuconfig/editForm.jsx
+109
-13
miniMenu.jsx
src/pages/mobileConfig/menuconfig/miniMenu.jsx
+19
-7
miniMenu.less
src/pages/mobileConfig/menuconfig/miniMenu.less
+8
-1
No files found.
src/pages/mobileConfig/SiteConfig.jsx
View file @
b768069c
...
...
@@ -103,7 +103,7 @@ const SiteConfig = props => {
>
<
Input
placeholder=
"请输入应用名称"
allowClear
/>
</
Item
>
<
Item
{
/*
<Item
label="系统图标:"
name="shortcutIcon"
rules={[
...
...
@@ -114,7 +114,7 @@ const SiteConfig = props => {
]}
>
<Input placeholder="请输入系统图标名称" allowClear />
</
Item
>
</Item>
*/
}
<
Item
label=
"系统图标预览:"
name=
"shortcutIcon"
>
<
PicturesWall
/>
</
Item
>
...
...
src/pages/mobileConfig/menuconfig/AddForm.jsx
View file @
b768069c
...
...
@@ -9,7 +9,7 @@ const AddForm = props => {
// const [type, setType] = useState(2);
const
[
form
]
=
Form
.
useForm
();
const
[
otherForm
]
=
Form
.
useForm
();
console
.
log
(
nodeObj
,
'nodeObj'
);
const
layout
=
{
layout
:
'horizontal'
,
labelCol
:
{
span
:
4
,
offset
:
1
},
...
...
@@ -25,29 +25,74 @@ const AddForm = props => {
submitCallback
(
obj
,
nodeObj
);
}
};
const
finish
=
()
=>
{
submit
();
};
return
(
<
div
>
{
(
addType
===
1
||
addType
===
2
)
&&
(
<
Form
form=
{
form
}
{
...
layout
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"分组名称"
name=
"menuName"
>
<
Form
form=
{
form
}
name=
"groupform"
{
...
layout
}
className=
{
styles
.
formStyle
}
onFinish=
{
finish
}
>
<
Item
label=
"分组名称"
name=
"menuName"
rules=
{
[
{
required
:
true
,
message
:
'请输入分组名称'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"分组别名"
name=
"shortName"
>
<
Input
/>
</
Item
>
{
addType
===
1
&&
(
<
Item
label=
"在线图标"
name=
"imageUrl"
>
<
Item
label=
"在线图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择在线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
addType
===
1
&&
(
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
>
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择离线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
addType
===
2
&&
(
<
Item
label=
"分组图标"
name=
"imageUrl"
>
<
Item
label=
"分组图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择分组图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
...
...
@@ -55,7 +100,7 @@ const AddForm = props => {
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
submit
()
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
提交
</
Button
>
</
Item
>
...
...
@@ -63,37 +108,87 @@ const AddForm = props => {
)
}
{
(
addType
===
3
||
addType
===
4
)
&&
(
<
Form
form=
{
otherForm
}
{
...
layout
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"菜单名称"
name=
"menuName"
>
<
Form
form=
{
otherForm
}
name=
"menuform"
{
...
layout
}
onFinish=
{
finish
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"菜单名称"
name=
"menuName"
rules=
{
[
{
required
:
true
,
message
:
'请输入菜单名称'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"菜单别名"
name=
"shortName"
>
<
Input
/>
</
Item
>
{
addType
===
3
&&
(
<
Item
label=
"在线图标"
name=
"imageUrl"
>
<
Item
label=
"在线图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择在线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
addType
===
3
&&
(
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
>
{
/* {otherForm.getFieldsValue().offlineImgUrl && <PicturesWall />} */
}
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择离线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
addType
===
4
&&
(
<
Item
label=
"菜单图标"
name=
"imageUrl"
>
<
Item
label=
"菜单图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择菜单图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
<
Item
label=
"功能路径"
name=
"pageUrl"
>
<
Item
label=
"功能路径"
name=
"pageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请输入功能路径'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"功能参数"
name=
"funParam"
>
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
submit
()
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
提交
</
Button
>
</
Item
>
...
...
src/pages/mobileConfig/menuconfig/editForm.jsx
View file @
b768069c
...
...
@@ -50,29 +50,74 @@ const EditForm = props => {
submitCallback
(
obj
);
}
};
const
onFinish
=
()
=>
{
submit
();
};
return
(
<
div
>
{
(
nodeType
===
1
||
nodeType
===
2
)
&&
(
<
Form
form=
{
form
}
{
...
layout
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"分组名称"
name=
"menuName"
>
<
Form
form=
{
form
}
name=
"editGroup"
{
...
layout
}
className=
{
styles
.
formStyle
}
onFinish=
{
onFinish
}
>
<
Item
label=
"分组名称"
name=
"menuName"
rules=
{
[
{
required
:
true
,
message
:
'请输入分组名称'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"分组别名"
name=
"shortName"
>
<
Input
/>
</
Item
>
{
nodeType
===
1
&&
(
<
Item
label=
"在线图标"
name=
"imageUrl"
>
<
Item
label=
"在线图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择在线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
nodeType
===
1
&&
(
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
>
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择离线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
nodeType
===
2
&&
(
<
Item
label=
"分组图标"
name=
"imageUrl"
>
<
Item
label=
"分组图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择分组图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
...
...
@@ -80,7 +125,7 @@ const EditForm = props => {
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
submit
()
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
提交
</
Button
>
</
Item
>
...
...
@@ -88,37 +133,88 @@ const EditForm = props => {
)
}
{
(
nodeType
===
3
||
nodeType
===
4
)
&&
(
<
Form
form=
{
otherForm
}
{
...
layout
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"菜单名称"
name=
"menuName"
>
<
Form
form=
{
otherForm
}
name=
"editMenu"
{
...
layout
}
onFinish=
{
onFinish
}
className=
{
styles
.
formStyle
}
>
<
Item
label=
"菜单名称"
name=
"menuName"
rules=
{
[
{
required
:
true
,
message
:
'请输入菜单名称'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"菜单别名"
name=
"shortName"
>
<
Input
/>
</
Item
>
{
nodeType
===
3
&&
(
<
Item
label=
"在线图标"
name=
"imageUrl"
>
<
Item
label=
"在线图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择在线图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
{
nodeType
===
3
&&
(
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
>
<
Item
label=
"离线图标"
name=
"offlineImgUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择离线图标'
,
},
]
}
>
{
/* {otherForm.getFieldsValue().offlineImgUrl && <PicturesWall />} */
}
<
PicturesWall
/>
</
Item
>
)
}
{
nodeType
===
4
&&
(
<
Item
label=
"菜单图标"
name=
"imageUrl"
>
<
Item
label=
"菜单图标"
name=
"imageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请选择菜单图标'
,
},
]
}
>
<
PicturesWall
/>
</
Item
>
)
}
<
Item
label=
"功能路径"
name=
"pageUrl"
>
<
Item
label=
"功能路径"
name=
"pageUrl"
rules=
{
[
{
required
:
true
,
message
:
'请输入功能路径'
,
},
]
}
>
<
Input
/>
</
Item
>
<
Item
label=
"功能参数"
name=
"funParam"
>
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
submit
()
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
提交
</
Button
>
</
Item
>
...
...
src/pages/mobileConfig/menuconfig/miniMenu.jsx
View file @
b768069c
...
...
@@ -46,6 +46,7 @@ const MiniMenu = props => {
const
[
addFlag
,
setAddFlag
]
=
useState
(
'root'
);
// 设置新增标志
const
[
nodeObj
,
setNodeObj
]
=
useState
({});
const
[
addType
,
setAddType
]
=
useState
(
''
);
// 添加下级类型
const
[
modalTitle
,
setModalTitle
]
=
useState
(
''
);
// 获取菜单树
useEffect
(()
=>
{
updateTrees
();
...
...
@@ -121,10 +122,10 @@ const MiniMenu = props => {
icon
:
obj
.
menuType
!==
'MiniAppMenuThree'
&&
obj
.
menuType
!==
'MiniAppMenu'
?
(
<
FolderFilled
/>
)
:
(
<
FileOutlined
/>
),
<
FolderFilled
/>
)
:
(
<
FileOutlined
/>
),
menuType
:
obj
.
menuType
,
children
:
hasChild
?
obj
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
...
...
@@ -222,12 +223,14 @@ const MiniMenu = props => {
// 新增菜单组
const
addMenuGroupTip
=
val
=>
{
console
.
log
(
val
,
'addgroup'
);
setModalTitle
(
val
.
text
);
setNodeObj
(
val
);
setAddVisible
(
true
);
};
const
rootAddGroup
=
()
=>
{
setNodeObj
(
''
);
setNodeType
(
1
);
setModalTitle
(
'根目录'
);
setAddType
(
1
);
setAddVisible
(
true
);
};
...
...
@@ -235,15 +238,17 @@ const MiniMenu = props => {
const
addMenuTip
=
val
=>
{
console
.
log
(
val
,
'add'
);
setNodeObj
(
val
);
setModalTitle
(
val
.
text
);
setAddTwoVisible
(
true
);
};
const
rootAdd
=
()
=>
{
setModalTitle
(
'根目录'
);
setNodeObj
(
''
);
setNodeType
(
3
);
setAddType
(
3
);
setAddTwoVisible
(
true
);
};
// 提交的回调
//
新增
提交的回调
const
submitCallback
=
(
prop
,
item
)
=>
{
console
.
log
(
prop
,
item
);
let
obj
=
{
...
prop
};
...
...
@@ -365,7 +370,7 @@ const MiniMenu = props => {
</
div
>
<
Modal
visible=
{
addVisible
}
title=
"新增菜单组"
title=
{
`在${modalTitle}下新增菜单组`
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
20
}
}
width=
"600px"
...
...
@@ -387,7 +392,7 @@ const MiniMenu = props => {
</
Modal
>
<
Modal
visible=
{
addTwoVisible
}
title=
"新增功能菜单"
title=
{
`在${modalTitle}下新增功能菜单`
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
20
}
}
width=
"600px"
...
...
@@ -417,6 +422,13 @@ const MiniMenu = props => {
/>
)
}
</
div
>
<
div
className=
{
classnames
({
[
styles
.
rightBox
]:
true
,
})
}
>
关联角色
</
div
>
</
div
>
</
Spin
>
);
...
...
src/pages/mobileConfig/menuconfig/miniMenu.less
View file @
b768069c
.box{
min-height: calc( 100vh - 172px);
display: flex;
}
.left{
...
...
@@ -69,4 +68,11 @@
.fs{
font-size: 18px;
margin-left: 10px;
}
.rightBox{
min-width: 600px;
// width: 600px;
min-height: 100%;
border: 1px solid #eee;
padding: 10px;
}
\ No newline at end of file
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