|
|
@ -6,16 +6,9 @@ |
|
|
|
:unique-opened="true" |
|
|
|
:collapseTransition="false" |
|
|
|
class="aui-sidebar__menu"> |
|
|
|
<div v-if="routeListOne.length > 0"> |
|
|
|
<sub-menu v-for="menu in routeListOne" |
|
|
|
<sub-menu v-for="menu in routeList" |
|
|
|
:key="menu.id" |
|
|
|
:menu="menu" /> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<sub-menu v-for="menu in routeListTwo" |
|
|
|
:key="menu.id" |
|
|
|
:menu="menu" /> |
|
|
|
</div> |
|
|
|
</el-menu> |
|
|
|
</div> |
|
|
|
</aside> |
|
|
@ -34,8 +27,7 @@ export default { |
|
|
|
parentPid: '', |
|
|
|
socket: '', |
|
|
|
stompClient: '', |
|
|
|
routeListOne: [], |
|
|
|
routeListTwo: [] |
|
|
|
routeList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
@ -43,7 +35,7 @@ export default { |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.$store.state.sidebarMenuList = [...window.SITE_CONFIG['menuList']] |
|
|
|
this.routeListOne = this.$store.state.sidebarMenuList |
|
|
|
this.routeList = JSON.parse(JSON.stringify(window.SITE_CONFIG['menuList'])) |
|
|
|
this.initWebSocket() |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -112,7 +104,7 @@ export default { |
|
|
|
this.pid = 0 |
|
|
|
this.parentPid = 0 |
|
|
|
const selectRoute = JSON.parse(value.body) |
|
|
|
const list = JSON.parse(JSON.stringify(window.SITE_CONFIG['menuList'])) |
|
|
|
const list = JSON.parse(JSON.stringify(this.$store.state.sidebarMenuList)) |
|
|
|
if (Object.prototype.toString.call(selectRoute) === '[object Array]') { |
|
|
|
selectRoute.forEach(item => { |
|
|
|
this.$store.state.sidebarMenuList = this.filterRoute(list, item) |
|
|
@ -120,13 +112,7 @@ export default { |
|
|
|
} else if (Object.prototype.toString.call(selectRoute) === '[object Object]') { |
|
|
|
this.$store.state.sidebarMenuList = this.filterRoute(list, selectRoute) |
|
|
|
} |
|
|
|
if (this.routeListOne.length > 0) { |
|
|
|
this.routeListOne = [] |
|
|
|
this.routeListTwo = JSON.parse(JSON.stringify(this.$store.state.sidebarMenuList)) |
|
|
|
} else if (this.routeListTwo.length > 0) { |
|
|
|
this.routeListTwo = [] |
|
|
|
this.routeListOne = JSON.parse(JSON.stringify(this.$store.state.sidebarMenuList)) |
|
|
|
} |
|
|
|
this.routeList = JSON.parse(JSON.stringify(this.$store.state.sidebarMenuList)) |
|
|
|
}, |
|
|
|
onFailed (frame) { |
|
|
|
console.log('Failed: ' + frame) |
|
|
|