Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 608fa904
authored
Mar 14, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zj_dev_v1.5.0' into 'develop'
Zj dev v1.5.0 See merge request
!1
2 parents
2635e3a8
a97c9aa3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
src/components/DesktopLeftSider/Sub/Menu.vue
src/utils/common/common.js
src/components/DesktopLeftSider/Sub/Menu.vue
View file @
608fa90
...
@@ -155,6 +155,12 @@ export default {
...
@@ -155,6 +155,12 @@ export default {
// 点击二级菜单标题
// 点击二级菜单标题
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
const
cItemClick
=
(
path
,
cItem
,
parentItem
)
=>
{
console
.
log
(
'menuList:'
,
store
.
state
.
menu
.
menuList
)
console
.
log
(
'parentItem:'
,
parentItem
)
console
.
log
(
'path:'
,
path
)
console
.
log
(
'cItem:'
,
cItem
)
Common
.
setBreadCrumbs
(
path
);
const
cOrigin
=
cItem
.
origin
;
const
cOrigin
=
cItem
.
origin
;
const
pOrigin
=
parentItem
.
origin
;
const
pOrigin
=
parentItem
.
origin
;
let
showEmpty
=
false
;
let
showEmpty
=
false
;
...
...
src/utils/common/common.js
View file @
608fa90
...
@@ -50,5 +50,53 @@ export const Common = {
...
@@ -50,5 +50,53 @@ export const Common = {
(
err
)
=>
{
}
(
err
)
=>
{
}
);
);
},
// 动态设置面包屑
setBreadCrumbs
(
url
)
{
let
list
=
store
.
state
.
menu
.
menuList
;
let
m
=
''
if
(
!
url
)
{
return
false
;
}
let
o
=
list
.
find
(
k
=>
{
let
n
=
(
k
.
children
||
[]).
find
(
j
=>
j
.
origin
.
frontRoute
==
url
);
if
(
n
)
{
m
=
n
;
return
k
}
})
let
arr
=
[]
// 一级菜单
if
(
o
)
{
arr
.
push
({
name
:
o
.
label
,
path
:
o
.
origin
.
frontRoute
})
}
// 二级菜单
if
(
m
)
{
arr
.
push
({
name
:
m
.
label
,
path
:
m
.
origin
.
frontRoute
})
}
}
// 控制菜单展开
list
.
map
(
k
=>
{
console
.
log
(
k
.
label
+
'---'
+
o
.
label
)
if
(
k
.
label
==
o
.
label
)
{
k
.
showSubList
=
true
}
else
{
k
.
showSubList
=
false
;
}
(
k
.
children
||
[]).
map
(
j
=>
{
if
(
j
.
origin
.
frontRoute
==
m
.
origin
.
frontRoute
)
{
j
.
subItemActive
=
true
}
else
{
j
.
subItemActive
=
false
;
}
})
})
store
.
dispatch
(
"menu/setBreadCrumb"
,
arr
);
store
.
commit
(
'menu/SET_MENU_LIST'
,
list
)
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment