Commit 7ffd48dd authored by nikogu's avatar nikogu
parent 0c0cb87e
...@@ -4,13 +4,13 @@ import dynamic from 'dva/dynamic'; ...@@ -4,13 +4,13 @@ import dynamic from 'dva/dynamic';
const dynamicWrapper = (app, models, component) => dynamic({ const dynamicWrapper = (app, models, component) => dynamic({
app, app,
models: () => models.map(m => import(`../models/${m}.js`)), models: () => models.map(m => import(`../models/${m}.js`)),
component: () => component, component,
}); });
// nav data // nav data
export const getNavData = app => [ export const getNavData = app => [
{ {
component: dynamicWrapper(app, ['user'], import('../layouts/BasicLayout')), component: dynamicWrapper(app, ['user'], () => import('../layouts/BasicLayout')),
layout: 'BasicLayout', layout: 'BasicLayout',
name: '首页', // for breadcrumb name: '首页', // for breadcrumb
path: '/', path: '/',
...@@ -23,17 +23,17 @@ export const getNavData = app => [ ...@@ -23,17 +23,17 @@ export const getNavData = app => [
{ {
name: '分析页', name: '分析页',
path: 'analysis', path: 'analysis',
component: dynamicWrapper(app, ['chart'], import('../routes/Dashboard/Analysis')), component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')),
}, },
{ {
name: '监控页', name: '监控页',
path: 'monitor', path: 'monitor',
component: dynamicWrapper(app, ['monitor'], import('../routes/Dashboard/Monitor')), component: dynamicWrapper(app, ['monitor'], () => import('../routes/Dashboard/Monitor')),
}, },
{ {
name: '工作台', name: '工作台',
path: 'workplace', path: 'workplace',
component: dynamicWrapper(app, ['project', 'activities', 'chart'], import('../routes/Dashboard/Workplace')), component: dynamicWrapper(app, ['project', 'activities', 'chart'], () => import('../routes/Dashboard/Workplace')),
}, },
], ],
}, },
...@@ -45,27 +45,27 @@ export const getNavData = app => [ ...@@ -45,27 +45,27 @@ export const getNavData = app => [
{ {
name: '基础表单', name: '基础表单',
path: 'basic-form', path: 'basic-form',
component: dynamicWrapper(app, ['form'], import('../routes/Forms/BasicForm')), component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/BasicForm')),
}, },
{ {
name: '分步表单', name: '分步表单',
path: 'step-form', path: 'step-form',
component: dynamicWrapper(app, ['form'], import('../routes/Forms/StepForm')), component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm')),
children: [ children: [
{ {
path: 'confirm', path: 'confirm',
component: dynamicWrapper(app, ['form'], import('../routes/Forms/StepForm/Step2')), component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step2')),
}, },
{ {
path: 'result', path: 'result',
component: dynamicWrapper(app, ['form'], import('../routes/Forms/StepForm/Step3')), component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/StepForm/Step3')),
}, },
], ],
}, },
{ {
name: '高级表单', name: '高级表单',
path: 'advanced-form', path: 'advanced-form',
component: dynamicWrapper(app, ['form'], import('../routes/Forms/AdvancedForm')), component: dynamicWrapper(app, ['form'], () => import('../routes/Forms/AdvancedForm')),
}, },
], ],
}, },
...@@ -77,32 +77,32 @@ export const getNavData = app => [ ...@@ -77,32 +77,32 @@ export const getNavData = app => [
{ {
name: '查询表格', name: '查询表格',
path: 'table-list', path: 'table-list',
component: dynamicWrapper(app, ['rule'], import('../routes/List/TableList')), component: dynamicWrapper(app, ['rule'], () => import('../routes/List/TableList')),
}, },
{ {
name: '标准列表', name: '标准列表',
path: 'basic-list', path: 'basic-list',
component: dynamicWrapper(app, ['list'], import('../routes/List/BasicList')), component: dynamicWrapper(app, ['list'], () => import('../routes/List/BasicList')),
}, },
{ {
name: '卡片列表', name: '卡片列表',
path: 'card-list', path: 'card-list',
component: dynamicWrapper(app, ['list'], import('../routes/List/CardList')), component: dynamicWrapper(app, ['list'], () => import('../routes/List/CardList')),
}, },
{ {
name: '搜索列表(项目)', name: '搜索列表(项目)',
path: 'cover-card-list', path: 'cover-card-list',
component: dynamicWrapper(app, ['list'], import('../routes/List/CoverCardList')), component: dynamicWrapper(app, ['list'], () => import('../routes/List/CoverCardList')),
}, },
{ {
name: '搜索列表(应用)', name: '搜索列表(应用)',
path: 'filter-card-list', path: 'filter-card-list',
component: dynamicWrapper(app, ['list'], import('../routes/List/FilterCardList')), component: dynamicWrapper(app, ['list'], () => import('../routes/List/FilterCardList')),
}, },
{ {
name: '搜索列表(文章)', name: '搜索列表(文章)',
path: 'search', path: 'search',
component: dynamicWrapper(app, ['list'], import('../routes/List/SearchList')), component: dynamicWrapper(app, ['list'], () => import('../routes/List/SearchList')),
}, },
], ],
}, },
...@@ -114,12 +114,12 @@ export const getNavData = app => [ ...@@ -114,12 +114,12 @@ export const getNavData = app => [
{ {
name: '基础详情页', name: '基础详情页',
path: 'basic', path: 'basic',
component: dynamicWrapper(app, ['profile'], import('../routes/Profile/BasicProfile')), component: dynamicWrapper(app, ['profile'], () => import('../routes/Profile/BasicProfile')),
}, },
{ {
name: '高级详情页', name: '高级详情页',
path: 'advanced', path: 'advanced',
component: dynamicWrapper(app, ['profile'], import('../routes/Profile/AdvancedProfile')), component: dynamicWrapper(app, ['profile'], () => import('../routes/Profile/AdvancedProfile')),
}, },
], ],
}, },
...@@ -131,12 +131,12 @@ export const getNavData = app => [ ...@@ -131,12 +131,12 @@ export const getNavData = app => [
{ {
name: '成功', name: '成功',
path: 'success', path: 'success',
component: dynamicWrapper(app, [], import('../routes/Result/Success')), component: dynamicWrapper(app, [], () => import('../routes/Result/Success')),
}, },
{ {
name: '失败', name: '失败',
path: 'fail', path: 'fail',
component: dynamicWrapper(app, [], import('../routes/Result/Error')), component: dynamicWrapper(app, [], () => import('../routes/Result/Error')),
}, },
], ],
}, },
...@@ -148,24 +148,24 @@ export const getNavData = app => [ ...@@ -148,24 +148,24 @@ export const getNavData = app => [
{ {
name: '403', name: '403',
path: '403', path: '403',
component: dynamicWrapper(app, [], import('../routes/Exception/403')), component: dynamicWrapper(app, [], () => import('../routes/Exception/403')),
}, },
{ {
name: '404', name: '404',
path: '404', path: '404',
component: dynamicWrapper(app, [], import('../routes/Exception/404')), component: dynamicWrapper(app, [], () => import('../routes/Exception/404')),
}, },
{ {
name: '500', name: '500',
path: '500', path: '500',
component: dynamicWrapper(app, [], import('../routes/Exception/500')), component: dynamicWrapper(app, [], () => import('../routes/Exception/500')),
}, },
], ],
}, },
], ],
}, },
{ {
component: dynamicWrapper(app, [], import('../layouts/UserLayout')), component: dynamicWrapper(app, [], () => import('../layouts/UserLayout')),
path: '/user', path: '/user',
layout: 'UserLayout', layout: 'UserLayout',
children: [ children: [
...@@ -177,24 +177,24 @@ export const getNavData = app => [ ...@@ -177,24 +177,24 @@ export const getNavData = app => [
{ {
name: '登录', name: '登录',
path: 'login', path: 'login',
component: dynamicWrapper(app, ['login'], import('../routes/User/Login')), component: dynamicWrapper(app, ['login'], () => import('../routes/User/Login')),
}, },
{ {
name: '注册', name: '注册',
path: 'register', path: 'register',
component: dynamicWrapper(app, ['register'], import('../routes/User/Register')), component: dynamicWrapper(app, ['register'], () => import('../routes/User/Register')),
}, },
{ {
name: '注册结果', name: '注册结果',
path: 'register-result', path: 'register-result',
component: dynamicWrapper(app, [], import('../routes/User/RegisterResult')), component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')),
}, },
], ],
}, },
], ],
}, },
{ {
component: dynamicWrapper(app, [], import('../layouts/BlankLayout')), component: dynamicWrapper(app, [], () => import('../layouts/BlankLayout')),
layout: 'BlankLayout', layout: 'BlankLayout',
children: { children: {
name: '使用文档', name: '使用文档',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment