Blame view

src/router/index.js 6.89 KB
be966eff   jack   1.添加文件
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
130
131
  import Vue from 'vue'
  import Router from 'vue-router'
  
  Vue.use(Router)
  
  /* Layout */
  import Layout from '@/layout'
  
  /**
   * Note: sub-menu only appear when route children.length >= 1
   * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
   *
   * hidden: true                   if set true, item will not show in the sidebar(default is false)
   * alwaysShow: true               if set true, will always show the root menu
   *                                if not set alwaysShow, when item has more than one children route,
   *                                it will becomes nested mode, otherwise not show the root menu
   * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
   * name:'router-name'             the name is used by <keep-alive> (must set!!!)
   * meta : {
      roles: ['admin','editor']    control the page roles (you can set multiple roles)
      title: 'title'               the name show in sidebar and breadcrumb (recommend set)
      icon: 'svg-name'             the icon show in the sidebar
      breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
      activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
    }
   */
  
  /**
   * constantRoutes
   * a base page that does not have permission requirements
   * all roles can be accessed
   */
  export const constantRoutes = [
    {
      path: '/login',
      component: () => import('@/views/login/index'),
      hidden: true
    },
  
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    },
  
    {
      path: '/',
      component: Layout,
      redirect: '/home',
      children: [
        {
          path: 'home',
          name: 'Home',
          component: () => import('@/views/home/index'),
          meta: { title: '首页', icon: 'el-icon-s-home', dec: '这是首页' }
        },
        {
          path: 'notice',
          name: 'Notice',
          component: () => import('@/views/home/notice/index'),
          meta: { title: '公告列表', activeMenu: '/home' },
          hidden: true
        }
      ]
    },
  
    {
      path: '/user',
      component: Layout,
      redirect: '/user/account',
      name: 'User',
      meta: { title: '用户管理', icon: 'el-icon-s-custom' },
      children: [
        {
          path: 'account',
          name: 'account',
          component: () => import('@/views/account/index'),
          meta: { title: '账号管理', dec: '这是表格页面' }
        },
        {
          path: 'role',
          name: 'role',
          component: () => import('@/views/role/index'),
          meta: { title: '角色管理', icon: '' }
        }
      ]
    },
  
    {
      path: '/classes',
      component: Layout,
      redirect: '/classes/classes',
      name: 'Classes',
      meta: { title: '班级管理', icon: 'classes1' },
      children: [
        {
          path: 'classes',
          name: 'Classes',
          component: () => import('@/views/classes/classes'),
          meta: { title: '班级管理' }
        },
        {
          path: 'classDetail',
          name: 'ClassDetail',
          component: () => import('@/views/classes/classes/page/detail'),
          meta: { title: '查看班级', activeMenu: '/classes/classes' },
          hidden: true
        },
        {
          path: 'add',
          name: 'Add',
          component: () => import('@/views/classes/classes/page/add'),
          meta: { title: '班级信息', activeMenu: '/classes/classes' },
          hidden: true
        },
        {
          path: 'blend',
          name: 'Blend',
          component: () => import('@/views/classes/blend'),
          meta: { title: '混班考试' }
        },
        {
          path: 'blendDetail',
          name: 'BlendDetail',
          component: () => import('@/views/classes/blend/detail'),
          meta: { title: '混班名册', activeMenu: '/classes/blend' },
          hidden: true
        }
      ]
    },
  
be966eff   jack   1.添加文件
132
    {
a61d16e2   jack   1.更新文件
133
      path: '/testpaper',
be966eff   jack   1.添加文件
134
      component: Layout,
a61d16e2   jack   1.更新文件
135
136
      redirect: '/testpaper/test',
      name: 'Testpaper',
be966eff   jack   1.添加文件
137
138
      meta: {
        title: '试卷管理',
a61d16e2   jack   1.更新文件
139
        icon: 'el-ump-shijuan'
be966eff   jack   1.添加文件
140
141
142
      },
      children: [
        {
a61d16e2   jack   1.更新文件
143
144
          path: 'test',
          component: () => import('@/views/testpaper/test/index'), // Parent router-view
c9033522   jack   更新前端代码
145
          name: 'Test',
a61d16e2   jack   1.更新文件
146
          meta: { title: '试卷管理' }
c9033522   jack   更新前端代码
147
148
149
150
151
152
153
        },
        {
          path: 'creatpaper',
          component: () => import('@/views/testpaper/page/creatpaper'), // Parent router-view
          name: 'Creatpaper',
          meta: { title: '创建试卷', activeMenu: '/testpaper/test' },
          hidden: true
be966eff   jack   1.添加文件
154
155
156
157
158
        }
      ]
    },
  
    {
a61d16e2   jack   1.更新文件
159
160
      path: '/analysis',
      name: 'Analysis',
be966eff   jack   1.添加文件
161
      component: Layout,
a61d16e2   jack   1.更新文件
162
163
      redirect: '/analysis/test',
      meta: { title: '考试分析', icon: 'el-icon-data-line' },
be966eff   jack   1.添加文件
164
165
      children: [
        {
a61d16e2   jack   1.更新文件
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
          path: 'test',
          component: () => import('@/views/analysis/test/index'), // Parent router-view
          name: 'Test',
          meta: { title: '考试纪录' }
        },
        {
          path: 'testdetail',
          component: () => import('@/views/analysis/test/page/testdetail'), // Parent router-view
          name: 'Testdetail',
          hidden: true,
          meta: { title: '答题详情', activeMenu: '/analysis/test' }
        },
        {
          path: 'testinfo',
          component: () => import('@/views/analysis/page/testinfo'), // Parent router-view
          name: 'Testinfo',
          hidden: true,
          meta: { title: '考试分析', activeMenu: '/analysis/test' }
        },
        {
          path: 'classes1',
          component: () => import('@/views/analysis/classes/index'), // Parent router-view
          name: 'Classes1',
          meta: { title: '班级分析' }
        },
        {
          path: 'testpaper',
          component: () => import('@/views/analysis/testpaper/index'), // Parent router-view
          name: 'Testpaper',
          meta: { title: '试卷统计' }
be966eff   jack   1.添加文件
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
        }
      ]
    },
  
    {
      path: '/system',
      component: Layout,
      redirect: '/system/setdata',
      name: 'System',
      meta: { title: '系统设置', icon: 'el-icon-s-tools' },
      children: [
        {
          path: 'setdata',
          name: 'Setdata',
          component: () => import('@/views/system/setdata'),
          meta: { title: '参数设置', icon: '' }
        }, {
          path: 'setobject',
          name: 'Setobject',
          component: () => import('@/views/system/setobject'),
          meta: { title: '科目设置', icon: '' }
a61d16e2   jack   1.更新文件
217
218
219
220
221
222
        },
        {
          path: 'feedback',
          name: 'Feedback',
          component: () => import('@/views/system/feedback'),
          meta: { title: '意见反馈', icon: '' }
be966eff   jack   1.添加文件
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
        }
      ]
    },
  
    // 404 page must be placed at the end !!!
    { path: '*', redirect: '/404', hidden: true }
  ]
  
  const createRouter = () =>
    new Router({
      // mode: 'history', // require service support
      scrollBehavior: () => ({ y: 0 }),
      routes: constantRoutes
    })
  
  const router = createRouter()
  
  // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  export function resetRouter() {
    const newRouter = createRouter()
    router.matcher = newRouter.matcher // reset router
  }
  
  export default router