nav.js 6.71 KB
Newer Older
WhatAKitty's avatar
WhatAKitty committed
1
import dynamic from 'dva/dynamic';
2

3 4
export const getNavData = app => [{
  component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
5
    app,
WhatAKitty's avatar
WhatAKitty committed
6 7 8
    models: () => [
      import('../models/user'),
    ],
WhatAKitty's avatar
WhatAKitty committed
9 10
    component: () => import('../layouts/BasicLayout'),
  }),
ddcat1115's avatar
ddcat1115 committed
11
  layout: 'BasicLayout',
afc163's avatar
afc163 committed
12
  name: '首页', // for breadcrumb
WhatAKitty's avatar
WhatAKitty committed
13
  path: '/',
14
  children: [{
afc163's avatar
afc163 committed
15 16 17
    name: 'Dashboard',
    icon: 'dashboard',
    path: 'dashboard',
18
    children: [{
afc163's avatar
afc163 committed
19 20
      name: '分析页',
      path: 'analysis',
21
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
22
        app,
WhatAKitty's avatar
WhatAKitty committed
23 24 25
        models: () => [
          import('../models/chart'),
        ],
WhatAKitty's avatar
WhatAKitty committed
26 27
        component: () => import('../routes/Dashboard/Analysis'),
      }),
afc163's avatar
afc163 committed
28 29 30
    }, {
      name: '监控页',
      path: 'monitor',
31
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
32
        app,
WhatAKitty's avatar
WhatAKitty committed
33 34 35
        models: () => [
          import('../models/monitor'),
        ],
WhatAKitty's avatar
WhatAKitty committed
36 37
        component: () => import('../routes/Dashboard/Monitor'),
      }),
38
    }, {
afc163's avatar
afc163 committed
39 40
      name: '工作台',
      path: 'workplace',
41
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
42
        app,
WhatAKitty's avatar
WhatAKitty committed
43 44 45 46 47
        models: () => [
          import('../models/project'),
          import('../models/activities'),
          import('../models/chart'),
        ],
WhatAKitty's avatar
WhatAKitty committed
48 49
        component: () => import('../routes/Dashboard/Workplace'),
      }),
50 51
    }],
  }, {
afc163's avatar
afc163 committed
52 53 54 55 56 57
    name: '表单页',
    path: 'form',
    icon: 'form',
    children: [{
      name: '基础表单',
      path: 'basic-form',
58
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
59
        app,
WhatAKitty's avatar
WhatAKitty committed
60 61 62
        models: () => [
          import('../models/form'),
        ],
WhatAKitty's avatar
WhatAKitty committed
63 64
        component: () => import('../routes/Forms/BasicForm'),
      }),
afc163's avatar
afc163 committed
65 66 67
    }, {
      name: '分步表单',
      path: 'step-form',
68
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
69
        app,
WhatAKitty's avatar
WhatAKitty committed
70 71 72
        models: () => [
          import('../models/form'),
        ],
WhatAKitty's avatar
WhatAKitty committed
73 74
        component: () => import('../routes/Forms/StepForm'),
      }),
afc163's avatar
afc163 committed
75 76
      children: [{
        path: 'confirm',
77
        component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
78
          app,
WhatAKitty's avatar
WhatAKitty committed
79 80 81
          models: () => [
            import('../models/form'),
          ],
WhatAKitty's avatar
WhatAKitty committed
82 83
          component: () => import('../routes/Forms/StepForm/Step2'),
        }),
afc163's avatar
afc163 committed
84 85
      }, {
        path: 'result',
86
        component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
87
          app,
WhatAKitty's avatar
WhatAKitty committed
88 89 90
          models: () => [
            import('../models/form'),
          ],
WhatAKitty's avatar
WhatAKitty committed
91 92
          component: () => import('../routes/Forms/StepForm/Step3'),
        }),
afc163's avatar
afc163 committed
93 94 95 96
      }],
    }, {
      name: '高级表单',
      path: 'advanced-form',
97
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
98
        app,
WhatAKitty's avatar
WhatAKitty committed
99 100 101
        models: () => [
          import('../models/form'),
        ],
WhatAKitty's avatar
WhatAKitty committed
102
        component: () => import('../routes/Forms/AdvancedForm'),
WhatAKitty's avatar
WhatAKitty committed
103
      }),
afc163's avatar
afc163 committed
104
    }],
105
  }, {
afc163's avatar
afc163 committed
106 107 108 109
    name: '列表页',
    path: 'list',
    icon: 'table',
    children: [{
niko's avatar
niko committed
110
      name: '查询表格',
afc163's avatar
afc163 committed
111
      path: 'table-list',
112
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
113
        app,
WhatAKitty's avatar
WhatAKitty committed
114 115 116
        models: () => [
          import('../models/rule'),
        ],
WhatAKitty's avatar
WhatAKitty committed
117 118
        component: () => import('../routes/List/TableList'),
      }),
afc163's avatar
afc163 committed
119 120 121
    }, {
      name: '标准列表',
      path: 'basic-list',
122
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
123
        app,
WhatAKitty's avatar
WhatAKitty committed
124 125 126
        models: () => [
          import('../models/list'),
        ],
WhatAKitty's avatar
WhatAKitty committed
127 128
        component: () => import('../routes/List/BasicList'),
      }),
afc163's avatar
afc163 committed
129 130 131
    }, {
      name: '卡片列表',
      path: 'card-list',
132
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
133
        app,
WhatAKitty's avatar
WhatAKitty committed
134 135 136
        models: () => [
          import('../models/list'),
        ],
WhatAKitty's avatar
WhatAKitty committed
137 138
        component: () => import('../routes/List/CardList'),
      }),
