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

afc163's avatar
afc163 committed
3
const data = [{
WhatAKitty's avatar
WhatAKitty committed
4 5
  component: app => dynamic({
    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',
WhatAKitty's avatar
WhatAKitty committed
21 22
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
31 32
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
41 42
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
58 59
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
68 69
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
77 78
        component: app => dynamic({
          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',
WhatAKitty's avatar
WhatAKitty committed
86 87
        component: app => dynamic({
          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',
WhatAKitty's avatar
WhatAKitty committed
97 98
      component: app => dynamic({
        app,
WhatAKitty's avatar
WhatAKitty committed
99 100 101
        models: () => [
          import('../models/form'),
        ],
WhatAKitty's avatar
WhatAKitty committed
102 103
        component: () => import('../routes/Profile/AdvancedProfile'),
      }),
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',
WhatAKitty's avatar
WhatAKitty committed
112 113
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
122 123
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
132 133
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
142 143
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
152 153
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
162 163
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
177 178
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
187 188
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
202 203 204 205
      component: app => dynamic({
        app,
        component: () => import('../routes/Result/Success'),
      }),
afc163's avatar
afc163 committed
206 207 208
    }, {
      name: '失败',
      path: 'fail',
WhatAKitty's avatar
WhatAKitty committed
209 210 211 212
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
221 222 223 224
      component: app => dynamic({
        app,
        component: () => import('../routes/Exception/403'),
      }),
afc163's avatar
afc163 committed
225 226 227
    }, {
      name: '404',
      path: '404',
WhatAKitty's avatar
WhatAKitty committed
228 229 230 231
      component: app => dynamic({
        app,
        component: () => import('../routes/Exception/404'),
      }),
afc163's avatar
afc163 committed
232 233 234
    }, {
      name: '500',
      path: '500',
WhatAKitty's avatar
WhatAKitty committed
235 236 237 238
      component: app => dynamic({
        app,
        component: () => import('../routes/Exception/500'),
      }),
afc163's avatar
afc163 committed
239
    }],
240 241
  }],
}, {
WhatAKitty's avatar
WhatAKitty committed
242 243 244 245
  component: app => dynamic({
    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',
WhatAKitty's avatar
WhatAKitty committed
255 256
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
265 266
      component: app => dynamic({
        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',
WhatAKitty's avatar
WhatAKitty committed
275 276 277 278
      component: app => dynamic({
        app,
        component: () => import('../routes/User/RegisterResult'),
      }),
afc163's avatar
afc163 committed
279
    }],
280
  }],
afc163's avatar
afc163 committed
281
}, {
WhatAKitty's avatar
WhatAKitty committed
282 283 284 285
  component: app => dynamic({
    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
}];
afc163's avatar
afc163 committed
294 295 296 297 298 299

export function getNavData() {
  return data;
}

export default data;