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
e1b03f13
Commit
e1b03f13
authored
Oct 19, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改基本布局
parent
da40eadf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
35 deletions
+22
-35
BasicLayout.js
src/layouts/BasicLayout.js
+15
-33
config.js
src/routes/config.js
+7
-2
No files found.
src/layouts/BasicLayout.js
View file @
e1b03f13
...
...
@@ -86,6 +86,16 @@ const BasicMenu = [
component
:
'BasicLayout'
,
name
:
'Web5配置'
,
icon
:
'icon-dashboard'
,
routes
:
[
{
path
:
'/web5/integration'
,
name
:
'集成网站'
,
},
{
path
:
'/web5/single'
,
name
:
'一般网站'
,
},
],
},
{
path
:
'/app'
,
...
...
@@ -117,24 +127,14 @@ const BasicMenu = [
],
},
];
const
basicUrl
=
'http://localhost:8080/Cityinterface/rest/services/OMS.svc/'
;
const
userMode
=
localStorage
.
getItem
(
'userMode'
);
if
(
userMode
==
'common'
)
{
BasicMenu
.
shift
();
}
const
BasicLayout
=
props
=>
{
/* eslint-disable no-unused-vars */
const
[
pathname
,
setPathname
]
=
useState
(
'/welcome'
);
const
[
menuData
,
setMenuData
]
=
useState
([]);
console
.
log
(
props
);
useEffect
(()
=>
{
fetch
(
`
${
basicUrl
}
U_GetOUTree?_version=9999`
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
const
userMode
=
localStorage
.
getItem
(
'userMode'
);
if
(
userMode
==
'common'
)
{
BasicMenu
.
shift
();
}
setMenuData
(
BasicMenu
||
[]);
});
},
[]);
const
handleMenuCollapse
=
()
=>
{};
// get children authority
matchRoutes
(
props
.
route
.
routes
,
props
.
location
.
pathname
);
...
...
@@ -153,25 +153,7 @@ const BasicLayout = props => {
location
=
{{
pathname
,
}}
menuDataRender
=
{
menuDataProps
=>
{
console
.
log
(
menuDataProps
);
menuDataProps
.
forEach
(
item
=>
{
if
(
item
.
name
==
'机构列表'
)
{
console
.
log
(
'机构列表'
);
axios
.
get
(
`
${
basicUrl
}
U_GetOUTree?_version=9999`
).
then
(
result
=>
{
console
.
log
(
result
.
data
);
item
.
routes
=
[
{
path
:
'/ou/orgList'
,
name
:
'机构列表11'
,
},
];
});
}
});
return
menuData
;
}}
menuDataRender
=
{()
=>
BasicMenu
}
menuItemRender
=
{(
menuItemProps
,
defaultDom
)
=>
{
if
(
menuItemProps
.
isUrl
||
!
menuItemProps
.
path
)
{
return
defaultDom
;
...
...
src/routes/config.js
View file @
e1b03f13
...
...
@@ -40,8 +40,13 @@ export default {
component
:
Welcome
,
},
{
path
:
'/web5'
,
name
:
'Web5配置'
,
path
:
'/web5/integration'
,
name
:
'集成网站'
,
component
:
Welcome
,
},
{
path
:
'/web5/single'
,
name
:
'一般网站'
,
component
:
Welcome
,
},
{
...
...
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