Blame view

src/router/index.js 7.58 KB
赵千 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
/* Layout */
import Layout from '@/layout'

/* Router Modules */
// import componentsRouter from './modules/components'

export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
任超 committed
24
    path: '/404',
任超 committed
25 26
    component: Layout,
    hidden: true,
任超 committed
27
    redirect: '/404/index',
任超 committed
28 29
    children: [
      {
任超 committed
30
        path: '/index',
任超 committed
31 32 33 34 35
        component: () => import('@/views/error-page/404'),
        name: '404',
        meta: { title: '404' }
      }
    ]
任超 committed
36
  },
37 38 39
  // 业务流程框架
  {
    path: '/workFrame',
任超 committed
40
    component: () => import('@/views/workflow/workFrame.vue'),
41 42 43
    name: 'workFrame',
    hidden: true,
    meta: { title: '发起申请' }
44 45 46 47 48 49 50 51
  },
  // 业务流程只读框架
  {
    path: '/workFrameView',
    component: () => import('@/views/workflow/workFrameView.vue'),
    name: 'workFrameView',
    hidden: true,
    meta: { title: '发起申请' }
任超 committed
52
  }
任超 committed
53 54 55 56 57 58
]
/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
export const asyncRoutes = [
任超 committed
59
  {
赵千 committed
60 61 62
    path: '/',
    component: Layout,
    redirect: '/home',
任超 committed
63
    meta: { title: '首页' },
赵千 committed
64 65 66 67
    children: [
      {
        path: 'home',
        component: () => import('@/views/home/index'),
任超 committed
68
        name: 'home',
任超 committed
69
        meta: { title: '工作台', icon: 'workbench', affix: true }
赵千 committed
70 71 72 73
      }
    ]
  },
  {
74
    path: '/ywbl',
75
    id: '2',
赵千 committed
76 77
    parentId: null,
    component: Layout,
任超 committed
78
    meta: { title: '业务办理', icon: 'ywbl' },
任超 committed
79
    redirect: '/ywbl/ywsq',
80
    name: 'ywbl',
赵千 committed
81 82
    children: [
      {
83
        path: 'ywsq',
84 85
        id: '21',
        parentId: '2',
86
        component: () => import('@/views/ywbl/ywsq/ywsq.vue'),
87
        name: 'ywsq',
任超 committed
88
        meta: { title: '业务申请' }
任超 committed
89 90
      },
      {
91
        path: 'dbx',
92 93
        id: '22',
        parentId: '2',
94
        component: () => import('@/views/ywbl/dbx/dbx.vue'),
95
        name: 'dbx',
任超 committed
96 97 98
        meta: { title: '待办箱' }
      },
      {
99
        path: 'ybx',
100 101
        id: '23',
        parentId: '2',
102
        component: () => import('@/views/ywbl/ybx/ybx.vue'),
103
        name: 'ybx',
任超 committed
104
        meta: { title: '已办箱' }
任超 committed
105
      },
任超 committed
106 107 108
    ]
  },
  {
109
    path: '/sqcx',
110
    id: '3',
任超 committed
111 112
    parentId: null,
    component: Layout,
任超 committed
113
    meta: { title: '申请查询', icon: 'sqcx' },
114
    redirect: '/sqcx/jtfc',
任超 committed
115
    alwaysShow: true,
116
    name: 'sqcx',
任超 committed
117 118
    children: [
      {
119
        path: 'jtfc',
120 121
        id: '31',
        parentId: '3',
122
        component: () => import('@/views/sqcx/jtfc/jtfc.vue'),
123
        name: 'jtfc',
任超 committed
124 125 126
        meta: { title: '家庭房产' }
      },
      {
127
        path: 'dydjb',
128 129
        id: '32',
        parentId: '3',
130
        component: () => import('@/views/sqcx/dydjb/dydjb.vue'),
131
        name: 'dydjb',
任超 committed
132 133 134
        meta: { title: '打印登记薄' }
      },
      {
jiaozeping@pashanhoo.com committed
135
        path: 'sqcxjl',
136 137
        id: '33',
        parentId: '3',
jiaozeping@pashanhoo.com committed
138
        component: () => import('@/views/sqcx/sqcxjl/sqcxjl.vue'),
139
        name: 'cxjl',
jiaozeping@pashanhoo.com committed
140
        meta: { title: '申请查询记录' }
任超 committed
141 142 143 144
      }
    ]
  },
  {
145
    path: '/zhcx',
146
    id: '4',
任超 committed
147 148
    parentId: null,
    component: Layout,
任超 committed
149
    meta: { title: '综合查询', icon: 'zhcx' },
150
    redirect: '/zhcx/jdcx',
任超 committed
151
    alwaysShow: true,
152
    name: 'zhcx',
任超 committed
153 154
    children: [
      {
155
        path: 'jdcx',
156 157
        id: '41',
        parentId: '4',
158
        component: () => import('@/views/zhcx/jdcx/jdcx.vue'),
159
        name: 'jdcx',
任超 committed
160 161 162
        meta: { title: '进度查询' }
      },
      {
163
        path: 'djbcx',
164 165
        id: '42',
        parentId: '4',
166
        component: () => import('@/views/zhcx/djbcx/djbcx.vue'),
167
        name: 'djbcx',
任超 committed
168 169 170
        meta: { title: '登记簿查询' }
      },
      {
171
        path: 'lpcx',
172 173
        id: '43',
        parentId: '4',
174
        component: () => import('@/views/zhcx/lpcx/lpcx.vue'),
175
        name: 'lpcx',
任超 committed
176
        meta: { title: '楼盘查询' }
任超 committed
177 178 179 180 181 182 183 184
      },
      {
        path: 'zslqcx',
        id: '45',
        parentId: '4',
        component: () => import('@/views/zhcx/zslqcx/zslqcx.vue'),
        name: 'zslqcx',
        meta: { title: '证书领取查询' }
任超 committed
185 186 187 188 189 190 191 192 193 194
      },
      // 在建工程抵押查询
      {
        path: 'zxgcdycx',
        id: '46',
        parentId: '4',
        component: () => import('@/views/zhcx/zxgcdycx/zxgcdycx.vue'),
        name: 'zxgcdycx',
        meta: { title: '在建工程抵押' }
      },
任超 committed
195 196 197
    ]
  },
  {
198
    path: '/zsgl',
199
    id: '5',
任超 committed
200 201
    parentId: null,
    component: Layout,
任超 committed
202
    meta: { title: '证书管理', icon: 'zsgl' },
203
    redirect: '/zsgl/zsrk',
任超 committed
204
    alwaysShow: true,
205
    name: 'zsgl',
任超 committed
206 207
    children: [
      {
208
        path: 'zsrk',
209 210
        id: '51',
        parentId: '5',
211
        component: () => import('@/views/zsgl/zsrk/zsrk.vue'),
212
        name: 'zsrk',
任超 committed
213 214 215
        meta: { title: '证书入库' }
      },
      {
216
        path: 'zsff',
217 218
        id: '52',
        parentId: '5',
219
        component: () => import('@/views/zsgl/zsff/zsff.vue'),
220
        name: 'zsff',
任超 committed
221 222 223
        meta: { title: '证书分发' }
      },
      {
224
        path: 'zssyjl',
225 226
        id: '53',
        parentId: '5',
227
        component: () => import('@/views/zsgl/zssyjl/zssyjl.vue'),
228
        name: 'zssyjl',
任超 committed
229
        meta: { title: '证书使用记录' }
任超 committed
230
      },
任超 committed
231 232 233 234
    ]
  },
  {
    path: '/system',
235
    id: '9',
任超 committed
236 237
    parentId: null,
    component: Layout,
任超 committed
238
    meta: { title: '系统管理', icon: 'system' },
任超 committed
239 240 241 242 243 244
    redirect: '/system/dictionaries',
    alwaysShow: true,
    name: 'system',
    children: [
      {
        path: 'dictionaries',
245 246
        id: '91',
        parentId: '9',
任超 committed
247
        component: () => import('@/views/system/dictionaries/dictionaries.vue'),
任超 committed
248 249
        name: 'dictionaries',
        meta: { title: '字典管理' }
250 251 252 253 254 255 256 257
      },
      {
        path: 'sqywgz',
        id: '92',
        parentId: '9',
        component: () => import('@/views/system/sqywgz/sqywgz.vue'),
        name: 'sqywgz',
        meta: { title: '申请业务规则' }
258 259 260 261 262 263 264 265
      },
      {
        path: 'qtjfjmb',
        id: '93',
        parentId: '9',
        component: () => import('@/views/system/qtjfjmb/qtjfjmb.vue'),
        name: 'qtjfjmb',
        meta: { title: '其他及附记模板' }
任超 committed
266 267 268 269 270 271 272 273 274
      },
      {
        path: 'dymbgl',
        id: '94',
        parentId: '9',
        component: () => import('@/views/system/dymbgl/dymbgl.vue'),
        name: 'dymbgl',
        meta: { title: '打印模板管理' }
      },
赵千 committed
275
    ]
蔡俊立 committed
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
  },
  {
    path: '/xtjk',
    id: '6',
    parentId: null,
    component: Layout,
    meta: { title: '系统监控', icon: 'system' },
    redirect: '/xtjk/cwrz',
    alwaysShow: true,
    name: 'xtjk',
    children: [
      {
        path: 'cwrz',
        id: '61',
        parentId: '6',
        component: () => import('@/views/xtjk/cwrz/cwrz.vue'),
        name: 'cwrz',
        meta: { title: '错误日志' }
      },
      {
        path: 'czrz',
        id: '62',
        parentId: '6',
        component: () => import('@/views/xtjk/czrz/czrz.vue'),
        name: 'czrz',
        meta: { title: '操作日志' }
      },
蔡俊立 committed
303 304 305 306 307 308 309 310
      {
        path: 'zjjk',
        id: '63',
        parentId: '6',
        component: () => import('@/views/xtjk/zjjk/zjjk.vue'),
        name: 'zjjk',
        meta: { title: '主机监控' }
      },
蔡俊立 committed
311
    ]
赵千 committed
312 313 314 315 316 317
  }
]

const createRouter = () =>
  new Router({
    scrollBehavior: () => ({ y: 0 }),
任超 committed
318
    routes: [...constantRoutes]
赵千 committed
319 320 321 322 323 324 325 326 327 328
  })

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