diff --git a/config/config.js b/config/config.js index 505838804384eaa9e9898229cbbbfed93056dcbb..082abe851e7bfece67b20cee2085ab6204ccc03e 100644 --- a/config/config.js +++ b/config/config.js @@ -97,7 +97,7 @@ export default { icon: 'table', name: 'list', routes: [ - { path: '/list/table-list', name: 'searchlist', component: './List/TableList' }, + { path: '/list/table-list', name: 'searchtable', component: './List/TableList' }, { path: '/list/basic-list', name: 'basiclist', component: './List/BasicList' }, { path: '/list/card-list', name: 'cardlist', component: './List/CardList' }, { diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 6dec9709067bcd55b3e812e51ffcd67ef3e98d95..b3decf2fa399467def0f274b283ae59133de7671 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -13,12 +13,13 @@ export default { 'menu.form.stepform.result': 'Step Form(finished)', 'menu.form.advancedform': 'Advanced Form', 'menu.list': 'List', - 'menu.list.searchlist': 'Search List', + 'menu.list.searchtable': 'Search Table', 'menu.list.basiclist': 'Basic List', 'menu.list.cardlist': 'Card List', + 'menu.list.searchlist': 'Search List', 'menu.list.searchlist.articles': 'Search List(articles)', - 'menu.list.searchlist.projects': 'Search List(projects)', - 'menu.list.searchlist.applications': 'Search List(applications)', + 'menu.list.searchlist.projects': 'Search List(projects)', + 'menu.list.searchlist.applications': 'Search List(applications)', 'menu.profile': 'Profile', 'menu.profile.basic': 'Basic Profile', 'menu.profile.advanced': 'Advanced Profile', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index ebb50b71b945b625f26a407b55cadc1eb0200ba6..b8da6e95c61e19ed16e3636db406a5fe7e42ebce 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -15,9 +15,10 @@ export default { 'menu.form.stepform.result': '分步表单(完成)', 'menu.form.advancedform': '高级表单', 'menu.list': '列表页', - 'menu.list.searchlist': '搜索列表', + 'menu.list.searchtable': '查询表格', 'menu.list.basiclist': '标准列表', 'menu.list.cardlist': '卡片列表', + 'menu.list.searchlist': '搜索列表', 'menu.list.searchlist.articles': '搜索列表(文章)', 'menu.list.searchlist.projects': '搜索列表(项目)', 'menu.list.searchlist.applications': '搜索列表(应用)', diff --git a/src/pages/layouts/BasicLayout.js b/src/pages/layouts/BasicLayout.js index 9f69353f13b0baa61a57c27d7e9818b8b704d481..a3b82214fa6280cfce7dc31e37d8413571cf9c91 100644 --- a/src/pages/layouts/BasicLayout.js +++ b/src/pages/layouts/BasicLayout.js @@ -26,10 +26,11 @@ const getBreadcrumbNameMap = memoizeOne(meun => { const routerMap = {}; const mergeMeunAndRouter = meunData => { meunData.forEach(meunItem => { - routerMap[meunItem.path] = meunItem; if (meunItem.children) { mergeMeunAndRouter(meunItem.children); } + // Reduce memory usage + routerMap[meunItem.path] = meunItem; }); }; mergeMeunAndRouter(meun); @@ -66,7 +67,6 @@ class BasicLayout extends React.PureComponent { super(props); const { menuData } = this.props; this.getPageTitle = memoizeOne(this.getPageTitle); - console.log(getBreadcrumbNameMap(menuData)); this.breadcrumbNameMap = getBreadcrumbNameMap(menuData); } diff --git a/src/pages/layouts/LoadingPage.js b/src/pages/layouts/LoadingPage.js index 5fd58cd6752b822201bf3a5e6db1f49f1c0d31de..5f1dadf0a526746e2a218aab39d66a7f1c80c5c0 100644 --- a/src/pages/layouts/LoadingPage.js +++ b/src/pages/layouts/LoadingPage.js @@ -7,7 +7,7 @@ import BasicLayout from './BasicLayout'; import config from '../../../config/config'; const menuData = config['routes']; -// change router to menu. +// Conversion router to menu. function formatter(data, parentPath = '', parentAuthority, parentName) { return data.map(item => { const id = parentName ? `${parentName}.${item.name}` : `menu.${item.name}`; @@ -17,8 +17,11 @@ function formatter(data, parentPath = '', parentAuthority, parentName) { authority: item.authority || parentAuthority, }; if (item.routes) { - result.children = formatter(item.routes, `${parentPath}${item.path}/`, item.authority, id); + const children = formatter(item.routes, `${parentPath}${item.path}/`, item.authority, id); + // Reduce memory usage + result.children = children; } + delete result.routes; return result; }); }