Browse Source

修改实时消息通知

master
lihenian 6 years ago
parent
commit
1063e03ed2
  1. 9
      src/views/main-sidebar-sub-menu.vue
  2. 10
      src/views/main-sidebar.vue

9
src/views/main-sidebar-sub-menu.vue

@ -52,12 +52,15 @@ export default {
margin-left: 10px;
background: #FF4C52;
color: #ffffff;
width: 20px;
min-width: 20px;
height: 20px;
display: inline-block;
line-height: 20px;
line-height: 14px;
text-align: center;
border-radius: 50%;
border-radius: 5px;
font-size: 12px;
padding: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
</style>

10
src/views/main-sidebar.vue

@ -109,11 +109,17 @@ export default {
this.stompClient.subscribe(topic, this.onSubscribe)
},
onSubscribe (value) {
this.pid = 0
this.parentPid = 0
const selectRoute = JSON.parse(value.body)
console.log('menuCode', selectRoute)
const list = JSON.parse(JSON.stringify(window.SITE_CONFIG['menuList']))
if (Object.prototype.toString.call(selectRoute) === '[object Array]') {
selectRoute.forEach(item => {
this.$store.state.sidebarMenuList = this.filterRoute(list, item)
})
} else if (Object.prototype.toString.call(selectRoute) === '[object Object]') {
this.$store.state.sidebarMenuList = this.filterRoute(list, selectRoute)
console.log(this.$store.state.sidebarMenuList)
}
if (this.routeListOne.length > 0) {
this.routeListOne = []
this.routeListTwo = JSON.parse(JSON.stringify(this.$store.state.sidebarMenuList))

Loading…
Cancel
Save