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

export function getNavData() {
  return data;
}

export default data;