index.js
6.51 KB
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
132
133
134
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
160
161
162
163
164
165
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
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')
}
]
},
{
path: '/404',
component: () => import('@/views/error-page/404'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/home',
hidden: true,
children: [
{
path: 'home',
component: () => import('@/views/home/index'),
name: 'Dashboard',
meta: { title: '工作台', icon: 'dashboard', affix: true }
}
]
},
{ path: '*', redirect: '/404', hidden: true }
]
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user roles
*/
export const asyncRoutes = [
{
path: '/businessHandling',
id: '3',
parentId: null,
component: Layout,
meta: { title: '业务办理', icon: 'fykf' },
redirect: '/businessHandling/apply',
alwaysShow: true,
name: 'businessHandling',
children: [
{
path: 'apply',
id: '4',
parentId: '3',
component: () => import('@/views/businessHandling/apply.vue'),
name: 'apply',
meta: { title: '业务申请' }
},
{
path: 'todoBox',
id: '5',
parentId: '3',
component: () => import('@/views/businessHandling/todoBox.vue'),
name: 'todoBox',
meta: { title: '待办箱' }
},
{
path: 'boxHandled',
id: '6',
parentId: '3',
component: () => import('@/views/businessHandling/boxHandled.vue'),
name: 'boxHandled',
meta: { title: '已办箱' }
}
]
},
{
path: '/applicationQuery',
id: '9',
parentId: null,
component: Layout,
meta: { title: '申请查询', icon: 'fykf' },
redirect: '/applicationQuery/domesticPremises',
alwaysShow: true,
name: 'applicationQuery',
children: [
{
path: 'domesticPremises',
id: '10',
parentId: '9',
component: () => import('@/views/applicationQuery/domesticPremises.vue'),
name: 'domesticPremises',
meta: { title: '家庭房产' }
},
{
path: 'printRegister',
id: '12',
parentId: '9',
component: () => import('@/views/applicationQuery/printRegister.vue'),
name: 'printRegister',
meta: { title: '打印登记薄' }
},
{
path: 'queryRecord',
id: '11',
parentId: '9',
component: () => import('@/views/applicationQuery/queryRecord.vue'),
name: 'queryRecord',
meta: { title: '查询记录' }
}
]
},
{
path: '/comprehensiveQuery',
id: '13',
parentId: null,
component: Layout,
meta: { title: '综合查询', icon: 'fykf' },
redirect: '/comprehensiveQuery/progressQuery',
alwaysShow: true,
name: 'comprehensiveQuery',
children: [
{
path: 'progressQuery',
id: '14',
parentId: '13',
component: () => import('@/views/comprehensiveQuery/progressQuery.vue'),
name: 'progressQuery',
meta: { title: '进度查询' }
},
{
path: 'registerQuery',
id: '15',
parentId: '13',
component: () => import('@/views/comprehensiveQuery/registerQuery.vue'),
name: 'registerQuery',
meta: { title: '登记簿查询' }
},
{
path: 'realestateInquiry',
id: '16',
parentId: '13',
component: () => import('@/views/comprehensiveQuery/realestateInquiry.vue'),
name: 'realestateInquiry',
meta: { title: '楼盘查询' }
}
]
},
{
path: '/certificate',
id: '17',
parentId: null,
component: Layout,
meta: { title: '证书管理', icon: 'fykf' },
redirect: '/certificate/warehousing',
alwaysShow: true,
name: 'certificate',
children: [
{
path: 'warehousing',
id: '18',
parentId: '17',
component: () => import('@/views/certificate/warehousing.vue'),
name: 'warehousing',
meta: { title: '证书入库' }
},
{
path: 'distribution',
id: '19',
parentId: '17',
component: () => import('@/views/certificate/distribution.vue'),
name: 'distribution',
meta: { title: '证书分发' }
},
{
path: 'usageRecord',
id: '20',
parentId: '17',
component: () => import('@/views/certificate/usageRecord.vue'),
name: 'usageRecord',
meta: { title: '证书使用记录' }
}
]
},
{
path: '/system',
id: '21',
parentId: null,
component: Layout,
meta: { title: '系统管理', icon: 'fykf' },
redirect: '/system/dictionaries',
alwaysShow: true,
name: 'system',
children: [
{
path: 'dictionaries',
id: '22',
parentId: '21',
component: () => import('@/views/system/dictionaries.vue'),
name: 'dictionaries',
meta: { title: '字典管理' }
},
{
path: 'menu',
id: '24',
parentId: '21',
component: () => import('@/views/system/menu.vue'),
name: 'menu',
meta: { title: '菜单管理' }
},
{
path: 'userOpinion',
id: '23',
parentId: '21',
component: () => import('@/views/system/userOpinion.vue'),
name: 'userOpinion',
meta: { title: '用户意见管理' }
},
{
path: 'businessRule',
id: '23',
parentId: '21',
component: () => import('@/views/system/businessRule.vue'),
name: 'businessRule',
meta: { title: '业务规则配置' }
},
{
path: 'registrationMaterial',
id: '23',
parentId: '21',
component: () => import('@/views/system/registrationMaterial.vue'),
name: 'registrationMaterial',
meta: { title: '登记材料配置' }
}
]
}
]
const createRouter = () =>
new Router({
scrollBehavior: () => ({ y: 0 }),
routes: [...constantRoutes, ...asyncRoutes]
})
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