feat(top-bar-mixin): 添加面板页面

This commit is contained in:
woody 2025-05-12 16:38:31 +08:00
parent 5f258c1420
commit 7a59b10298
1 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import * as api from '@/api/manage.js'
import { mapGetters } from 'vuex'
import { getRouters } from '@/api/settle'
export default {
data() {
return {
@ -31,12 +32,16 @@ export default {
// name: '产品审核',
// path: 'productCheck',
// },
]
],
roleMenu: []
}
},
computed: {
...mapGetters(['name', 'user'])
},
created() {
this.getRoles()
},
methods: {
getApprovalStatus() {
api.waitApprovalNum().then((res) => {
@ -45,6 +50,19 @@ export default {
api.receiveApprovalNum().then((res) => {
this.receiveApprovalNum = res.data
})
},
getRoles() {
getRouters().then((res) => {
this.roleMenu = res.data || []
if (!this.roleMenu.find((item) => item.routeName === 'summaryDashboard')) {
this.topList.splice(0, 1)
if (this.$route.name === 'summaryDashboard') {
this.$router.replace({
name: 'Dashboard'
})
}
}
})
}
}
}