index.ts 3.62 KB
import {createRouter, createWebHistory} from "vue-router";

let routes = [
  {
    path: '/',
    name: 'index',
    //使用import可以路由懒加载,如果不使用,太多组件一起加载会造成白屏
    component: () => import('../layout/layout.vue'),
    children: [
      {
        //配置404页面
        path: '/:catchAll(.*)',
        name: '404',
        // @ts-ignore
        component: () => import('../view/404.vue'),
        meta: {title: '404', icon: ''}
      },
      {
        path: '/',
        name: 'index',
        component: () => import('../view/index.vue'),
        meta: {title: '首页', noCache: true, affix: true}
      },{
        path: '/report',
        name: 'report',
        component: () => import('../view/report/index.vue'),
        meta: {title: '信用报告', noCache: true, affix: true}
      }, {
        path: '/monitorIndex',
        name: 'monitorIndex',
        component: () => import('../view/creditService/monitorIndex.vue'),
        meta: {title: '信用服务', noCache: true, affix: true}
      },{
        path: '/analysis',
        name: 'analysis',
        component: () => import('../view/analysis/index.vue'),
        meta: {title: '统计分析', noCache: true, affix: true}
      },{
        path: '/database',
        name: 'database',
        component: () => import('../view/database/index.vue'),
        meta: {title: '企业数据库', noCache: true, affix: true}
      },{
        path: '/databaseDetail',
        name: 'databaseDetail',
        component: () => import('../view/database/detail.vue'),
        meta: {title: '企业详情', noCache: true, affix: true}
      }, {
        path: '/personCenter',
        name: 'personCenter',
        component: () => import('../view/personCenter/personCenter.vue'),
        meta: {title: '个人中心', noCache: true, affix: true},
        children: [
          {
            path: 'monitorEnterprise',
            name: 'monitorEnterprise',
            component: () => import('../view/personCenter/monitorEnterprise.vue'),
            meta: {title: '监控企业列表', noCache: true, affix: true},
            children: [
              {
                path: '',
                name: 'monitorList',
                component: () => import('../view/personCenter/monitorList.vue'),
                meta: {title: '当前账号监控企业列表', noCache: true, affix: true}
              }, {
                path: 'monitorListAll',
                name: 'monitorListAll',
                component: () => import('../view/personCenter/monitorListAll.vue'),
                meta: {title: '全部监控企业列表', noCache: true, affix: true}
              },
            ]
          }, {
            path: '',
            name: 'monitorSetting',
            component: () => import('../view/personCenter/monitorSetting.vue'),
            meta: {title: '风险动态监控设置', noCache: true, affix: true}
          }, {
            path: 'monitorManager',
            name: 'monitorManager',
            component: () => import('../view/personCenter/monitorManager.vue'),
            meta: {title: '风险动态监控维度', noCache: true, affix: true}
          },
        ]
      }
    ]
  }, {
    path: '/login',
    name: 'login',
    component: () => import('../view/login.vue'),
    meta: {title: '登录', noCache: true, affix: true}
  }, {
    path: '/enterprise',
    name: 'enterprise',
    component: () => import('../view/creditService/enterpriseRelations.vue'),
    meta: {title: '关联关系查询', noCache: true, affix: true}
  },
]
// 路由
const router = createRouter({
  history: createWebHistory(),
  routes
})
// 导出
export default router