diff --git a/back/src/views/main-sidebar.vue b/back/src/views/main-sidebar.vue index 40f882b0..7a2f1d0e 100644 --- a/back/src/views/main-sidebar.vue +++ b/back/src/views/main-sidebar.vue @@ -37,6 +37,7 @@ import http from '@/utils/request' import SubMenu from "./main-sidebar-sub-menu"; import returnLocationStr from '@/utils/location'; +import bus from '@/views/bus.js' export default { data() { return { @@ -49,12 +50,19 @@ export default { created() { this.getNum() //this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"]; + //更新我的待办得数量 + bus.$off('updateTaskNum') + bus.$on('updateTaskNum', () => { + this.getNum() + }) }, methods: { getNum(){ - http.get('/act/task/myToDoTaskNum').then(({ data: res }) => { + http.get('/act/task/myToDoTaskNum').then(({ data: res }) => { this.numObject=res.data let menuList= window.SITE_CONFIG["menuList"]; + console.log('menuList====>',menuList); + console.log('this.numObject====>',this.numObject); for(var i=0;i + + + { - this.getDataList() + this.getDataList(); + bus.$emit('updateTaskNum') }) } }