afc163's avatar
afc163 committed
139
    }, {
niko's avatar
niko committed
140
      name: '搜索列表(项目)',
afc163's avatar
afc163 committed
141
      path: 'cover-card-list',
142
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
143
        app,
WhatAKitty's avatar
WhatAKitty committed
144 145 146
        models: () => [
          import('../models/list'),
        ],
WhatAKitty's avatar
WhatAKitty committed
147 148
        component: () => import('../routes/List/CoverCardList'),
      }),
afc163's avatar
afc163 committed
149
    }, {
niko's avatar
niko committed
150
      name: '搜索列表(应用)',
afc163's avatar
afc163 committed
151
      path: 'filter-card-list',
152
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
153
        app,
WhatAKitty's avatar
WhatAKitty committed
154 155 156
        models: () => [
          import('../models/list'),
        ],
WhatAKitty's avatar
WhatAKitty committed
157 158
        component: () => import('../routes/List/FilterCardList'),
      }),
afc163's avatar
afc163 committed
159
    }, {
niko's avatar
niko committed
160
      name: '搜索列表(文章)',
afc163's avatar
afc163 committed
161
      path: 'search',
162
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
163
        app,
WhatAKitty's avatar
WhatAKitty committed
164 165 166
        models: () => [
          import('../models/list'),
        ],
WhatAKitty's avatar
WhatAKitty committed
167 168
        component: () => import('../routes/List/SearchList'),
      }),
afc163's avatar
afc163 committed
169
    }],
170
  }, {
afc163's avatar
afc163 committed
171 172 173
    name: '详情页',
    path: 'profile',
    icon: 'profile',
ddcat1115's avatar
ddcat1115 committed
174 175 176
    children: [{
      name: '基础详情页',
      path: 'basic',
177
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
178
        app,
WhatAKitty's avatar
WhatAKitty committed
179 180 181
        models: () => [
          import('../models/profile'),
        ],
WhatAKitty's avatar
WhatAKitty committed
182 183
        component: () => import('../routes/Profile/BasicProfile'),
      }),
ddcat1115's avatar
ddcat1115 committed
184 185 186
    }, {
      name: '高级详情页',
      path: 'advanced',
187
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
188
        app,
WhatAKitty's avatar
WhatAKitty committed
189 190 191
        models: () => [
          import('../models/profile'),
        ],
WhatAKitty's avatar
WhatAKitty committed
192 193
        component: () => import('../routes/Profile/AdvancedProfile'),
      }),
ddcat1115's avatar
ddcat1115 committed
194
    }],
195
  }, {
afc163's avatar
afc163 committed
196 197 198 199 200 201
    name: '结果',
    path: 'result',
    icon: 'check-circle-o',
    children: [{
      name: '成功',
      path: 'success',
202
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
203 204 205
        app,
        component: () => import('../routes/Result/Success'),
      }),
afc163's avatar
afc163 committed
206 207 208
    }, {
      name: '失败',
      path: 'fail',
209
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
210 211 212
        app,
        component: () => import('../routes/Result/Error'),
      }),
afc163's avatar
afc163 committed
213
    }],
214
  }, {
ddcat1115's avatar
ddcat1115 committed
215 216
    name: '异常',
    path: 'exception',
afc163's avatar
afc163 committed
217 218 219 220
    icon: 'warning',
    children: [{
      name: '403',
      path: '403',
221
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
222 223 224
        app,
        component: () => import('../routes/Exception/403'),
      }),
afc163's avatar
afc163 committed
225 226 227
    }, {
      name: '404',
      path: '404',
228
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
229 230 231
        app,
        component: () => import('../routes/Exception/404'),
      }),
afc163's avatar
afc163 committed
232 233 234
    }, {
      name: '500',
      path: '500',
235
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
236 237 238
        app,
        component: () => import('../routes/Exception/500'),
      }),
afc163's avatar
afc163 committed
239
    }],
240 241
  }],
}, {
242
  component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
243 244 245
    app,
    component: () => import('../layouts/UserLayout'),
  }),
WhatAKitty's avatar
WhatAKitty committed
246
  path: '/user',
ddcat1115's avatar
ddcat1115 committed
247
  layout: 'UserLayout',
248
  children: [{
afc163's avatar
afc163 committed
249 250 251 252 253 254
    name: '帐户',
    icon: 'user',
    path: 'user',
    children: [{
      name: '登录',
      path: 'login',
255
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
256
        app,
WhatAKitty's avatar
WhatAKitty committed
257 258 259
        models: () => [
          import('../models/login'),
        ],
WhatAKitty's avatar
WhatAKitty committed
260 261
        component: () => import('../routes/User/Login'),
      }),
afc163's avatar
afc163 committed
262 263 264
    }, {
      name: '注册',
      path: 'register',
265
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
266
        app,
WhatAKitty's avatar
WhatAKitty committed
267 268 269
        models: () => [
          import('../models/register'),
        ],
WhatAKitty's avatar
WhatAKitty committed
270 271
        component: () => import('../routes/User/Register'),
      }),
afc163's avatar
afc163 committed
272 273 274
    }, {
      name: '注册结果',
      path: 'register-result',
275
      component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
276 277 278
        app,
        component: () => import('../routes/User/RegisterResult'),
      }),
afc163's avatar
afc163 committed
279
    }],
280
  }],
afc163's avatar
afc163 committed
281
}, {
282
  component: dynamic({
WhatAKitty's avatar
WhatAKitty committed
283 284 285
    app,
    component: () => import('../layouts/BlankLayout'),
  }),
afc163's avatar
afc163 committed
286 287 288 289 290 291 292
  layout: 'BlankLayout',
  children: {
    name: '使用文档',
    path: 'http://pro.ant.design/docs/getting-started',
    target: '_blank',
    icon: 'book',
  },
293
}];