|
@@ -1,8 +1,15 @@
|
|
|
-import { asyncRoutes, constantRoutes } from '@/router'
|
|
|
-import router from '@/router'
|
|
|
-import { getSilder } from '@/api/silder'
|
|
|
+import {
|
|
|
+ asyncRoutes,
|
|
|
+ constantRoutes
|
|
|
+} from '@/router'
|
|
|
+import router from '@/router'
|
|
|
+import {
|
|
|
+ getSilder
|
|
|
+} from '@/api/silder'
|
|
|
import store from "@/store";
|
|
|
-import { Message } from 'element-ui'
|
|
|
+import {
|
|
|
+ Message
|
|
|
+} from 'element-ui'
|
|
|
// import { stat } from 'fs'
|
|
|
// import { removeToken } from '@/utils/auth'
|
|
|
// import Layout from '@/layout'
|
|
@@ -65,16 +72,16 @@ function pathErgodic(item) {
|
|
|
// console.log(item)
|
|
|
let firstMenu = null
|
|
|
item.children.forEach(i => {
|
|
|
- if (!firstMenu && i.children?.length > 0&&!i.hidden) {
|
|
|
+ if (!firstMenu && i.children?.length > 0 && !i.hidden) {
|
|
|
let isChildrenList = false;
|
|
|
- i.children.forEach(ii=>{
|
|
|
- if(!ii.hidden){
|
|
|
+ i.children.forEach(ii => {
|
|
|
+ if (!ii.hidden) {
|
|
|
isChildrenList = true
|
|
|
}
|
|
|
})
|
|
|
- if(isChildrenList){
|
|
|
+ if (isChildrenList) {
|
|
|
firstMenu = pathErgodic(i)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (!firstMenu && checkPathUrl(i.path)) {
|
|
|
firstMenu = i.path
|
|
|
} else {
|
|
@@ -123,7 +130,14 @@ function recursionRouter(arr) {
|
|
|
arr[i].hid == 0 ? obj.hidden = false : obj.hidden = true
|
|
|
// console.log('高亮标签'+arr[i].parentPermission,'普通路径'+arr[i].path)
|
|
|
obj.path = arr[i].path;
|
|
|
- obj.meta = { 'title': arr[i].name, 'icon': arr[i].icon, 'noCache': arr[i].keepAlive, 'activeMenu': arr[i].parentPermission, 'belongTopMenu': arr[i].belongTopMenu,'id':arr[i].id }
|
|
|
+ obj.meta = {
|
|
|
+ 'title': arr[i].name,
|
|
|
+ 'icon': arr[i].icon,
|
|
|
+ 'noCache': arr[i].keepAlive,
|
|
|
+ 'activeMenu': arr[i].parentPermission,
|
|
|
+ 'belongTopMenu': arr[i].belongTopMenu,
|
|
|
+ 'id': arr[i].id
|
|
|
+ }
|
|
|
if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
|
|
|
obj.children = recursionRouter(arr[i].sysMenus);
|
|
|
}
|
|
@@ -172,6 +186,7 @@ function setTopMenu(arr, topParentArr) {
|
|
|
// 权限
|
|
|
// 递归遍历数组
|
|
|
let tempArr = []
|
|
|
+
|
|
|
function recursionPermission(arr) {
|
|
|
arr.map(item => {
|
|
|
tempArr.push(item.memo)
|
|
@@ -180,13 +195,13 @@ function recursionPermission(arr) {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
function setDetailRoute(accessedRoutes) {
|
|
|
// console.log(accessedRoutes)
|
|
|
accessedRoutes.forEach(route => {
|
|
|
// console.log(route.path)
|
|
|
if (route.path == '/main') {
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '日程安排',
|
|
|
path: 'scheduleDetail',
|
|
|
component: () => import('@/views/main/teamSchedule/scheduleDetail'),
|
|
@@ -196,7 +211,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '日程安排',
|
|
|
belongTopMenu: "/main",
|
|
|
activeMenu: '/main/main',
|
|
|
- id:'xx1'
|
|
|
+ id: 'xx1'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -209,7 +224,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '未在班级学员',
|
|
|
belongTopMenu: "/main",
|
|
|
activeMenu: '/main/main',
|
|
|
- id:'xx2'
|
|
|
+ id: 'xx2'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -248,13 +263,24 @@ function setDetailRoute(accessedRoutes) {
|
|
|
activeMenu: '/main/main'
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ name: 'organDateDetail',
|
|
|
+ path: 'organDateDetail',
|
|
|
+ component: () => import('@/views/main/cloudDate/organDateDetail'),
|
|
|
+ hidden: true,
|
|
|
+ meta: {
|
|
|
+ noCache: '1',
|
|
|
+ title: '分部云教练数据详情',
|
|
|
+ belongTopMenu: "/main",
|
|
|
+ activeMenu: '/main/main'
|
|
|
+ }
|
|
|
+ },
|
|
|
//
|
|
|
])
|
|
|
}
|
|
|
if (route.path == '/business') {
|
|
|
// import('@/views/resetTeaming/components/strudentPayInfo'),
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '学员缴费详情',
|
|
|
path: 'strudentPayInfo',
|
|
|
component: () => import('@/views/resetTeaming/components/strudentPayInfo'),
|
|
@@ -264,7 +290,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '学员缴费详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xx3'
|
|
|
+ id: 'xx3'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -277,7 +303,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '乐团详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xx4'
|
|
|
+ id: 'xx4'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -290,7 +316,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '乐团档案',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xx4'
|
|
|
+ id: 'xx4'
|
|
|
}
|
|
|
},
|
|
|
//musicArchices
|
|
@@ -304,7 +330,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '会员排课列表',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xx28'
|
|
|
+ id: 'xx28'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -317,7 +343,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '相册详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xxx28'
|
|
|
+ id: 'xxx28'
|
|
|
}
|
|
|
},
|
|
|
// 相册详情
|
|
@@ -331,7 +357,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '全部证书',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teamList',
|
|
|
- id:'xxx28'
|
|
|
+ id: 'xxx28'
|
|
|
}
|
|
|
},
|
|
|
// 全部证书
|
|
@@ -345,7 +371,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: 'VIP/乐理课申请',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/vipManager/vipList',
|
|
|
- id:'xx5'
|
|
|
+ id: 'xx5'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -358,7 +384,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: 'VIP/乐理课修改',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/vipManager/vipList',
|
|
|
- id:'xx6'
|
|
|
+ id: 'xx6'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -371,7 +397,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: 'vip详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/vipManager/vipList',
|
|
|
- id:'xx7'
|
|
|
+ id: 'xx7'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -384,7 +410,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '网管课详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/accompanyManager/accompany',
|
|
|
- id:'xx8'
|
|
|
+ id: 'xx8'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -397,7 +423,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '评价详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/commentManager',
|
|
|
- id:'xx9'
|
|
|
+ id: 'xx9'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -410,7 +436,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: 'VIP/乐理课详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/afterSchoolManager',
|
|
|
- id:'xx10'
|
|
|
+ id: 'xx10'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -423,7 +449,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '学员详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/studentManager/studentList',
|
|
|
- id:'xx11'
|
|
|
+ id: 'xx11'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -436,7 +462,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '老师详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teacherManager/teacherList',
|
|
|
- id:'xx12'
|
|
|
+ id: 'xx12'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -449,7 +475,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '老师修改',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/teacherManager/teacherList',
|
|
|
- id:'xx13'
|
|
|
+ id: 'xx13'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -462,7 +488,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '问答详情',
|
|
|
belongTopMenu: "/business",
|
|
|
activeMenu: '/otherManager/reaplceMusicPlayer',
|
|
|
- id:'xx4'
|
|
|
+ id: 'xx4'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -482,8 +508,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
])
|
|
|
}
|
|
|
if (route.path == '/operateManager') {
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '服务指标(详情)',
|
|
|
path: 'serverIndexDetail',
|
|
|
component: () => import('@/views/operateManager/serverIndexDetail'),
|
|
@@ -493,7 +518,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '服务指标(详情)',
|
|
|
belongTopMenu: "/operateManager",
|
|
|
activeMenu: '/serverIndexManager/serverIndexList',
|
|
|
- id:'xx15'
|
|
|
+ id: 'xx15'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -506,7 +531,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '新建活动方案',
|
|
|
belongTopMenu: "/operateManager",
|
|
|
activeMenu: '/vipActiveManager/vipActiveList',
|
|
|
- id:'xx16'
|
|
|
+ id: 'xx16'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -519,7 +544,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加分部活动',
|
|
|
belongTopMenu: "/operateManager",
|
|
|
activeMenu: '/branchActiveManager/branchActive',
|
|
|
- id:'xx17'
|
|
|
+ id: 'xx17'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -532,7 +557,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '修改分部活动',
|
|
|
belongTopMenu: "/operateManager",
|
|
|
activeMenu: '/branchActiveManager/branchActive',
|
|
|
- id:'xx18'
|
|
|
+ id: 'xx18'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -545,32 +570,29 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加问卷',
|
|
|
belongTopMenu: "/operateManager",
|
|
|
activeMenu: '/operateManager/setQuestions',
|
|
|
- id:'xx19'
|
|
|
+ id: 'xx19'
|
|
|
}
|
|
|
},
|
|
|
// /operateManager/setQuestions /questionOperation operateManager
|
|
|
])
|
|
|
}
|
|
|
if (route.path == '/financialManager') {
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
- name: '经营报表详情',
|
|
|
- path: 'businessStatementDetail',
|
|
|
- component: () => import('@/views/businessManager/orderManager/businessStatementDetail'),
|
|
|
- hidden: true,
|
|
|
- meta: {
|
|
|
- noCache: '1',
|
|
|
- title: '经营报表详情',
|
|
|
- belongTopMenu: "/financialManager",
|
|
|
- activeMenu: '/businessStatement',
|
|
|
- id:'xx20'
|
|
|
- }
|
|
|
- },
|
|
|
- ])
|
|
|
+ route.children = route.children.concat([{
|
|
|
+ name: '经营报表详情',
|
|
|
+ path: 'businessStatementDetail',
|
|
|
+ component: () => import('@/views/businessManager/orderManager/businessStatementDetail'),
|
|
|
+ hidden: true,
|
|
|
+ meta: {
|
|
|
+ noCache: '1',
|
|
|
+ title: '经营报表详情',
|
|
|
+ belongTopMenu: "/financialManager",
|
|
|
+ activeMenu: '/businessStatement',
|
|
|
+ id: 'xx20'
|
|
|
+ }
|
|
|
+ }, ])
|
|
|
}
|
|
|
if (route.path == '/contentManager') {
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '经营报表详情',
|
|
|
path: 'helpCategory',
|
|
|
component: () => import('@/views/helpCenter/helpCategory'),
|
|
@@ -580,7 +602,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '经营报表详情',
|
|
|
belongTopMenu: "/contentManager",
|
|
|
activeMenu: '/contentManager/helpContent',
|
|
|
- id:'xx21'
|
|
|
+ id: 'xx21'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -593,14 +615,13 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加&修改内容管理',
|
|
|
belongTopMenu: "/contentManager",
|
|
|
activeMenu: '/contentManager/contentManager',
|
|
|
- id:'xx22'
|
|
|
+ id: 'xx22'
|
|
|
}
|
|
|
},
|
|
|
])
|
|
|
}
|
|
|
if (route.path == '/shopManager') {
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '进货清单',
|
|
|
path: 'purchaseLlist',
|
|
|
component: () => import('@/views/businessManager/shopManager/purchase-llist'),
|
|
@@ -610,7 +631,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '进货清单',
|
|
|
belongTopMenu: "/shopManager",
|
|
|
activeMenu: '/shopList',
|
|
|
- id:'xx23'
|
|
|
+ id: 'xx23'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -623,14 +644,13 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加修改商品',
|
|
|
belongTopMenu: "/shopManager",
|
|
|
activeMenu: '/shopList',
|
|
|
- id:'xx24'
|
|
|
+ id: 'xx24'
|
|
|
}
|
|
|
},
|
|
|
])
|
|
|
}
|
|
|
- if(route.path == '/systemManager'){
|
|
|
- route.children = route.children.concat([
|
|
|
- {
|
|
|
+ if (route.path == '/systemManager') {
|
|
|
+ route.children = route.children.concat([{
|
|
|
name: '创建&修改汇付账号',
|
|
|
path: 'adapayOperation',
|
|
|
component: () => import('@/views/adapayAccount/form'),
|
|
@@ -640,7 +660,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '创建&修改汇付账号',
|
|
|
belongTopMenu: "/systemManager",
|
|
|
activeMenu: '/sysBasics/adapayManager',
|
|
|
- id:'xx25'
|
|
|
+ id: 'xx25'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -653,7 +673,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加&查看时间充值活动',
|
|
|
belongTopMenu: "/systemManager",
|
|
|
activeMenu: '/sysBasics/entryActivities',
|
|
|
- id:'xx26'
|
|
|
+ id: 'xx26'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -666,7 +686,7 @@ function setDetailRoute(accessedRoutes) {
|
|
|
title: '添加&修改系统权限',
|
|
|
belongTopMenu: "/systemManager",
|
|
|
activeMenu: '/parameter/adminManager',
|
|
|
- id:'xx27'
|
|
|
+ id: 'xx27'
|
|
|
}
|
|
|
},
|
|
|
// /parameter/adminManager adminOperation
|
|
@@ -676,13 +696,15 @@ function setDetailRoute(accessedRoutes) {
|
|
|
return accessedRoutes
|
|
|
}
|
|
|
const actions = {
|
|
|
- generateRoutes({ commit }) {
|
|
|
+ generateRoutes({
|
|
|
+ commit
|
|
|
+ }) {
|
|
|
return new Promise(resolve => {
|
|
|
// 获取接口返回的权限菜单
|
|
|
getSilder().then(async res => {
|
|
|
if (res.code == 200) {
|
|
|
let result = addTopMenu(res.data)
|
|
|
- if(res.data?.length <1){
|
|
|
+ if (res.data?.length < 1) {
|
|
|
// 一条权限都没有
|
|
|
//退出 跳到登录页 提示'该账号无任何权限'
|
|
|
// console.log(store.dispatch)
|
|
@@ -716,7 +738,9 @@ const actions = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- removePermission({ commit }) {
|
|
|
+ removePermission({
|
|
|
+ commit
|
|
|
+ }) {
|
|
|
window.localStorage.removeItem('permission')
|
|
|
commit('SET_PERMISSION', [])
|
|
|
|