From fe1d1fc817e422cc850fe9bc74585c06ce9080c2 Mon Sep 17 00:00:00 2001
From: lihenian <2629534615@qq.com>
Date: Wed, 30 Oct 2019 18:29:07 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4websocket?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/main-sidebar.vue | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/src/views/main-sidebar.vue b/src/views/main-sidebar.vue
index 545606c0..c7cfab66 100644
--- a/src/views/main-sidebar.vue
+++ b/src/views/main-sidebar.vue
@@ -6,16 +6,9 @@
:unique-opened="true"
:collapseTransition="false"
class="aui-sidebar__menu">
-
-
-
-
-
-
@@ -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)