import myWorkbenches from './modules/myWorkbenches';
import serviceUnit from './modules/serviceUnit';
import sop from './modules/sop';
import resourceGuard from './modules/resourceGuard';
import workHours from './modules/workHours';
import projectQuality from './modules/projectQuality';
import User from './modules/user';
import System from './modules/system';
import Report from './modules/report';
import Intelligence from './modules/intelligence';
const asyncRoutes = [
  myWorkbenches,
  serviceUnit,
  sop,
  resourceGuard,
  workHours,
  projectQuality,
  User,
  System,
  Report,
  Intelligence,
];
export const moduleMap = asyncRoutes.reduce((obj, item) => {
  obj[item.path.slice(1)] = item.name;
  return obj;
}, {});

//用户得登录后才有的非菜单的路由白名单，与菜单权限无关，
//比如依赖登录后的自我修改密码界面(点击右上角的头像下拉菜单里的“修改密码”)
export const routesNotMenu = [
  {
    name: 'PasswordModify',
    path: '/bootstrap/password-modify',
    component: () => import('@/views/password-modify/index.vue'),
    meta: {
      title: '密码修改',
      mount: 'Bootstrap', //需要挂载在哪个路由节点下
    },
  },
  {
    name: 'SopStep',
    path: '/sop/sop-manage/sop-step',
    component: () => import('@/views/sop/sop-manage/sop-step/index.vue'),
    meta: {
      title: '教务处SOP流程',
      mount: 'SopManage',
    },
  },
  {
    name: 'StuSopStep',
    path: '/sop/sop-manage/stu-sop-step',
    component: () => import('@/views/sop/sop-manage/stu-sop-step/index.vue'),
    meta: {
      title: '研究生SOP流程',
      mount: 'SopManage',
    },
  },
];

//菜单的白名单，比如“我的工作台”，不依赖权限配置，只要登录，就能加入菜单
export const whiteMenuList = [
  {
    id: '1000',
    name: '我的工作台',
    parentId: '-1',
    url: 'workManage',
    sort: 0,
    type: 'MENU',
  },
  {
    id: '1001',
    parentId: '1000',
    url: 'workChildManage',
    name: '工作台',
    sort: 1,
    type: 'MENU',
  },
  {
    id: '1002',
    parentId: '1001',
    url: 'message',
    name: '消息提醒',
    sort: 2,
    type: 'MENU',
  },
  {
    id: '1003',
    parentId: '1001',
    url: 'work',
    name: '待办任务',
    sort: 3,
    type: 'MENU',
  },
  {
    id: '1004',
    parentId: '1001',
    url: 'notice',
    name: '通知公告',
    sort: 4,
    type: 'MENU',
  },
];

//开发阶段临时创造的菜单白名单，等后端接口菜单完善后弃用
export const devPushMenuList = [
  // {
  //   id: '2000',
  //   name: '数据驾驶舱',
  //   parentId: '-1',
  //   url: 'test',
  //   type: 'MENU',
  // },
  // {
  //   id: '2001',
  //   name: '派单分析',
  //   parentId: '2000',
  //   url: 'test1',
  //   type: 'MENU',
  // },
  // {
  //   id: '2002',
  //   name: '服务单元分析',
  //   parentId: '2000',
  //   url: 'test2',
  //   type: 'MENU',
  // },
  // {
  //   id: '2003',
  //   name: 'SOP预警监控',
  //   parentId: '2000',
  //   url: 'test3',
  //   type: 'MENU',
  // },
  // {
  //   id: '2004',
  //   name: '项目进度监控',
  //   parentId: '2000',
  //   url: 'test4',
  //   type: 'MENU',
  // },
  // {
  //   id: '2005',
  //   name: '设备保障监控',
  //   parentId: '2000',
  //   url: 'test5',
  //   type: 'MENU',
  // },
  // {
  //   id: '2006',
  //   name: '质量监控分析',
  //   parentId: '2000',
  //   url: 'test6',
  //   type: 'MENU',
  // },
];

export default asyncRoutes;
