Blame view

src/router/index.js 6.47 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 25 26 27
    path: '/404',
    component: () => import('@/views/error-page/404'),
    hidden: true
  },
任超 committed
28
  { path: '*', redirect: '/404', hidden: true },
29 30 31 32 33 34 35
  // 业务流程框架
  {
    path: '/workFrame',
    component: () => import('@/views/ywbl/fqsq/workFrame.vue'),
    name: 'workFrame',
    hidden: true,
    meta: { title: '发起申请' }
任超 committed
36
  }
任超 committed
37 38 39 40 41 42 43
]

/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
export const asyncRoutes = [
任超 committed
44
  {
赵千 committed
45 46 47
    path: '/',
    component: Layout,
    redirect: '/home',
任超 committed
48
    meta: { title: '首页' },
赵千 committed
49 50 51 52 53
    children: [
      {
        path: 'home',
        component: () => import('@/views/home/index'),
        name: 'Dashboard',
任超 committed
54
        meta: { title: '工作台', icon: 'workbench', affix: true }
赵千 committed
55 56 57 58
      }
    ]
  },
  {
59
    path: '/ywbl',
60
    id: '2',
赵千 committed
61 62
    parentId: null,
    component: Layout,
任超 committed
63
    meta: { title: '业务办理', icon: 'ywbl' },
64
    redirect: '/ywbl/ywsq/ywsq',
赵千 committed
65
    alwaysShow: true,
66
    name: 'ywbl',
赵千 committed
67 68
    children: [
      {
69
        path: 'ywsq',
70 71
        id: '21',
        parentId: '2',
72
        component: () => import('@/views/ywbl/ywsq/ywsq.vue'),
73
        name: 'ywsq',
任超 committed
74
        meta: { title: '业务申请' }
任超 committed
75 76
      },
      {
77
        path: 'dbx',
78 79
        id: '22',
        parentId: '2',
80
        component: () => import('@/views/ywbl/dbx/dbx.vue'),
81
        name: 'dbx',
任超 committed
82 83 84
        meta: { title: '待办箱' }
      },
      {
85
        path: 'ybx',
86 87
        id: '23',
        parentId: '2',
88
        component: () => import('@/views/ywbl/ybx/ybx.vue'),
89
        name: 'ybx',
任超 committed
90
        meta: { title: '已办箱' }
任超 committed
91
      },
任超 committed
92 93 94
    ]
  },
  {
95
    path: '/sqcx',
96
    id: '3',
任超 committed
97 98
    parentId: null,
    component: Layout,
任超 committed
99
    meta: { title: '申请查询', icon: 'sqcx' },
100
    redirect: '/sqcx/jtfc',
任超 committed
101
    alwaysShow: true,
102
    name: 'sqcx',
任超 committed
103 104
    children: [
      {
105
        path: 'jtfc',
106 107
        id: '31',
        parentId: '3',
108
        component: () => import('@/views/sqcx/jtfc/jtfc.vue'),
109
        name: 'jtfc',
任超 committed
110 111 112
        meta: { title: '家庭房产' }
      },
      {
113
        path: 'dydjb',
114 115
        id: '32',
        parentId: '3',
116
        component: () => import('@/views/sqcx/dydjb/dydjb.vue'),
117
        name: 'dydjb',
任超 committed
118 119 120
        meta: { title: '打印登记薄' }
      },
      {
jiaozeping@pashanhoo.com committed
121
        path: 'sqcxjl',
122 123
        id: '33',
        parentId: '3',
jiaozeping@pashanhoo.com committed
124
        component: () => import('@/views/sqcx/sqcxjl/sqcxjl.vue'),
125
        name: 'cxjl',
jiaozeping@pashanhoo.com committed
126
        meta: { title: '申请查询记录' }
任超 committed
127 128 129 130
      }
    ]
  },
  {
131
    path: '/zhcx',
132
    id: '4',
任超 committed
133 134
    parentId: null,
    component: Layout,
任超 committed
135
    meta: { title: '综合查询', icon: 'zhcx' },
136
    redirect: '/zhcx/jdcx',
任超 committed
137
    alwaysShow: true,
138
    name: 'zhcx',
任超 committed
139 140
    children: [
      {
141
        path: 'jdcx',
142 143
        id: '41',
        parentId: '4',
144
        component: () => import('@/views/zhcx/jdcx/jdcx.vue'),
145
        name: 'jdcx',
任超 committed
146 147 148
        meta: { title: '进度查询' }
      },
      {
149
        path: 'djbcx',
150 151
        id: '42',
        parentId: '4',
152
        component: () => import('@/views/zhcx/djbcx/djbcx.vue'),
153
        name: 'djbcx',
任超 committed
154 155 156
        meta: { title: '登记簿查询' }
      },
      {
157
        path: 'lpcx',
158 159
        id: '43',
        parentId: '4',
160
        component: () => import('@/views/zhcx/lpcx/lpcx.vue'),
161
        name: 'lpcx',
任超 committed
162
        meta: { title: '楼盘查询' }
任超 committed
163 164 165 166 167 168 169 170
      },
      {
        path: 'zslqcx',
        id: '45',
        parentId: '4',
        component: () => import('@/views/zhcx/zslqcx/zslqcx.vue'),
        name: 'zslqcx',
        meta: { title: '证书领取查询' }
任超 committed
171 172 173 174 175 176 177 178 179 180
      },
      // 在建工程抵押查询
      {
        path: 'zxgcdycx',
        id: '46',
        parentId: '4',
        component: () => import('@/views/zhcx/zxgcdycx/zxgcdycx.vue'),
        name: 'zxgcdycx',
        meta: { title: '在建工程抵押' }
      },
任超 committed
181 182 183
    ]
  },
  {
184
    path: '/zsgl',
185
    id: '5',
任超 committed
186 187
    parentId: null,
    component: Layout,
任超 committed
188
    meta: { title: '证书管理', icon: 'zsgl' },
189
    redirect: '/zsgl/zsrk',
任超 committed
190
    alwaysShow: true,
191
    name: 'zsgl',
任超 committed
192 193
    children: [
      {
194
        path: 'zsrk',
195 196
        id: '51',
        parentId: '5',
197
        component: () => import('@/views/zsgl/zsrk/zsrk.vue'),
198
        name: 'zsrk',
任超 committed
199 200 201
        meta: { title: '证书入库' }
      },
      {
202
        path: 'zsff',
203 204
        id: '52',
        parentId: '5',
205
        component: () => import('@/views/zsgl/zsff/zsff.vue'),
206
        name: 'zsff',
任超 committed
207 208 209
        meta: { title: '证书分发' }
      },
      {
210
        path: 'zssyjl',
211 212
        id: '53',
        parentId: '5',
213
        component: () => import('@/views/zsgl/zssyjl/zssyjl.vue'),
214
        name: 'zssyjl',
任超 committed
215
        meta: { title: '证书使用记录' }
任超 committed
216
      },
任超 committed
217 218 219 220
    ]
  },
  {
    path: '/system',
221
    id: '9',
任超 committed
222 223
    parentId: null,
    component: Layout,
任超 committed
224
    meta: { title: '系统管理', icon: 'system' },
任超 committed
225 226 227 228 229 230
    redirect: '/system/dictionaries',
    alwaysShow: true,
    name: 'system',
    children: [
      {
        path: 'dictionaries',
231 232
        id: '91',
        parentId: '9',
任超 committed
233
        component: () => import('@/views/system/dictionaries/dictionaries.vue'),
任超 committed
234 235
        name: 'dictionaries',
        meta: { title: '字典管理' }
236 237 238 239 240 241 242 243
      },
      {
        path: 'sqywgz',
        id: '92',
        parentId: '9',
        component: () => import('@/views/system/sqywgz/sqywgz.vue'),
        name: 'sqywgz',
        meta: { title: '申请业务规则' }
244 245 246 247 248 249 250 251
      },
      {
        path: 'qtjfjmb',
        id: '93',
        parentId: '9',
        component: () => import('@/views/system/qtjfjmb/qtjfjmb.vue'),
        name: 'qtjfjmb',
        meta: { title: '其他及附记模板' }
任超 committed
252 253 254 255 256 257 258 259 260
      },
      {
        path: 'dymbgl',
        id: '94',
        parentId: '9',
        component: () => import('@/views/system/dymbgl/dymbgl.vue'),
        name: 'dymbgl',
        meta: { title: '打印模板管理' }
      },
赵千 committed
261 262 263 264 265 266 267
    ]
  }
]

const createRouter = () =>
  new Router({
    scrollBehavior: () => ({ y: 0 }),
任超 committed
268
    routes: [...constantRoutes, ...asyncRoutes]
赵千 committed
269 270 271 272 273 274 275 276 277 278
  })

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