Blame view

src/router/index.js 6.61 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
  },
28 29 30
  // 业务流程框架
  {
    path: '/workFrame',
任超 committed
31
    component: () => import('@/views/workflow/workFrame.vue'),
32 33 34
    name: 'workFrame',
    hidden: true,
    meta: { title: '发起申请' }
35 36 37 38 39 40 41 42
  },
  // 业务流程只读框架
  {
    path: '/workFrameView',
    component: () => import('@/views/workflow/workFrameView.vue'),
    name: 'workFrameView',
    hidden: true,
    meta: { title: '发起申请' }
任超 committed
43
  }
任超 committed
44 45 46 47 48 49 50
]

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

const createRouter = () =>
  new Router({
    scrollBehavior: () => ({ y: 0 }),
任超 committed
275
    routes: [...constantRoutes]
赵千 committed
276 277 278 279 280 281 282 283 284 285
  })

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