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 d02b4f5f
authored
Sep 26, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
2
1 parent
dc1058ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
src/layout/components/LeftSide/MenuLv4.vue
src/layout/components/LeftSide/MenuLv4.vue
View file @
d02b4f5
<
template
>
<
template
>
<div
class=
"scrm-base-mebu-lv4"
v-show=
"nav4 && nav4.length"
>
<div
class=
"scrm-base-mebu-lv4"
v-show=
"nav4 && nav4.length"
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
:name=
"item.path"
v-for=
"item in nav4"
:key=
"item.id"
>
<el-tab-pane
:name=
"item.path"
v-for=
"item in nav4"
:key=
"item.id"
>
<span
slot=
"label"
style=
"padding: 0 10px"
>
{{
item
.
title
}}
</span>
<span
slot=
"label"
style=
"padding: 0 10px"
>
{{
item
.
title
}}
</span>
</el-tab-pane>
</el-tab-pane>
...
@@ -18,7 +18,8 @@ export default {
...
@@ -18,7 +18,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
activeName
:
''
,
activeName
:
''
,
nav4
:
[]
nav4
:
[],
id
:
''
}
}
},
},
watch
:
{
watch
:
{
...
@@ -27,11 +28,6 @@ export default {
...
@@ -27,11 +28,6 @@ export default {
this
.
onLoad
()
this
.
onLoad
()
},
},
immediate
:
true
immediate
:
true
},
activeName
:
{
handler
(
n
)
{
n
?.
startsWith
(
'/'
)
&&
this
.
$router
.
push
(
n
)
}
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -42,12 +38,22 @@ export default {
...
@@ -42,12 +38,22 @@ export default {
this
.
bus
.
$off
(
'menu3Changed'
,
this
.
onMenu3Changed
)
this
.
bus
.
$off
(
'menu3Changed'
,
this
.
onMenu3Changed
)
},
},
methods
:
{
methods
:
{
handleClick
(
item
)
{
this
.
$router
.
push
(
item
.
name
)
},
setActive
(
activeId
=
''
,
nav4
=
[])
{
setActive
(
activeId
=
''
,
nav4
=
[])
{
if
(
this
.
id
==
activeId
)
return
// console.log(this.id , activeId);
this
.
id
=
activeId
this
.
nav4
=
nav4
this
.
nav4
=
nav4
if
(
nav4
.
length
)
{
if
(
nav4
.
length
)
{
const
sub
=
nav4
.
find
(({
id
})
=>
id
==
activeId
)
const
sub
=
nav4
.
find
(({
id
})
=>
id
==
activeId
)
if
(
sub
)
{
if
(
sub
)
{
this
.
$nextTick
(()
=>
(
this
.
activeName
=
sub
.
path
))
this
.
$nextTick
(()
=>
{
console
.
log
(
sub
.
path
)
this
.
$router
.
push
(
sub
.
path
)
this
.
activeName
=
sub
.
path
})
}
}
}
}
},
},
...
@@ -62,6 +68,7 @@ export default {
...
@@ -62,6 +68,7 @@ export default {
const
{
lv1
,
lv2
,
lv3
,
lv4
}
=
this
.
current
const
{
lv1
,
lv2
,
lv3
,
lv4
}
=
this
.
current
const
lv3id
=
`
${
lv1
}
-
${
lv2
}
-
${
lv3
}
`
const
lv3id
=
`
${
lv1
}
-
${
lv2
}
-
${
lv3
}
`
const
lv4id
=
`
${
lv3id
}
-
${
lv4
}
`
const
lv4id
=
`
${
lv3id
}
-
${
lv4
}
`
console
.
log
(
lv4id
);
const
sub
=
this
.
find
(
lv3id
)?.
children
||
[]
const
sub
=
this
.
find
(
lv3id
)?.
children
||
[]
const
nav4
=
sub
.
noHidden
()
const
nav4
=
sub
.
noHidden
()
this
.
setActive
(
lv4id
,
nav4
)
this
.
setActive
(
lv4id
,
nav4
)
...
...
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