| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347 |
- import { asyncRoutes, constantRoutes } from "@/router";
- import router from "@/router";
- import { getSilder } from "@/api/silder";
- import store from "@/store";
- import { Message } from "element-ui";
- // import { stat } from 'fs'
- // import { removeToken } from '@/utils/auth'
- // import Layout from '@/layout'
- /**
- * 遍历接口菜单添加页面
- * @param asyncRoutes
- * @param getMenu
- */
- function generateAsyncRouter(asyncRoutes, data) {
- if (!data) {
- return [];
- }
- data.forEach(item => {
- item.component = asyncRoutes[item.component];
- if (item.children && item.children.length > 0) {
- generateAsyncRouter(asyncRoutes, item.children);
- }
- });
- return data;
- }
- /**
- * 判断平台端添加首页
- * @param type
- */
- // const type = getters.type
- const state = {
- routes: [],
- addRoutes: [],
- type: "", // 登录的平台类型
- permission: [] // 权限
- };
- const mutations = {
- SET_ROUTES: (state, routes) => {
- state.addRoutes = routes;
- state.routes = constantRoutes.concat(routes);
- },
- SET_PERMISSION: (state, permission) => {
- state.permission = permission;
- }
- };
- function getFirstMenu(routes) {
- // 可能没有权限 提示管理
- if (routes && routes.length > 0) {
- let firstMenu = null;
- routes.forEach(item => {
- if (item.children?.length > 0 && !item.hidden) {
- firstMenu = pathErgodic(item);
- // console.log(firstMenu)
- item.redirect = firstMenu;
- }
- });
- return routes;
- } else {
- Message.error("暂无页面权限,请联系管理员");
- return false;
- }
- }
- function pathErgodic(item) {
- // console.log(item)
- let firstMenu = null;
- item.children.forEach(i => {
- if (!firstMenu && i.children?.length > 0 && !i.hidden) {
- let isChildrenList = false;
- i.children.forEach(ii => {
- if (!ii.hidden) {
- isChildrenList = true;
- }
- });
- if (isChildrenList) {
- firstMenu = pathErgodic(i);
- } else {
- if (!firstMenu && checkPathUrl(i.path)) {
- firstMenu = i.path;
- } else {
- if (!firstMenu && !i.hidden) {
- firstMenu = item.path + "/" + i.path;
- }
- }
- }
- } else {
- if (!firstMenu && checkPathUrl(i.path)) {
- firstMenu = i.path;
- } else {
- if (!firstMenu && !i.hidden) {
- firstMenu = item.path + "/" + i.path;
- }
- }
- }
- });
- return firstMenu;
- }
- // 判断path有没有带/,并且是第一个位置
- function checkPathUrl(path) {
- return path.indexOf("/") === 0 ? true : false;
- }
- // 路由
- // 递归遍历数组
- function recursionRouter(arr) {
- // 这里来了
- if (arr.length > 0) {
- let newArr = [];
- for (let i = 0; i < arr.length; i++) {
- if (arr[i].type == 1) {
- continue;
- }
- let obj = {};
- obj.component = arr[i].component;
- obj.name = arr[i].component;
- // if (item.type != '1' && item.component) {
- // if (!item.path.startsWith('/') && item.component != 'Layout') {
- // obj.names = item.name
- // }
- // }
- 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
- };
- if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
- obj.children = recursionRouter(arr[i].sysMenus);
- }
- newArr.push(obj);
- }
- return newArr;
- }
- }
- // 设置 belongTopMenu, 顶部菜单
- function addTopMenu(arr) {
- if (arr.length > 0) {
- let newArr = [];
- for (let i = 0; i < arr.length; i++) {
- if (arr[i].type == 1) {
- continue;
- }
- let obj = arr[i];
- obj.belongTopMenu = obj.path;
- if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
- obj.sysMenus = setTopMenu(arr[i].sysMenus, obj);
- }
- newArr.push(obj);
- }
- return newArr;
- }
- }
- function setTopMenu(arr, topParentArr) {
- let newArr = [];
- for (let i = 0; i < arr.length; i++) {
- let obj = arr[i];
- obj.belongTopMenu = topParentArr.path;
- if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
- obj.sysMenus = setTopMenu(arr[i].sysMenus, topParentArr);
- }
- newArr.push(obj);
- }
- return newArr;
- }
- // 权限
- // 递归遍历数组
- let tempArr = [];
- function recursionPermission(arr) {
- arr.map(item => {
- tempArr.push(item.memo);
- if (item.sysMenus && item.sysMenus.length > 0) {
- recursionPermission(item.sysMenus);
- }
- });
- }
- function setDetailRoute(accessedRoutes) {
- // console.log(accessedRoutes)
- accessedRoutes.forEach(route => {
- // console.log(route.path)
- if (route.path == "/main") {
- route.children = route.children.concat([
- {
- name: "日程安排",
- path: "scheduleDetail",
- component: () => import("@/views/main/teamSchedule/scheduleDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "日程安排",
- belongTopMenu: "/main",
- activeMenu: "/workbench",
- id: "xx1"
- }
- },
- {
- name: "未在班级学员",
- path: "notClassStudent",
- component: () => import("@/views/main/notClassStudent"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "未在班级学员",
- belongTopMenu: "/main",
- activeMenu: "/workbench",
- id: "xx2"
- }
- },
- {
- name: "学员请假列表",
- path: "studentLeaveList",
- component: () => import("@/views/main/studentLeaveList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "学员请假列表",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "乐团会员列表",
- path: "teamMemberList",
- component: () => import("@/views/studentManager/memberList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团会员列表",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "乐团展演列表",
- path: "teamShowList",
- component: () => import("@/views/main/teamShowList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团展演列表",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "organDateDetail",
- path: "organDateDetail",
- component: () => import("@/views/main/cloudDate/organDateDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "分部云教练数据详情",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "organRankDetail",
- path: "organRankDetail",
- component: () => import("@/views/main/cloudDate/organRankDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "分部云教练排行",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "hasfreeCourse",
- path: "/hasfreeCourse",
- component: () => import("@/views/main/hasfreeCourse"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "排课时长消耗异常",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- },
- {
- name: "exerciseDurationDetail",
- path: "/exerciseDurationDetail",
- component: () =>
- import("@/views/main/cloudDate/exerciseDurationDetail.vue"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "练习时长详情",
- belongTopMenu: "/main",
- activeMenu: "/workbench"
- }
- }
- // /hasfreeCourse 排课时长消耗异常
- ]);
- }
- if (route.path == "/business") {
- // import('@/views/resetTeaming/components/strudentPayInfo'),
- route.children = route.children.concat([
- {
- name: "学员缴费详情",
- path: "strudentPayInfo",
- component: () =>
- import("@/views/resetTeaming/components/strudentPayInfo"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "学员缴费详情",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx3"
- }
- },
- {
- name: "缴费设置",
- path: "studentPaySet",
- component: () =>
- import("@/views/resetTeaming/components/payInfoDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "缴费设置",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx3"
- }
- },
- {
- name: "乐团详情",
- path: "resetTeaming",
- component: () => import("@/views/resetTeaming/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团详情",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "3953"
- }
- },
- {
- name: "乐团档案",
- path: "musicArchices",
- component: () =>
- import("@/views/resetTeaming/components/musicArchices"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团档案",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx4"
- }
- },
- //musicArchices
- {
- name: "会员排课列表",
- path: "memberClassList",
- component: () =>
- import("@/views/teamDetail/components/memberClassList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "会员排课列表",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx28"
- }
- },
- {
- name: "相册详情",
- path: "photo-detail",
- component: () => import("@/views/photo-detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "相册详情",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xxx28"
- }
- },
- // 相册详情
- {
- name: "全部证书",
- path: "performance",
- component: () => import("@/views/photo-detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "全部证书",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xxx28"
- }
- },
- // 全部证书
- {
- name: "新建vip",
- path: "buildVip",
- component: () => import("@/views/buildVip/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "VIP/乐理课申请",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx5"
- }
- },
- {
- name: "网管课",
- path: "newPractice",
- component: () => import("@/views/buildVip/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "网管课申请",
- belongTopMenu: "/business",
- activeMenu: "/accompanyManager/accompany",
- id: "xx5"
- }
- },
- {
- name: "vip修改",
- path: "vipReset",
- component: () => import("@/views/vipClass/vipReset"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "VIP/乐理课修改",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx6"
- }
- },
- {
- name: "vip详情",
- path: "vipDetail",
- component: () => import("@/views/vipClass/vipDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "vip详情",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx7"
- }
- },
- {
- name: "网管课详情",
- path: "accompanys",
- component: () => import("@/views/accompanyManager/accompanys"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "网管课详情",
- belongTopMenu: "/business",
- activeMenu: "/accompanyManager/accompany",
- id: "xx8"
- }
- },
- {
- name: "评价详情",
- path: "evaluateDetail",
- component: () => import("@/views/evaluateManager/evaluateDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "评价详情",
- belongTopMenu: "/business",
- activeMenu: "/commentManager",
- id: "xx9"
- }
- },
- {
- name: "课外训练详情",
- path: "afterSchoolDetail",
- component: () =>
- import("@/views/afterSchoolManager/afterSchoolDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "训练详情",
- belongTopMenu: "/business",
- activeMenu: "/afterSchoolManager",
- id: "xx10"
- }
- },
- {
- name: "课外训练详情",
- path: "afterSchoolDetailold",
- component: () =>
- import("@/views/afterSchoolManager/oldafterScDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "训练详情",
- belongTopMenu: "/business",
- activeMenu: "/afterSchoolManager",
- id: "xx10"
- }
- },
- {
- name: "学员详情",
- path: "studentDetail",
- component: () => import("@/views/studentManager/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "学员详情",
- belongTopMenu: "/business",
- activeMenu: "/studentManager/studentList",
- id: "4083"
- }
- },
- {
- name: "老师详情",
- path: "teacherDetail",
- component: () => import("@/views/teacherManager/teacherDetail/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "老师详情",
- belongTopMenu: "/business",
- activeMenu: "/teacherManager/teacherList",
- id: "4118"
- }
- },
- {
- name: "老师修改",
- path: "teacherOperation",
- component: () =>
- import("@/views/teacherManager/teacherOperation/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "老师修改",
- belongTopMenu: "/business",
- activeMenu: "/teacherManager/teacherList",
- id: "4174"
- }
- },
- {
- name: "问答详情",
- path: "answer",
- component: () => import("@/views/reaplceMusicPlayer/answerList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "问答详情",
- belongTopMenu: "/business",
- activeMenu: "/otherManager/reaplceMusicPlayer",
- id: "4293"
- }
- },
- {
- name: "活动详情",
- path: "childrensdayDetail",
- component: () => import("@/views/childrensDay/detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "活动详情",
- belongTopMenu: "/business",
- activeMenu: "/childrensDay"
- }
- },
- {
- name: "新建直播课",
- path: "createLiveClass",
- component: () => import("@/views/liveClassManager/newLiveClass"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "新建直播课",
- belongTopMenu: "/business",
- activeMenu: "/liveClassManager"
- }
- },
- {
- name: "商品设置",
- path: "liveShopControl",
- component: () => import("@/views/liveClassManager/liveShopControl"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "商品设置",
- belongTopMenu: "/business",
- activeMenu: "/liveClassManager"
- }
- },
- {
- name: "直播课详情",
- path: "liveClassDetail",
- component: () => import("@/views/liveClassManager/liveClassDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "直播课详情",
- belongTopMenu: "/business",
- activeMenu: "/liveClassManager"
- }
- },
- {
- name: "黑名单",
- path: "liveBlackList",
- component: () => import("@/views/liveClassManager/studentBlacklist"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "黑名单",
- belongTopMenu: "/business",
- activeMenu: "/liveClassManager"
- }
- },
- {
- name: "直播学员",
- path: "liveStudentList",
- component: () => import("@/views/liveClassManager/addStudentList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "直播学员",
- belongTopMenu: "/business",
- activeMenu: "/liveClassManager"
- }
- },
- {
- name: "学员缴费设置",
- path: "studentPaySet",
- component: () =>
- import("@/views/resetTeaming/components/payInfoDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "学员缴费设置",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx3"
- }
- },
- {
- name: "乐团详情",
- path: "resetTeaming",
- component: () => import("@/views/resetTeaming/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团详情",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "3953"
- }
- },
- {
- name: "乐团档案",
- path: "musicArchices",
- component: () =>
- import("@/views/resetTeaming/components/musicArchices"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "乐团档案",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx4"
- }
- },
- //musicArchices
- {
- name: "会员排课列表",
- path: "memberClassList",
- component: () =>
- import("@/views/teamDetail/components/memberClassList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "会员排课列表",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xx28"
- }
- },
- {
- name: "相册详情",
- path: "photo-detail",
- component: () => import("@/views/photo-detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "相册详情",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xxx28"
- }
- },
- // 相册详情
- {
- name: "全部证书",
- path: "performance",
- component: () => import("@/views/photo-detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "全部证书",
- belongTopMenu: "/business",
- activeMenu: "/teamList",
- id: "xxx28"
- }
- },
- // 全部证书
- {
- name: "新建vip",
- path: "buildVip",
- component: () => import("@/views/buildVip/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "VIP/乐理课申请",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx5"
- }
- },
- {
- name: "网管课",
- path: "newPractice",
- component: () => import("@/views/buildVip/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "网管课申请",
- belongTopMenu: "/business",
- activeMenu: "/accompanyManager/accompany",
- id: "xx5"
- }
- },
- {
- name: "vip修改",
- path: "vipReset",
- component: () => import("@/views/vipClass/vipReset"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "VIP/乐理课修改",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx6"
- }
- },
- {
- name: "vip详情",
- path: "vipDetail",
- component: () => import("@/views/vipClass/vipDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "vip详情",
- belongTopMenu: "/business",
- activeMenu: "/vipManager/vipList",
- id: "xx7"
- }
- },
- {
- name: "网管课详情",
- path: "accompanys",
- component: () => import("@/views/accompanyManager/accompanys"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "网管课详情",
- belongTopMenu: "/business",
- activeMenu: "/accompanyManager/accompany",
- id: "xx8"
- }
- },
- {
- name: "评价详情",
- path: "evaluateDetail",
- component: () => import("@/views/evaluateManager/evaluateDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "评价详情",
- belongTopMenu: "/business",
- activeMenu: "/commentManager",
- id: "xx9"
- }
- },
- {
- name: "课外训练详情",
- path: "afterSchoolDetail",
- component: () =>
- import("@/views/afterSchoolManager/afterSchoolDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "VIP/乐理课详情",
- belongTopMenu: "/business",
- activeMenu: "/afterSchoolManager",
- id: "xx10"
- }
- },
- {
- name: "学员详情",
- path: "studentDetail",
- component: () => import("@/views/studentManager/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "学员详情",
- belongTopMenu: "/business",
- activeMenu: "/studentManager/studentList",
- id: "4083"
- }
- },
- {
- name: "老师详情",
- path: "teacherDetail",
- component: () => import("@/views/teacherManager/teacherDetail/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "老师详情",
- belongTopMenu: "/business",
- activeMenu: "/teacherManager/teacherList",
- id: "4118"
- }
- },
- {
- name: "老师修改",
- path: "teacherOperation",
- component: () =>
- import("@/views/teacherManager/teacherOperation/index"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "老师修改",
- belongTopMenu: "/business",
- activeMenu: "/teacherManager/teacherList",
- id: "4174"
- }
- },
- {
- name: "问答详情",
- path: "answer",
- component: () => import("@/views/reaplceMusicPlayer/answerList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "问答详情",
- belongTopMenu: "/business",
- activeMenu: "/otherManager/reaplceMusicPlayer",
- id: "4293"
- }
- },
- {
- name: "活动详情",
- path: "childrensdayDetail",
- component: () => import("@/views/childrensDay/detail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "活动详情",
- belongTopMenu: "/business",
- activeMenu: "/childrensDay"
- }
- }
- // /otherManager/reaplceMusicPlayer /reaplceMusicPlayer/answer
- ]);
- }
- if (route.path == "/operateManager") {
- route.children = route.children.concat([
- {
- name: "服务指标(详情)",
- path: "serverIndexDetail",
- component: () => import("@/views/operateManager/serverIndexDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "服务指标(详情)",
- belongTopMenu: "/operateManager",
- activeMenu: "/serverIndexManager/serverIndexList",
- id: "3513"
- }
- },
- {
- name: "新建活动方案",
- path: "vipNewActive",
- component: () => import("@/views/categroyManager/vipNewActive"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "新建活动方案",
- belongTopMenu: "/operateManager",
- activeMenu: "/vipActiveManager/vipActiveList",
- id: "3558"
- }
- },
- {
- name: "活动资格管理",
- path: "activeSenior",
- component: () => import("@/views/categroyManager/activeSenior"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "活动资格管理",
- belongTopMenu: "/operateManager",
- activeMenu: "/vipActiveManager/vipActiveList",
- id: "4610"
- }
- },
- // activeSenior
- {
- name: "添加阶梯奖励",
- path: "branchActiveOperationAdd",
- component: () =>
- import("@/views/categroyManager/insideSetting/branchActiveOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加阶梯奖励",
- belongTopMenu: "/operateManager",
- activeMenu: "/operateManager/branchActiveManager/branchActive",
- id: "3527"
- }
- },
- {
- name: "修改阶梯奖励",
- path: "branchActiveOperation",
- component: () =>
- import("@/views/categroyManager/insideSetting/branchActiveOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "修改阶梯奖励",
- belongTopMenu: "/operateManager",
- activeMenu: "/operateManager/branchActiveManager/branchActive",
- id: "3528"
- }
- },
- {
- name: "添加问卷",
- path: "questionOperations",
- component: () => import("@/views/setQuestions/operation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加问卷",
- belongTopMenu: "/operateManager",
- activeMenu: "/operateManager/setQuestions",
- id: "4286"
- }
- },
- {
- name: "2021memeberActionManager",
- path: "/2021memeberActionManager",
- component: () => import("@/views/2021memeberActionManager"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "2021会员活动",
- belongTopMenu: "/operateManager",
- activeMenu: "/activeMarketing",
- id: "4550"
- }
- },
- {
- name: "memberActiveDetail",
- path: "memberActiveDetail",
- component: () =>
- import("@/views/2021memeberActionManager/memberActiveDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "2021十一活动详情",
- belongTopMenu: "/operateManager",
- activeMenu: "/activeMarketing",
- id: "4551"
- }
- },
- {
- name: "2021double11List",
- path: "/2021double11List",
- component: () =>
- import("@/views/activityScheduling/2021double11List"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "双十一活动",
- belongTopMenu: "/operateManager",
- activeMenu: "/activeMarketing",
- id: "4594"
- }
- },
- {
- name: "2021doubleDetail",
- path: "2021doubleDetail",
- component: () =>
- import("@/views/activityScheduling/2021doubleDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "双十一活动详情",
- belongTopMenu: "/operateManager",
- activeMenu: "/activeMarketing",
- id: "4595"
- }
- },
- {
- name: "新增优惠券",
- path: "couponUpdate",
- component: () => import("@/views/couponManager/couponUpdate"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "新增优惠券",
- belongTopMenu: "/operateManager",
- activeMenu: "/couponManager",
- id: "4553"
- }
- },
- {
- name: "发放优惠券",
- path: "couponGrant",
- component: () => import("@/views/couponManager/couponGrant"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "发放优惠券",
- belongTopMenu: "/operateManager",
- activeMenu: "/couponManager",
- id: "xx19"
- }
- },
- {
- name: "答题详情",
- path: "userAskList",
- component: () => import("@/views/setQuestions/userAskList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "答题详情",
- belongTopMenu: "/operateManager",
- activeMenu: "/operateManager/setQuestions",
- id: "xx19"
- }
- },
- {
- name: "训练营详情",
- path: "aristCampDetail",
- component: () => import("@/views/littleArtistCamp/aristCampDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "训练营详情",
- belongTopMenu: "/operateManager",
- activeMenu: "/littleArtistCamp",
- id: "xx19"
- }
- },
- {
- name: "群聊详情",
- path: "chatDetail",
- component: () => import("@/views/groupChatManager/chatDetail"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "群聊详情",
- belongTopMenu: "/operateManager",
- activeMenu: "/groupChatManager",
- id: "xx19"
- }
- }
- ]);
- }
- 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: "4217"
- }
- },
- {
- name: "缴费项目列表",
- path: "payschoolList",
- component: () => import("@/views/branchPayManager/payschoolList"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "缴费项目列表",
- belongTopMenu: "/financialManager",
- activeMenu: "/branchPayManager",
- id: "4217"
- }
- }
- ]);
- }
- if (route.path == "/contentManager") {
- route.children = route.children.concat([
- {
- name: "帮助中心分类",
- path: "helpCategory",
- component: () => import("@/views/helpCenter/helpCategory"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "帮助中心分类",
- belongTopMenu: "/contentManager",
- activeMenu: "/contentManager/helpContent",
- id: "3596"
- }
- },
- {
- name: "添加&修改内容管理",
- path: "contentOperation",
- component: () => import("@/views/contentManager/contentOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加&修改内容管理",
- belongTopMenu: "/contentManager",
- activeMenu: "/contentManager/contentManager",
- id: "xx22"
- }
- }
- ]);
- }
- if (route.path == "/shopManager") {
- route.children = route.children.concat([
- {
- name: "进货清单",
- path: "purchaseLlist",
- component: () =>
- import("@/views/businessManager/shopManager/purchase-llist"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "进货清单",
- belongTopMenu: "/shopManager",
- activeMenu: "/shopList",
- id: "3618"
- }
- },
- {
- name: "添加修改商品",
- path: "shopOperation",
- component: () =>
- import("@/views/businessManager/shopManager/shopOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加修改商品",
- belongTopMenu: "/shopManager",
- activeMenu: "/shopList",
- id: "3617"
- }
- }
- ]);
- }
- if (route.path == "/systemManager") {
- route.children = route.children.concat([
- {
- name: "创建&修改汇付账号",
- path: "adapayOperation",
- component: () => import("@/views/adapayAccount/form"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "创建&修改汇付账号",
- belongTopMenu: "/systemManager",
- activeMenu: "/sysBasics/adapayManager",
- id: "3748"
- }
- },
- {
- name: "添加&查看时间充值活动",
- path: "entryOperation",
- component: () => import("@/views/app/entryOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加&查看时间充值活动",
- belongTopMenu: "/systemManager",
- activeMenu: "/sysBasics/entryActivities",
- id: "3773"
- }
- },
- {
- name: "添加&修改系统权限",
- path: "adminOperation",
- component: () =>
- import("@/views/categroyManager/insideSetting/adminOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加&修改系统权限",
- belongTopMenu: "/systemManager",
- activeMenu: "/adminManager",
- id: "3993"
- }
- },
- {
- name: "扣费记录",
- path: "chargingRecord",
- component: () => import("@/views/tenantSetting/chargingRecord.vue"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "扣费记录",
- belongTopMenu: "/systemManager",
- activeMenu: "/productService",
- id: "4741"
- }
- }
- // /parameter/adminManager adminOperation
- ]);
- }
- if (route.path == "/platformManager") {
- route.children = route.children.concat([
- {
- name: "添加&修改",
- path: "serviceOperation",
- component: () =>
- import("@/views/platformManager/serviceManager/form"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加&修改",
- belongTopMenu: "/platformManager",
- activeMenu: "/serviceManager/serviceList",
- id: "4631"
- }
- },
- {
- name: "添加&修改",
- path: "organOperation",
- component: () => import("@/views/organManager/organOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "添加&修改",
- belongTopMenu: "/platformManager",
- activeMenu: "/organManager/organList",
- id: "4652"
- }
- },
- {
- name: "平台角色设置",
- path: "adminOperation",
- component: () =>
- import("@/views/platformManager/paltformAdmin/paltformOperation"),
- hidden: true,
- meta: {
- noCache: "1",
- title: "平台角色设置",
- belongTopMenu: "/platformManager",
- activeMenu: "/platformAdminManger",
- id: "3993"
- }
- }
- ]);
- }
- });
- return accessedRoutes;
- }
- const actions = {
- generateRoutes({ commit }) {
- return new Promise(resolve => {
- // 获取接口返回的权限菜单
- getSilder().then(async res => {
- if (res.code == 200) {
- let result = addTopMenu(res.data);
- if (res.data?.length < 1) {
- // 一条权限都没有
- //退出 跳到登录页 提示'该账号无任何权限'
- // console.log(store.dispatch)
- await store.dispatch("user/logout");
- localStorage.removeItem("firstMenuUrl");
- // await this.$store.dispatch("permission/removePermission")
- Message.error("该用户无访问权限");
- router.push(`/login`);
- // window.location.reload();
- }
- let newData = recursionRouter(result);
- newData = getFirstMenu(newData);
- recursionPermission(res.data);
- let accessedRoutes;
- // 生成异步路由表
- accessedRoutes = generateAsyncRouter(asyncRoutes, newData);
- accessedRoutes = setDetailRoute(accessedRoutes);
- // console.log('生成出来的异步路由', accessedRoutes)
- // var result = accessedRoutes.concat({ path: '*', redirect: '/404', hidden: true })
- commit("SET_ROUTES", accessedRoutes);
- // commit('SET_PERMISSION', recursionPermission(res.data).flat(Infinity))
- window.localStorage.removeItem("permission");
- window.localStorage.setItem("permission", tempArr);
- this.dispatch("app/setDotStatus");
- this.dispatch("app/setServiceInfo"); // 获取机构信息,用于续费弹窗和个人信息
- resolve(accessedRoutes);
- }
- });
- });
- },
- removePermission({ commit }) {
- window.localStorage.removeItem("permission");
- commit("SET_PERMISSION", []);
- }
- };
- export default {
- namespaced: true,
- state,
- mutations,
- actions
- };
|