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