Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
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
吴迪
gs1
Commits
e950a68d
Commit
e950a68d
authored
Oct 03, 2021
by
Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 侧边栏功能优化
parent
bfd2ab18
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
22 deletions
+64
-22
index.vue
src/components/layout/header/index.vue
+1
-1
mock.js
src/components/layout/header/mock.js
+1
-1
SubNav.vue
src/views/comps/SubNav.vue
+62
-20
No files found.
src/components/layout/header/index.vue
View file @
e950a68d
...
...
@@ -87,7 +87,7 @@ export default {
if
(
this
.
$route
.
path
.
startsWith
(
nav_
.
link
))
{
this
.
currentNav
=
nav_
.
id
;
nav_
.
children
&&
nav_
.
children
.
le
gn
th
>
0
&&
nav_
.
children
.
le
ng
th
>
0
&&
this
.
$store
.
commit
(
"system/SET_SUB_NAV"
,
nav_
.
children
);
if
(
nav_
.
link
===
this
.
$route
.
path
)
{
nav_
.
breadcrumb
&&
...
...
src/components/layout/header/mock.js
View file @
e950a68d
...
...
@@ -40,7 +40,7 @@ export const nav = [
id
:
"2"
,
name
:
"业务大厅"
,
index
:
2
,
link
:
"/
bui
ss"
,
link
:
"/
Busine
ss"
,
children
:
[],
},
{
...
...
src/views/comps/SubNav.vue
View file @
e950a68d
...
...
@@ -12,24 +12,15 @@
:index=
"submenu.name"
>
<template
slot=
"title"
>
<span
style=
"margin-left: 6px"
>
{{
submenu
.
name
}}
</span>
<span>
{{
submenu
.
name
}}
</span>
</
template
>
<
template
v-for=
"item in submenu.children"
>
<template
v-if=
"item.children && item.children.length > 0"
>
<el-submenu
:index=
"item.name"
:key=
"item.id"
:background-color=
"theme.subMenuBg"
:text-color=
"theme.menuText"
:active-text-color=
"theme.menuActiveText"
>
<template
slot=
"title"
>
<i
v-show=
"item.icon_name"
:style=
"
{ color: theme.menuText }"
style="font-size: 13px"
:class="['qycloud', `${item.icon_name}`]"
/>
<span
style=
"margin-left: 6px"
>
{{
item
.
name
}}
</span>
</
template
>
<
template
v-for=
"third in item.children"
>
...
...
@@ -43,7 +34,6 @@
</
template
>
</el-submenu>
</template>
<
template
v-else
>
<el-menu-item
:key=
"item.id"
...
...
@@ -61,13 +51,6 @@
:index=
"submenu.name"
:class=
"
{ 'is-active': activeMenu === submenu.id }"
>
{{
submenu
.
name
}}
<i
v-show=
"submenu.icon_name"
:style=
"
{ color: theme.menuText }"
style="font-size: 13px;margin-right: 6px"
:class="['qycloud', `${submenu.icon_name}`]"
/>
<span>
{{
submenu
.
name
}}
</span>
</el-menu-item>
</
template
>
...
...
@@ -75,12 +58,12 @@
</el-menu>
</template>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
data
()
{
return
{
defaultOpeneds
:
[
"1"
,
"2"
]
,
activeMenu
:
''
,
};
},
computed
:
{
...
...
@@ -90,6 +73,60 @@ export default {
console
.
log
(
this
.
subNav
);
},
methods
:
{
handleSelect
(
index
,
indexP
)
{
console
.
log
(
index
,
indexP
);
const
temp
=
JSON
.
parse
(
JSON
.
stringify
(
indexP
));
const
key
=
temp
.
shift
();
this
.
subNav
.
forEach
((
item
)
=>
{
if
(
item
.
name
===
key
)
{
if
(
temp
.
length
>
1
)
{
this
.
checkChildren
(
index
,
temp
,
item
.
children
);
}
else
if
(
temp
.
length
===
0
)
{
this
.
activeMenu
=
item
.
name
;
this
.
showApp
(
item
);
}
else
{
item
.
children
.
forEach
((
_item
)
=>
{
if
(
_item
.
name
===
index
)
{
this
.
activeMenu
=
_item
.
name
;
this
.
showApp
(
_item
);
}
});
}
}
});
},
checkChildren
(
index
,
indexP
,
list
)
{
const
key
=
indexP
.
shift
();
list
.
forEach
((
item
)
=>
{
console
.
log
(
key
);
if
(
item
.
name
===
key
)
{
if
(
indexP
.
length
>
1
)
{
this
.
checkChildren
(
index
,
indexP
,
item
.
children
);
}
else
{
item
.
children
.
forEach
((
_item
)
=>
{
if
(
_item
.
name
===
index
)
{
this
.
activeMenu
=
_item
.
name
;
this
.
showApp
(
_item
);
}
});
}
}
});
},
showApp
(
item
)
{
console
.
log
(
item
)
if
(
item
.
link
.
startsWith
(
'http'
)){
window
.
open
(
item
.
link
)
}
else
{
if
(
item
.
breadcrumb
)
{
this
.
$store
.
commit
(
'system/SET_BREADCRUMB'
,
item
.
breadcrumb
)
}
this
.
$router
.
push
({
path
:
item
.
link
})
}
},
handleOpen
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
);
},
...
...
@@ -103,11 +140,13 @@ export default {
.el-menu.gs-subnav
{
border-right
:
none
;
background
:
$
side-bg-color
;
.el-submenu__title
{
background
:
$
side-bg-color
;
height
:
44px
;
line-height
:
44px
;
}
.menu-title
{
margin-top
:
25px
;
margin-bottom
:
10px
;
...
...
@@ -115,12 +154,14 @@ export default {
font-size
:
14px
;
color
:
#b7b6b6
;
}
.el-menu-item
{
height
:
44px
;
line-height
:
44px
;
color
:
#6b6a6a
;
background
:
transparent
;
font-size
:
14px
;
i
{
color
:
$
side-bg-color
;
font-size
:
25px
;
...
...
@@ -128,6 +169,7 @@ export default {
top
:
15px
;
right
:
15px
;
}
&
:hover
,
&
:focus
,
&
.is-active
{
...
...
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