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
c286dbf1
Commit
c286dbf1
authored
Sep 28, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加常用菜单点击与菜单导航联动
parent
5d0ae1ee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
7 deletions
+39
-7
proxy.js
config/proxy.js
+1
-1
package-lock.json
package-lock.json
+0
-0
ExtendRightContent.js
src/components/GlobalHeader/ExtendRightContent.js
+6
-1
BasicLayout1.js
src/layouts/BasicLayout1.js
+12
-1
index.js
src/pages/commonMenu/index.js
+20
-4
No files found.
config/proxy.js
View file @
c286dbf1
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const
proxyURL
=
'http://1
92.168.10.150:8669
'
;
const
proxyURL
=
'http://1
72.16.10.152:8666
'
;
module
.
exports
=
{
assetsRoot
:
process
.
env
.
NODE_ENV
!==
'production'
?
proxyURL
:
'./'
,
dev
:
{
...
...
package-lock.json
View file @
c286dbf1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/components/GlobalHeader/ExtendRightContent.js
View file @
c286dbf1
...
...
@@ -153,7 +153,12 @@ const GlobalHeaderRight = props => {
const
handlerFavitor
=
event
=>
{
// setCurrentIndex(1);
history
.
push
(
'/commonmenu'
)
history
.
push
(
'/commonmenu'
);
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'event:favitor'
,
{
name
:
"常用"
,
path
:
'/commonmenu'
,
icon
:
<
FavitorIcon
/>
});
}
const
handlerTheme
=
()
=>
{
...
...
src/layouts/BasicLayout1.js
View file @
c286dbf1
...
...
@@ -302,11 +302,22 @@ const BasicLayout = props => {
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'event:updateCurrentChildrenRoutes'
,
({
currentPath
,
currentRoute
,
selectedIndex
})
=>
{
currentRoute
&&
currentRoute
.
parent
&&
currentRoute
.
parent
.
routes
?
setChildrenRoutes
(
currentRoute
.
parent
.
routes
):
setChildrenRoutes
([
currentRoute
]);
currentRoute
&&
currentRoute
.
parent
&&
currentRoute
.
parent
.
routes
?
setChildrenRoutes
(
currentRoute
.
parent
.
routes
):
!
currentRoute
.
parent
?
setChildrenRoutes
(
currentRoute
.
routes
):
setChildrenRoutes
([
currentRoute
]);
setSelectIndex
(
selectedIndex
);
setTabActiveKey
(
currentPath
)
});
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'event:favitor'
,
({
icon
,
name
,
path
})
=>
{
setChildrenRoutes
([
{
icon
:
<
HomeIcon
/>
,
path
:
path
,
name
:
name
}
])
})
useEffect
(()
=>
{
siteAction
.
setGlobalConfig
(
props
.
global
);
if
(
!
Cookies
.
get
(
'token'
))
{
...
...
src/pages/commonMenu/index.js
View file @
c286dbf1
...
...
@@ -6,7 +6,7 @@ import classnames from 'classnames';
import
*
as
_
from
'lodash'
;
import
PinyinMatch
from
'pinyin-match'
;
import
PandaEmpty
from
'@wisdom-components/empty'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
{
appService
}
from
'@/api'
;
import
{
useHistory
}
from
'@wisdom-utils/runtime'
;
import
{
savePagePartInfo
}
from
'@/api/service/base'
;
...
...
@@ -135,8 +135,20 @@ const CommonMenu = props => {
* @param {*} menu
*/
const
linkToMenu
=
menu
=>
{
const
{
path
}
=
menu
;
console
.
log
(
"props"
,
props
)
const
{
path
,
topGroup
}
=
menu
;
const
currentIndex
=
props
.
menus
.
findIndex
(
item
=>
item
.
name
===
topGroup
);
history
.
push
(
path
);
props
.
updateCurrentIndex
(
currentIndex
);
let
currentRoutes
=
props
.
menus
[
currentIndex
]
&&
props
.
menus
[
currentIndex
].
routes
;
currentRoutes
=
currentRoutes
.
find
(
item
=>
item
.
path
===
path
);
window
.
share
&&
window
.
share
.
event
.
emit
(
'trigger:updateMenuIndex'
,
currentIndex
);
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'event:updateCurrentChildrenRoutes'
,
{
currentPath
:
path
,
currentRoute
:
currentRoutes
,
selectedIndex
:
currentIndex
});
};
const
mdOk
=
submitData
=>
{
...
...
@@ -476,8 +488,12 @@ const MenuAddModal = props => {
const
mapStateToProps
=
state
=>
({
menus
:
state
.
getIn
([
'global'
,
'menu'
]),
});
const
mapDispatchToProps
=
dispatch
=>
({
updateCurrentIndex
(
index
)
{
dispatch
(
actionCreators
.
updateCurrentIndex
(
index
));
}
});
export
default
connect
(
mapStateToProps
,
null
,
mapDispatchToProps
,
)(
CommonMenu
);
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