diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
index b515f615..03e3b89f 100644
--- a/src/views/layout/components/Sidebar/Item.vue
+++ b/src/views/layout/components/Sidebar/Item.vue
@@ -3,6 +3,10 @@ export default {
name: 'MenuItem',
functional: true,
props: {
+ count: {
+ type: String,
+ default: null
+ },
icon: {
type: String,
default: ''
@@ -13,7 +17,7 @@ export default {
}
},
render(h, context) {
- const { icon, title } = context.props
+ const { count, icon, title } = context.props
const vnodes = []
if (icon) {
@@ -21,7 +25,11 @@ export default {
}
if (title) {
- vnodes.push({(title)})
+ vnodes.push({(title)} )
+ }
+
+ if (count) {
+ vnodes.push(({(count)}))
}
return vnodes
}
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
index 9fb88139..c81a33ce 100644
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ b/src/views/layout/components/Sidebar/SidebarItem.vue
@@ -4,14 +4,21 @@
-
+
-
-
+
@@ -26,7 +33,11 @@
-
+
@@ -43,6 +54,7 @@ import { isExternal } from '@/utils'
import Item from './Item'
import AppLink from './Link'
import FixiOSBug from './FixiOSBug'
+import numeral from 'numeral'
export default {
name: 'SidebarItem',
@@ -71,6 +83,9 @@ export default {
computed: {
invitesEnabled() {
return this.basePath === '/invites' ? this.$store.state.app.invitesEnabled : true
+ },
+ normalizedReportsCount() {
+ return numeral(this.$store.state.reports.totalReportsCount).format('0a')
}
},
methods: {
@@ -104,6 +119,9 @@ export default {
}
return path.resolve(this.basePath, routePath)
},
+ showCount(item) {
+ return item.path === '/reports'
+ },
isExternalLink(routePath) {
return isExternal(routePath)
},
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
index 11ef4c02..369f321d 100644
--- a/src/views/layout/components/Sidebar/index.vue
+++ b/src/views/layout/components/Sidebar/index.vue
@@ -31,6 +31,10 @@ export default {
isCollapse() {
return !this.sidebar.opened
}
+ },
+ mounted() {
+ this.$store.dispatch('SetReportsFilter', 'open')
+ this.$store.dispatch('FetchReports', 1)
}
}