index.js 4.84 KB
Newer Older
wanli's avatar
wanli committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
import Vue from 'vue'
import Router from 'vue-router'
import store from '../store'

import UserLayout from '@/layouts/UserLayout'
import BasicLayout from '@/layouts/BasicLayout'
import BlankLayout from '@/layouts/BlankLayout'

Vue.use(Router)

const router = new Router({
  routes: [
    // user
    {
      path: '/user',
      component: UserLayout,
      children: [
        { path: '/user', redirect: '/user/login' },
        { path: '/user/login', component: () => import('@/views/User/Login') },
        { path: '/user/register', component: () => import('@/views/User/Register') },
      ],
    },
    // app
    {
      path: '/',
      component: BasicLayout,
      children: [
        // dashboard
        { path: '/', redirect: '/dashboard/analysis' },
        {
          path: '/dashboard',
          name: 'dashboard',
          component: BlankLayout,
          children: [
            { path: '/dashboard/analysis', name: 'analysis', component: () => import('@/views/Dashboard/Analysis') },
            // { path: '/dashboard/monitor', name: 'monitor', component: () => import('@/views/Dashboard/Analysis') },
            { path: '/dashboard/workplace', name: 'workplace', component: () => import('@/views/Dashboard/Workplace') },
          ]
        },
        // {
        //   path: '/form',
        //   name: 'form',
        //   icon: 'form',
        //   component: BlankLayout,
        //   children: [
        //     { path: '/form/basic-form', name: 'basicform', component: () => import('@/views/Dashboard/Analysis') },
        //     {
        //       path: '/form/step-form',
        //       name: 'stepform',
        //       component: BlankLayout,
        //       hideChildrenInMenu: true,
        //       children: [
        //         {
        //           path: '/form/step-form/info',
        //           name: 'info',
        //           component: () => import('@/views/Dashboard/Analysis'),
        //         },
        //       ]
        //     },
        //     { path: '/form/advanced-form', name: 'advancedform', component: () => import('@/views/Dashboard/Analysis') },
        //   ]
        // },
        // {
        //   path: '/list',
        //   icon: 'table',
        //   name: 'list',
        //   component: BlankLayout,
        //   children: [
        //     {
        //       path: '/list/search',
        //       name: 'searchlist',
        //       component: BlankLayout,
        //       children: [
        //         {
        //           path: '/list/search/articles',
        //           name: 'articles',
        //         },
        //         {
        //           path: '/list/search/projects',
        //           name: 'projects',
        //         },
        //         {
        //           path: '/list/search/applications',
        //           name: 'applications',
        //         },
        //       ]
        //     }
        //   ]
        // },
        // {
        //   path: '/profile',
        //   icon: 'profile',
        //   name: 'profile',
        // },
        {
          path: '/system',
          name: 'system',
          component: BlankLayout,
          children: [
            {
              path: '/system/setting',
              name: 'setting',
              component: BlankLayout,
              children: [
                {
                  path: '/system/setting/menu',
                  name: 'menu',
                  component: () => import('@/views/System/Menu')
                },
                {
                  path: '/system/setting/module',
                  name: 'module',
                  component: () => import('@/views/System/Role')
                },
                {
                  path: '/system/setting/config',
                  name: 'config',
                  component: () => import('@/views/System/Role')
                },
                {
                  path: '/system/setting/dict',
                  name: 'dict',
                  component: () => import('@/views/System/Role')
                },
                {
                  path: '/system/setting/area',
                  name: 'area',
                  component: () => import('@/views/System/Role')
                },
wanli's avatar
wanli committed
130 131 132 133 134
                {
                  path: '/system/setting/file-manager',
                  name: 'file-manager',
                  component: () => import('@/views/FileManager/FileManager')
                },
wanli's avatar
wanli committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
              ]
            },
            {
              path: '/system/role',
              name: 'role',
              component: () => import('@/views/System/Role')
            },
            {
              path: '/system/admin',
              name: 'admin',
              component: () => import('@/views/System/Role')
            }
          ]
        },
      ]
    },

  ]
})

router.afterEach(() => {
  store.commit('global/UpdateBasicLayoutSpinning', false);
});

export default router