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
33c575ea
Commit
33c575ea
authored
Nov 26, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/test/maintenance
parents
c5abe3b1
24d9b91a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
51 deletions
+99
-51
index.js
src/pages/mobileConfig/index.js
+13
-8
AddForm.jsx
src/pages/mobileConfig/menuconfig/AddForm.jsx
+3
-3
miniMenu.jsx
src/pages/mobileConfig/menuconfig/miniMenu.jsx
+81
-39
miniMenu.less
src/pages/mobileConfig/menuconfig/miniMenu.less
+2
-1
No files found.
src/pages/mobileConfig/index.js
View file @
33c575ea
...
...
@@ -10,19 +10,24 @@ import SiteConfig from './SiteConfig';
import
MenuConfig
from
'./menuconfig/MenuConfig'
;
const
{
TabPane
}
=
Tabs
;
const
MobileConfigPage
=
props
=>
{
const
[
activeKey
,
setActiveKey
]
=
useState
(
'
1
'
);
// tabs活动页
const
[
activeKey
,
setActiveKey
]
=
useState
(
'
0
'
);
// tabs活动页
const
[
miniTitle
,
setMiniTitle
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
useEffect
(()
=>
{
miniAppSiteTree
({
// miniAppSiteTree({
// userMode: 'admin',
// select: '',
// _version: 9999,
// _dc: new Date().getTime(),
// node: -2,
// })
getMiniAppModuleTree
({
userMode
:
'admin'
,
select
:
''
,
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
node
:
-
2
,
}).
then
(
res
=>
{
if
(
res
)
{
const
title
=
res
[
0
].
children
[
0
].
text
||
'熊猫掌天下小程序'
;
console
.
log
(
res
,
'res'
);
if
(
res
.
code
===
0
)
{
const
{
data
}
=
res
;
const
title
=
data
[
0
].
children
[
0
].
text
||
'熊猫掌天下小程序'
;
setMiniTitle
(
title
);
}
console
.
log
(
res
);
...
...
src/pages/mobileConfig/menuconfig/AddForm.jsx
View file @
33c575ea
...
...
@@ -5,7 +5,7 @@ import PicturesWall from '@/components/Upload/index';
const
{
Item
}
=
Form
;
const
AddForm
=
props
=>
{
const
{
submitCallback
,
nodeType
,
nodeObj
,
addType
}
=
props
;
const
{
submitCallback
,
nodeType
,
nodeObj
,
addType
,
submitLoading
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
otherForm
]
=
Form
.
useForm
();
console
.
log
(
nodeObj
,
'nodeObj'
);
...
...
@@ -99,7 +99,7 @@ const AddForm = props => {
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
submitLoading
}
>
提交
</
Button
>
</
Item
>
...
...
@@ -187,7 +187,7 @@ const AddForm = props => {
<
Input
/>
</
Item
>
<
Item
wrapperCol=
{
{
offset
:
5
}
}
style=
{
{
marginTop
:
'40px'
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
submitLoading
}
>
提交
</
Button
>
</
Item
>
...
...
src/pages/mobileConfig/menuconfig/miniMenu.jsx
View file @
33c575ea
...
...
@@ -44,11 +44,14 @@ const MiniMenu = props => {
const
[
info
,
setInfo
]
=
useState
({});
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
addTwoVisible
,
setAddTwoVisible
]
=
useState
(
false
);
// 编辑弹窗
const
[
delVisible
,
setDelVisible
]
=
useState
(
false
);
// 删除弹窗
const
[
addFlag
,
setAddFlag
]
=
useState
(
'root'
);
// 设置新增标志
const
[
nodeObj
,
setNodeObj
]
=
useState
({});
const
[
addType
,
setAddType
]
=
useState
(
''
);
// 添加下级类型
const
[
modalTitle
,
setModalTitle
]
=
useState
(
''
);
const
[
roleList
,
setRoleList
]
=
useState
([]);
// 复选框选中的值
const
[
modalLoading
,
setModalLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
// 获取菜单树
useEffect
(()
=>
{
updateTrees
();
...
...
@@ -62,17 +65,22 @@ const MiniMenu = props => {
// 更新树
const
updateTrees
=
()
=>
{
setLoading
(
true
);
miniAppSiteTree
({
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
node
:
-
2
,
// miniAppSiteTree({
// _version: 9999,
// _dc: new Date().getTime(),
// node: -2,
// userMode: 'super',
// select: '',
// });
getMiniAppModuleTree
({
userMode
:
'super'
,
select
:
''
,
})
.
then
(
res
=>
{
if
(
res
.
length
>
0
)
{
console
.
log
(
res
,
'res'
);
if
(
res
.
code
===
0
)
{
const
{
data
}
=
res
;
setLoading
(
false
);
const
result
=
res
[
0
].
children
[
0
].
children
[
2
].
children
;
const
result
=
data
[
0
].
children
[
0
].
children
[
1
].
children
;
setTreeData
(
result
);
console
.
log
(
result
);
// 第一次加载,默认选择第一个组织
...
...
@@ -80,6 +88,12 @@ const MiniMenu = props => {
// handleSelect([result[0].menuID], false);
// setTreeFlag(false);
// }
}
else
{
notification
({
message
:
'提示'
,
duration
:
10
,
description
:
'获取菜单失败'
,
});
}
})
.
catch
(
err
=>
{
...
...
@@ -106,17 +120,10 @@ const MiniMenu = props => {
<
FileAddTwoTone
onClick=
{
()
=>
addMenuTip
(
obj
)
}
/>
</
Tooltip
>
)
}
<
Popconfirm
cancelText=
"取消"
okText=
"确定"
title=
{
`确定删除${obj.text}?`
}
onConfirm=
{
()
=>
deleteMenuTip
(
obj
)
}
placement=
"right"
>
<
Tooltip
title=
"删除菜单"
className=
{
styles
.
fs
}
>
<
DeleteTwoTone
/>
</
Tooltip
>
</
Popconfirm
>
<
Tooltip
title=
"删除菜单"
className=
{
styles
.
fs
}
>
<
DeleteTwoTone
onClick=
{
()
=>
deleteMenuTip
(
obj
)
}
/>
</
Tooltip
>
</
div
>
</
div
>
),
...
...
@@ -201,26 +208,41 @@ const MiniMenu = props => {
// 删除的回调
const
deleteMenuTip
=
val
=>
{
console
.
log
(
val
,
'val'
);
setModalTitle
(
val
.
text
);
setNodeObj
(
val
);
setDelVisible
(
true
);
};
const
delMenu
=
()
=>
{
setModalLoading
(
true
);
deleteMenu
({
menuID
:
val
.
menuID
,
menuID
:
nodeObj
.
menuID
,
_dc
:
Date
.
now
(),
_version
:
9999
,
}).
then
(
res
=>
{
if
(
res
.
success
)
{
setFlag
(
flag
+
1
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'删除成功'
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
10
,
description
:
res
.
message
||
'删除成功'
,
});
}
});
})
.
then
(
res
=>
{
setModalLoading
(
false
);
if
(
res
.
success
)
{
setDelVisible
(
false
);
setFlag
(
flag
+
1
);
setNodeType
(
''
);
setNodeObj
(
''
);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'删除成功'
,
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
10
,
description
:
res
.
message
||
'删除失败'
,
});
}
})
.
catch
(
err
=>
{
setModalLoading
(
false
);
console
.
log
(
err
);
});
};
// 新增菜单组
const
addMenuGroupTip
=
val
=>
{
...
...
@@ -232,7 +254,7 @@ const MiniMenu = props => {
const
rootAddGroup
=
()
=>
{
setNodeObj
(
''
);
setNodeType
(
1
);
setModalTitle
(
'
根目录
'
);
setModalTitle
(
'
最上级列表
'
);
setAddType
(
1
);
setAddVisible
(
true
);
};
...
...
@@ -244,7 +266,7 @@ const MiniMenu = props => {
setAddTwoVisible
(
true
);
};
const
rootAdd
=
()
=>
{
setModalTitle
(
'
根目录
'
);
setModalTitle
(
'
最上级列表
'
);
setNodeObj
(
''
);
setNodeType
(
3
);
setAddType
(
3
);
...
...
@@ -252,6 +274,7 @@ const MiniMenu = props => {
};
// 新增提交的回调
const
submitCallback
=
(
prop
,
item
)
=>
{
setSubmitLoading
(
true
);
console
.
log
(
prop
,
item
);
let
obj
=
{
...
prop
};
const
parentID
=
item
.
menuID
?
item
.
menuID
:
-
1
;
...
...
@@ -263,6 +286,7 @@ const MiniMenu = props => {
...
obj
,
})
.
then
(
res
=>
{
setSubmitLoading
(
false
);
if
(
res
.
success
)
{
setAddVisible
(
false
);
setAddTwoVisible
(
false
);
...
...
@@ -282,6 +306,7 @@ const MiniMenu = props => {
console
.
log
(
res
,
'resadd'
);
})
.
catch
(
err
=>
{
setSubmitLoading
(
false
);
console
.
error
(
err
);
});
};
...
...
@@ -388,7 +413,7 @@ const MiniMenu = props => {
visible=
{
addVisible
}
title=
{
`在${modalTitle}下新增菜单组`
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
2
0
}
}
style=
{
{
top
:
8
0
}
}
width=
"600px"
destroyOnClose
footer=
{
null
}
...
...
@@ -404,13 +429,14 @@ const MiniMenu = props => {
nodeObj=
{
nodeObj
}
addType=
{
addType
}
submitCallback=
{
submitCallback
}
submitLoading=
{
submitLoading
}
/>
</
Modal
>
<
Modal
visible=
{
addTwoVisible
}
title=
{
`在${modalTitle}下新增功能菜单`
}
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
2
0
}
}
style=
{
{
top
:
8
0
}
}
width=
"600px"
destroyOnClose
footer=
{
null
}
...
...
@@ -419,12 +445,28 @@ const MiniMenu = props => {
onCancel=
{
()
=>
setAddTwoVisible
(
false
)
}
>
<
AddForm
submitLoading=
{
submitLoading
}
nodeType=
{
nodeType
}
nodeObj=
{
nodeObj
}
addType=
{
addType
}
submitCallback=
{
submitCallback
}
/>
</
Modal
>
<
Modal
visible=
{
delVisible
}
title=
"请确认"
bodyStyle=
{
{
width
:
'100%'
,
minHeight
:
'100px'
}
}
style=
{
{
top
:
80
}
}
width=
"400px"
destroyOnClose
cancelText=
"取消"
okText=
"确认"
onCancel=
{
()
=>
setDelVisible
(
false
)
}
onOk=
{
()
=>
delMenu
()
}
confirmLoading=
{
modalLoading
}
>
是否删除
<
span
style=
{
{
color
:
'red'
}
}
>
{
modalTitle
}
</
span
>
?
</
Modal
>
<
div
className=
{
classnames
({
[
styles
.
middle
]:
true
,
...
...
src/pages/mobileConfig/menuconfig/miniMenu.less
View file @
33c575ea
...
...
@@ -70,8 +70,9 @@
margin-left: 10px;
}
.rightBox{
min-width:
6
00px;
min-width:
2
00px;
// width: 600px;
width: 100%;
min-height: 100%;
border: 1px solid #eee;
padding: 10px;
...
...
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