|
|
@ -1,7 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-menu |
|
|
|
<el-menu class="sidebar-el-menu" |
|
|
|
class="sidebar-el-menu" |
|
|
|
|
|
|
|
:default-active="onRoutes" |
|
|
|
:default-active="onRoutes" |
|
|
|
background-color="#324157" |
|
|
|
background-color="#324157" |
|
|
|
text-color="#bfcbd9" |
|
|
|
text-color="#bfcbd9" |
|
|
@ -9,38 +8,33 @@ |
|
|
|
unique-opened |
|
|
|
unique-opened |
|
|
|
mode="horizontal" |
|
|
|
mode="horizontal" |
|
|
|
router |
|
|
|
router |
|
|
|
@select="handleSelect" |
|
|
|
@select="handleSelect"> |
|
|
|
> |
|
|
|
|
|
|
|
<template v-for="item in menus"> |
|
|
|
<template v-for="item in menus"> |
|
|
|
<template v-if="item.subs"> |
|
|
|
<template v-if="item.subs"> |
|
|
|
<el-submenu :index="item.index" :key="item.index"> |
|
|
|
<el-submenu :index="item.index" |
|
|
|
|
|
|
|
:key="item.index"> |
|
|
|
<template slot="title"> |
|
|
|
<template slot="title"> |
|
|
|
<i :class="item.icon"></i> |
|
|
|
<i :class="item.icon"></i> |
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-for="subItem in item.subs"> |
|
|
|
<template v-for="subItem in item.subs"> |
|
|
|
<el-submenu |
|
|
|
<el-submenu v-if="subItem.subs" |
|
|
|
v-if="subItem.subs" |
|
|
|
|
|
|
|
:index="subItem.index" |
|
|
|
:index="subItem.index" |
|
|
|
:key="subItem.index" |
|
|
|
:key="subItem.index"> |
|
|
|
> |
|
|
|
|
|
|
|
<template slot="title">{{ subItem.title }}</template> |
|
|
|
<template slot="title">{{ subItem.title }}</template> |
|
|
|
<el-menu-item |
|
|
|
<el-menu-item v-for="(threeItem,i) in subItem.subs" |
|
|
|
v-for="(threeItem,i) in subItem.subs" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
:key="i" |
|
|
|
:index="threeItem.index" |
|
|
|
:index="threeItem.index">{{ threeItem.title }}</el-menu-item> |
|
|
|
>{{ threeItem.title }}</el-menu-item> |
|
|
|
|
|
|
|
</el-submenu> |
|
|
|
</el-submenu> |
|
|
|
<el-menu-item |
|
|
|
<el-menu-item v-else |
|
|
|
v-else |
|
|
|
|
|
|
|
:index="subItem.index" |
|
|
|
:index="subItem.index" |
|
|
|
:key="subItem.index" |
|
|
|
:key="subItem.index">{{ subItem.title }}</el-menu-item> |
|
|
|
>{{ subItem.title }}</el-menu-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-submenu> |
|
|
|
</el-submenu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<el-menu-item :index="item.index" :key="item.index"> |
|
|
|
<el-menu-item :index="item.index" |
|
|
|
|
|
|
|
:key="item.index"> |
|
|
|
<i :class="item.icon"></i> |
|
|
|
<i :class="item.icon"></i> |
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
</el-menu-item> |
|
|
|
</el-menu-item> |
|
|
@ -138,7 +132,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar')) |
|
|
|
// sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar')) |
|
|
|
sessionStorage.getItem('token') && this.getPer() // 登录了才获取权限 |
|
|
|
sessionStorage.getItem('token') && this.getPer() // 登录了才获取权限 |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|