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
24d9b91a
Commit
24d9b91a
authored
Nov 26, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: perf
parent
cddd5c11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
index.js
src/pages/mobileConfig/index.js
+13
-8
miniMenu.jsx
src/pages/mobileConfig/menuconfig/miniMenu.jsx
+18
-7
No files found.
src/pages/mobileConfig/index.js
View file @
24d9b91a
...
@@ -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/miniMenu.jsx
View file @
24d9b91a
...
@@ -65,17 +65,22 @@ const MiniMenu = props => {
...
@@ -65,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
);
// 第一次加载,默认选择第一个组织
// 第一次加载,默认选择第一个组织
...
@@ -83,6 +88,12 @@ const MiniMenu = props => {
...
@@ -83,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
=>
{
...
...
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