Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
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
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 76e5e020
authored
Sep 20, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
c0dc17a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
src/layout/components/LeftSide/LeftSideMenuLv1Item.vue
src/layout/components/LeftSide/LeftSideMenuLv2Item.vue
src/layout/components/LeftSide/LeftSideMenuLv1Item.vue
View file @
76e5e02
...
...
@@ -8,9 +8,11 @@
<
script
>
import
{
mapActions
,
mapGetters
}
from
'vuex'
// import { utils } from 'glsx-common'
import
{
currentId
}
from
'./mixins/index'
export
default
{
name
:
'LeftSideMenuLv1Item'
,
inject
:
[
'bus'
],
mixins
:
[
currentId
],
props
:
{
menuData
:
{
type
:
Object
,
...
...
@@ -28,14 +30,16 @@ export default {
},
methods
:
{
mouseenter
:
function
()
{
if
(
this
.
menu
.
hoverId
===
this
.
menu
.
id
)
return
this
.
setHoverId
(
this
.
menuData
.
id
)
this
.
menu
.
isCollapse
&&
this
.
bus
.
$emit
(
'mouseenter'
,
this
.
$refs
[
'bt'
+
this
.
menuData
.
id
],
()
=>
this
.
bus
.
$emit
(
'menuChanged'
,
{
menus
:
this
.
menuData
.
children
.
noHidden
()
})
)
this
.
menu
.
isCollapse
&&
this
.
bus
.
$emit
(
'mouseenter'
,
this
.
$refs
[
'bt'
+
this
.
menuData
.
id
],
this
.
emitter
)
},
mouseleave
:
function
()
{
this
.
setHoverId
(
''
)
},
handleClick
()
{
!
this
.
menu
.
isCollapse
&&
this
.
emitter
()
},
emitter
()
{
this
.
bus
.
$emit
(
'menuChanged'
,
{
menus
:
this
.
menuData
.
children
.
noHidden
()
})
},
...
mapActions
(
'menu'
,
[
'setHoverId'
])
...
...
src/layout/components/LeftSide/LeftSideMenuLv2Item.vue
View file @
76e5e02
...
...
@@ -46,7 +46,7 @@ export default {
},
mounted
()
{
this
.
bus
.
$on
(
'menuChanged'
,
this
.
handleMenuChanged
)
this
.
reload
()
!
this
.
menu
.
isCollapse
&&
this
.
reload
()
},
beforeDestroy
()
{
this
.
bus
.
$off
(
'menuChanged'
,
this
.
handleMenuChanged
)
...
...
@@ -59,18 +59,18 @@ export default {
return
children
.
noHidden
().
length
==
0
},
handleMenuChanged
({
menus
=
[],
isReload
=
false
})
{
const
pid1
=
this
.
menus
[
0
]?.
id
?.
split
(
'-'
)
const
pid2
=
menus
[
0
]?.
id
?.
split
(
'-'
)
if
(
pid1
==
pid2
)
return
if
(
isReload
)
{
this
.
reload
()
return
}
// console.log('待修改:'+menus[0]?.title , '当前,'+this.menus[0]?.title);
this
.
menus
=
menus
this
.
bus
.
$emit
(
'menuOpenedsChanged'
,
{
menus
})
},
reload
()
{
const
{
lv1
}
=
this
.
current
const
[
pid
]
=
this
.
menus
[
0
]?.
id
.
split
(
'-'
)
||
[]
if
(
lv1
==
pid
)
return
const
menus
=
this
.
app
.
menuList
.
find
(({
id
})
=>
id
==
lv1
).
children
.
noHidden
()
this
.
handleMenuChanged
({
menus
})
}
...
...
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