Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
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
CivWeb
Commits
aef6f532
Commit
aef6f532
authored
3 years ago
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复三级菜单高亮选中
parent
aa5771a9
Pipeline
#35945
passed with stages
in 29 minutes 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
BasicLayout1.js
src/layouts/BasicLayout1.js
+20
-10
No files found.
src/layouts/BasicLayout1.js
View file @
aef6f532
import
React
,
{
import
React
,
{
useCallback
,
useEffect
,
useEffect
,
useRef
,
useRef
,
useState
,
useState
,
...
@@ -348,16 +349,24 @@ const BasicLayout = props => {
...
@@ -348,16 +349,24 @@ const BasicLayout = props => {
/**
/**
* web4全屏退出,切换三级菜单高亮
* web4全屏退出,切换三级菜单高亮
*/
*/
window
.
share
.
event
.
on
(
'event:history'
,
params
=>
{
useEffect
(()
=>
{
setTimeout
(()
=>
{
const
routes
=
currentRoutes
.
routes
[
selectIndex
];
const
routes
=
currentRoutes
.
routes
[
selectIndex
];
if
(
routes
)
{
if
(
routes
)
{
const
route
=
routes
&&
routes
.
routes
.
find
(
item
=>
item
.
path
===
decodeURI
(
window
.
location
.
pathname
.
replace
(
'/civbase'
,
''
)));
const
route
=
routes
&&
routes
.
routes
.
find
(
item
=>
item
.
path
===
decodeURI
(
window
.
location
.
pathname
.
replace
(
'/civbase'
,
''
)));
setTabActiveKey
(
route
.
path
)
setTabActiveKey
(
route
.
path
)
}
}
},
[
props
.
location
]);
},
0
)
// window.share.event.on('event:history', params => {
// setTimeout(() => {
})
// debugger
// const routes = currentRoutes.routes[selectIndex];
// if(routes) {
// const route = routes && routes.routes.find(item => item.path === decodeURI(window.location.pathname.replace('/civbase', '')));
// setTabActiveKey(route.path)
// }
// // window.share.event.removeListener('event:history')
// }, 0)
// })
// window.share && window.share.event.on('event:microError', event => {
// window.share && window.share.event.on('event:microError', event => {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
...
@@ -385,6 +394,7 @@ const BasicLayout = props => {
...
@@ -385,6 +394,7 @@ const BasicLayout = props => {
if
(
current
.
routes
)
{
if
(
current
.
routes
)
{
setSelectedKeys
([
current
.
routes
[
0
].
href
]);
setSelectedKeys
([
current
.
routes
[
0
].
href
]);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
routes
[
0
].
path
}
`
);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
routes
[
0
].
path
}
`
);
}
else
{
}
else
{
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
path
}
`
);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
path
}
`
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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