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
import layoutHeaderAside from '@/layout/header-aside'
// 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
/**
* 在主框架内显示
*/
const frameIn = [
{
path: '/',
// redirect: { name: 'index' },
redirect: { name: 'homeMain' },
component: layoutHeaderAside,
children: [
// 首页
{
path: 'index',
name: 'index',
meta: {
auth: true
},
component: _import('system/index')
},
// Z-首页-首页
{
path: '/home/main',
name: 'homeMain',
component: () => import('@/pages/home/main'),
meta: {
auth: true,
title: '首页'
}
},
// Z-进件管理-通讯录管理
{
path: '/in/contact',
name: 'inContact',
component: () => import('@/pages/in/contact'),
meta: {
auth: true,
title: '通讯录管理'
}
},
// // Z-进件管理-通讯录管理
// {
// path: '/in/bar',
// name: 'inBar',
// component: () => import('@/pages/in/bar'),
// meta: {
// auth: true,
// title: '柜组管理'
// }
// },
// // Z-进件管理-通讯录管理
// {
// path: '/in/shop',
// name: 'inShop',
// component: () => import('@/pages/in/shop'),
// meta: {
// auth: true,
// title: '门店管理'
// }
// },
// Z-活动模版管理-模版中心
{
path: '/active/mode',
name: 'activeMode',
component: () => import('@/pages/active/mode'),
meta: {
auth: true,
title: '模版中心'
}
},
// Z-活动模版管理-模版商城
{
path: '/active/shop',
name: 'activeMode',
component: () => import('@/pages/active/shop'),
meta: {
auth: true,
title: '模版商城'
}
},
// Z-任务管理-柜组任务
{
path: '/task/main',
name: 'taskMain',
component: () => import('@/pages/task/main'),
meta: {
auth: true,
title: '柜组任务'
}
},
// Z-任务管理-集团任务
{
path: '/task/com',
name: 'taskCom',
component: () => import('@/pages/task/com'),
meta: {
auth: true,
title: '集团任务'
}
},
// Z-任务管理-任务统计
{
path: '/task/count',
name: 'taskCount',
component: () => import('@/pages/task/count'),
meta: {
auth: true,
title: '任务统计'
}
},
// Z-活动商品-活动商品
{
path: '/goods/main',
name: 'goodsMain',
component: () => import('@/pages/goods/main'),
meta: {
auth: true,
title: '活动商品'
}
},
// // 演示页面
// {
// path: 'page1',
// name: 'page1',
// meta: {
// title: '页面 1',
// auth: true
// },
// component: _import('demo/page1')
// },
// {
// path: 'page2',
// name: 'page2',
// meta: {
// title: '页面 2',
// auth: true
// },
// component: _import('demo/page2')
// },
// {
// path: 'page3',
// name: 'page3',
// meta: {
// title: '页面 3',
// auth: true
// },
// component: _import('demo/page3')
// },
// {
// path: '/page-demo',
// name: 'page-demo',
// component: () => import('@/pages/page-demo'),
// meta: {
// auth: true,
// title: '新建示例'
// }
// },
// 系统 前端日志
{
path: 'log',
name: 'log',
meta: {
title: '前端日志',
auth: true
},
component: _import('system/log')
},
// 刷新页面 必须保留
{
path: 'refresh',
name: 'refresh',
hidden: true,
component: _import('system/function/refresh')
},
// 页面重定向 必须保留
{
path: 'redirect/:route*',
name: 'redirect',
hidden: true,
component: _import('system/function/redirect')
}
]
}
]
/**
* 在主框架之外显示
*/
const frameOut = [
// 登录
{
path: '/login',
name: 'login',
component: _import('system/login')
}
]
/**
* 错误页面
*/
const errorPage = [
{
path: '*',
name: '404',
component: _import('system/error/404')
}
]
// 导出需要显示菜单的
export const frameInRoutes = frameIn
// 重新组织后导出
export default [
...frameIn,
...frameOut,
...errorPage
]