|
|
@@ -154,97 +154,26 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
activeTopIndex: -1,
|
|
|
- viewKey: Date.now(),
|
|
|
- menuData: [
|
|
|
- {
|
|
|
- title: '租户代理',
|
|
|
- icon: 'el-icon-office-building',
|
|
|
- children: [
|
|
|
- { title: '代理管理', path: '/admin/proxy', icon: 'el-icon-user' },
|
|
|
- { path:'/admin/serviceCost', title:'收费配置', icon: 'el-icon-price-tag' },
|
|
|
- { path:'/admin/agentReport', title:'收益报表', icon: 'el-icon-data-analysis' },
|
|
|
- { title: '租户列表', path: '/admin/company', icon: 'el-icon-notebook-2' },
|
|
|
- { title: '租户模块使用统计', path: '/admin/moduleUsage', icon: 'el-icon-pie-chart' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '内容审计',
|
|
|
- icon: 'el-icon-view',
|
|
|
- children: [
|
|
|
- { title: '视频资源', path: '/admin/videoResource', icon: 'el-icon-video-camera' },
|
|
|
- { title: '公域课程管理', path: '/admin/course', icon: 'el-icon-reading' },
|
|
|
- { title: '直播间', path: '/admin/live', icon: 'el-icon-video-camera-solid' },
|
|
|
- { title: '直播视频', path: '/admin/liveVideo', icon: 'el-icon-film' },
|
|
|
- { title: '商品管理', path: '/admin/product', icon: 'el-icon-goods' },
|
|
|
- { title: '销售订单', path: '/admin/storeOrder', icon: 'el-icon-shopping-bag-1' },
|
|
|
- { title: 'AI生成工作流', path: '/admin/workflowGenerate', icon: 'el-icon-cpu' },
|
|
|
- { title: '销冠语料学习', path: '/admin/salesCorpus', icon: 'el-icon-trophy' },
|
|
|
- { title: '文章管理', path: '/admin/article', icon: 'el-icon-document' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '财务管理',
|
|
|
- icon: 'el-icon-money',
|
|
|
- children: [
|
|
|
- { title: '消费扣款记录', path: '/admin/consumeRecord', icon: 'el-icon-wallet' },
|
|
|
- { title: '充值扣款记录', path: '/admin/rechargeRecord', icon: 'el-icon-bank-card' },
|
|
|
- { title: '返佣记录', path: '/admin/commissionRecord', icon: 'el-icon-coin' },
|
|
|
- { title: '代理提现管理', path: '/admin/withdrawal', icon: 'el-icon-money' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '通信管理',
|
|
|
- icon: 'el-icon-phone-outline',
|
|
|
- children: [
|
|
|
- { title: '通话接口管理', icon: 'el-icon-connection', path: '/admin/voiceApi' },
|
|
|
- { title: '通话套餐管理', icon: 'el-icon-box', path: '/admin/voicePackage' },
|
|
|
- { title: '坐席管理', icon: 'el-icon-service', path: '/admin/voiceSeat' },
|
|
|
- { title: '黑名单管理', icon: 'el-icon-warning', path: '/admin/voiceBlacklist' },
|
|
|
- { title: '呼叫频率配置', icon: 'el-icon-timer', path: '/admin/voiceFrequency' },
|
|
|
- { title: '通话套餐订单', icon: 'el-icon-tickets', path: '/admin/voiceOrder' },
|
|
|
- { title: '短信管理', icon: 'el-icon-chat-dot-round', path: '/admin/sms' },
|
|
|
- { title: '短信套餐', icon: 'el-icon-box', path: '/admin/smsPackage' },
|
|
|
- { title: '短信订单', icon: 'el-icon-tickets', path: '/admin/smsOrder' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '系统管理',
|
|
|
- icon: 'el-icon-setting',
|
|
|
- children: [
|
|
|
- { title: '员工管理', icon: 'el-icon-user', path: '/admin/sysUser' },
|
|
|
- { title: '角色管理', icon: 'el-icon-s-check', path: '/admin/role' },
|
|
|
- { title: '菜单管理', icon: 'el-icon-menu', path: '/admin/menu' },
|
|
|
- { title: '部门管理', icon: 'el-icon-s-cooperation', path: '/admin/dept' },
|
|
|
- { title: '岗位管理', icon: 'el-icon-s-custom', path: '/admin/post' },
|
|
|
- { title: '操作日志', icon: 'el-icon-document', path: '/admin/operLog' },
|
|
|
- { title: '登录日志', icon: 'el-icon-key', path: '/admin/loginLog' },
|
|
|
- { title: '租户操作日志', icon: 'el-icon-notebook-2', path: '/admin/companyOperLog' },
|
|
|
- { title: '代理操作日志', icon: 'el-icon-document-copy', path: '/admin/proxyOperLog' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '系统配置',
|
|
|
- icon: 'el-icon-s-tools',
|
|
|
- children: [
|
|
|
- { title: '字典管理', icon: 'el-icon-collection', path: '/admin/dict' },
|
|
|
- { title: '参数管理', icon: 'el-icon-edit-outline', path: '/admin/config' },
|
|
|
- { title: '通知公告', icon: 'el-icon-bell', path: '/admin/notice' },
|
|
|
- { title: '违规词语', icon: 'el-icon-warning-outline', path: '/admin/keyword' },
|
|
|
- { title: 'CID配置', icon: 'el-icon-phone', path: '/admin/cidConfig' },
|
|
|
- { title: '个微配置', icon: 'el-icon-chat-line-round', path: '/admin/wxConfig' },
|
|
|
- { title: 'OSS配置', icon: 'el-icon-upload', path: '/admin/ossConfig' },
|
|
|
- { title: '前端配置', icon: 'el-icon-monitor', path: '/admin/frontConfig' },
|
|
|
- { title: 'Ipad服务器', icon: 'el-icon-mobile-phone', path: '/admin/ipadServer' },
|
|
|
- { title: '关键词管理', icon: 'el-icon-search', path: '/admin/keywordManage' },
|
|
|
- { title: '模型配置', icon: 'el-icon-cpu', path: '/admin/textModel' },
|
|
|
- { title: 'DB配置', icon: 'el-icon-s-data', path: '/admin/dbConfig' }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
+ viewKey: Date.now()
|
|
|
+ // menuData 已改为 computed 属性,从后端动态路由中读取
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['nickName', 'avatar']),
|
|
|
+ // 从Vuex Store动态路由中读取菜单结构(替代硬编码menuData)
|
|
|
+ menuData() {
|
|
|
+ const routes = this.$store.state.permission.sidebarRouters || []
|
|
|
+ const adminRoute = routes.find(r => r.path === '/admin')
|
|
|
+ if (!adminRoute || !adminRoute.children) return []
|
|
|
+
|
|
|
+ return adminRoute.children
|
|
|
+ .filter(child => child.children && child.children.length > 0)
|
|
|
+ .map(group => ({
|
|
|
+ title: (group.meta && group.meta.title) || group.name || '',
|
|
|
+ icon: (group.meta && group.meta.icon) || '',
|
|
|
+ children: this.buildSidebarItems(group.children)
|
|
|
+ }))
|
|
|
+ },
|
|
|
// 是否处于数据看板页面
|
|
|
isDashboard() {
|
|
|
return this.$route.path === '/admin/dashboard' || this.$route.path === '/admin'
|
|
|
@@ -266,9 +195,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ // /admin 根路径自动重定向到数据看板
|
|
|
+ if (this.$route.path === '/admin') {
|
|
|
+ this.$router.replace('/admin/dashboard').catch(() => {})
|
|
|
+ }
|
|
|
this.initActiveTop()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 将Vue Router子路由转换为侧边栏菜单项格式
|
|
|
+ buildSidebarItems(routes) {
|
|
|
+ if (!routes || !routes.length) return []
|
|
|
+ return routes
|
|
|
+ .filter(r => !r.hidden)
|
|
|
+ .map(r => {
|
|
|
+ const item = {
|
|
|
+ title: (r.meta && r.meta.title) || r.name || '',
|
|
|
+ path: r.path && r.path.startsWith('/') ? r.path : '/admin/' + (r.path || ''),
|
|
|
+ icon: (r.meta && r.meta.icon) || ''
|
|
|
+ }
|
|
|
+ // 如果有子路由且不是叶子菜单,递归构建子菜单
|
|
|
+ if (r.children && r.children.length && !r.component) {
|
|
|
+ item.children = this.buildSidebarItems(r.children)
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ },
|
|
|
switchTopMenu(index) {
|
|
|
this.activeTopIndex = index
|
|
|
// 自动跳转到该分组下第一个可点击的路由
|