nav.js
6.14 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
import dynamic from 'dva/dynamic';
// wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({
app,
models: () => models.map(m => import(`../models/${m}.js`)),
component,
});
// nav data
export const getNavData = app => [
{
component: dynamicWrapper(app, ['user', 'login'], () => import('../layouts/BasicLayout')),
layout: 'BasicLayout',
name: '仪表盘', // for breadcrumb
path: '/',
children: [
{
name: '仪表盘',
icon: 'dashboard',
path: 'dashboard',
children: [
{
name: '分析页',
path: 'analysis',
component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')),
},
{
name: '监控页',
path: 'monitor',
component: dynamicWrapper(app, ['monitor'], () => import('../routes/Dashboard/Monitor')),
},
{
name: '工作台',
path: 'workplace',
component: dynamicWrapper(app, ['project', 'activities', 'chart'], () => import('../routes/Dashboard/Workplace')),
},
],
},
{
name: '表单页',
path: 'form',
icon: 'form',
children: [
{
name: '基础表单',
path: 'basic-form',
component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/BasicForm')),
},
{
name: '分步表单',
path: 'step-form',
component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm')),
children: [
{
path: 'confirm',
component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step2')),
},
{
path: 'result',
component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step3')),
},
],
},
{
name: '高级表单',
path: 'advanced-form',
component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/AdvancedForm')),
},
],
},
{
name: '列表页',
path: 'list',
icon: 'table',
children: [
{
name: '查询表格',
path: 'table-list',
component: dynamicWrapper(app, ['rule'], () => import('../routes/List/TableList')),
},
{
name: '标准列表',
path: 'basic-list',
component: dynamicWrapper(app, ['list'], () => import('../routes/List/BasicList')),
},
{
name: '卡片列表',
path: 'card-list',
component: dynamicWrapper(app, ['list'], () => import('../routes/List/CardList')),
},
{
name: '搜索列表(项目)',
path: 'cover-card-list',
component: dynamicWrapper(app, ['list'], () => import('../routes/List/CoverCardList')),
},
{
name: '搜索列表(应用)',
path: 'filter-card-list',
component: dynamicWrapper(app, ['list'], () => import('../routes/List/FilterCardList')),
},
{
name: '搜索列表(文章)',
path: 'search',
component: dynamicWrapper(app, ['list'], () => import('../routes/List/SearchList')),
},
],
},
{
name: '详情页',
path: 'profile',
icon: 'profile',
children: [
{
name: '基础详情页',
path: 'basic',
component: dynamicWrapper(app, ['profile'], () => import('../routes/Profile/BasicProfile')),
},
{
name: '高级详情页',
path: 'advanced',
component: dynamicWrapper(app, ['profile'], () => import('../routes/Profile/AdvancedProfile')),
},
],
},
{
name: '结果页',
path: 'result',
icon: 'check-circle-o',
children: [
{
name: '成功反馈',
path: 'success',
component: dynamicWrapper(app, [], () => import('../routes/Result/Success')),
},
{
name: '失败反馈',
path: 'fail',
component: dynamicWrapper(app, [], () => import('../routes/Result/Error')),
},
],
},
{
name: '错误页',
path: 'exception',
icon: 'warning',
children: [
{
name: '403 错误',
path: '403',
component: dynamicWrapper(app, [], () => import('../routes/Exception/403')),
},
{
name: '404 错误',
path: '404',
component: dynamicWrapper(app, [], () => import('../routes/Exception/404')),
},
{
name: '500 错误',
path: '500',
component: dynamicWrapper(app, [], () => import('../routes/Exception/500')),
},
],
},
],
},
{
component: dynamicWrapper(app, [], () => import('../layouts/UserLayout')),
path: '/user',
layout: 'UserLayout',
children: [
{
name: '用户账户',
icon: 'user',
path: 'user',
children: [
{
name: '登录页',
path: 'login',
component: dynamicWrapper(app, ['login'], () => import('../routes/User/Login')),
},
{
name: '注册页',
path: 'register',
component: dynamicWrapper(app, ['register'], () => import('../routes/User/Register')),
},
{
name: '注册结果',
path: 'register-result',
component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')),
},
],
},
],
},
{
component: dynamicWrapper(app, [], () => import('../layouts/BlankLayout')),
layout: 'BlankLayout',
children: {
name: '使用文档',
path: 'http://pro.ant.design/docs/getting-started-cn',
target: '_blank',
icon: 'book',
},
},
];