Commit c4524c8b authored by 陈帅's avatar 陈帅

bugfix: TableList name searchlist change to searchtable

parent 57c9820e
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
icon: 'table', icon: 'table',
name: 'list', name: 'list',
routes: [ 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/basic-list', name: 'basiclist', component: './List/BasicList' },
{ path: '/list/card-list', name: 'cardlist', component: './List/CardList' }, { path: '/list/card-list', name: 'cardlist', component: './List/CardList' },
{ {
......
...@@ -13,12 +13,13 @@ export default { ...@@ -13,12 +13,13 @@ export default {
'menu.form.stepform.result': 'Step Form(finished)', 'menu.form.stepform.result': 'Step Form(finished)',
'menu.form.advancedform': 'Advanced Form', 'menu.form.advancedform': 'Advanced Form',
'menu.list': 'List', 'menu.list': 'List',
'menu.list.searchlist': 'Search List', 'menu.list.searchtable': 'Search Table',
'menu.list.basiclist': 'Basic List', 'menu.list.basiclist': 'Basic List',
'menu.list.cardlist': 'Card List', 'menu.list.cardlist': 'Card List',
'menu.list.searchlist': 'Search List',
'menu.list.searchlist.articles': 'Search List(articles)', 'menu.list.searchlist.articles': 'Search List(articles)',
'menu.list.searchlist.projects': 'Search List(projects)', 'menu.list.searchlist.projects': 'Search List(projects)',
'menu.list.searchlist.applications': 'Search List(applications)', 'menu.list.searchlist.applications': 'Search List(applications)',
'menu.profile': 'Profile', 'menu.profile': 'Profile',
'menu.profile.basic': 'Basic Profile', 'menu.profile.basic': 'Basic Profile',
'menu.profile.advanced': 'Advanced Profile', 'menu.profile.advanced': 'Advanced Profile',
......
...@@ -15,9 +15,10 @@ export default { ...@@ -15,9 +15,10 @@ export default {
'menu.form.stepform.result': '分步表单(完成)', 'menu.form.stepform.result': '分步表单(完成)',
'menu.form.advancedform': '高级表单', 'menu.form.advancedform': '高级表单',
'menu.list': '列表页', 'menu.list': '列表页',
'menu.list.searchlist': '搜索列表', 'menu.list.searchtable': '查询表格',
'menu.list.basiclist': '标准列表', 'menu.list.basiclist': '标准列表',
'menu.list.cardlist': '卡片列表', 'menu.list.cardlist': '卡片列表',
'menu.list.searchlist': '搜索列表',
'menu.list.searchlist.articles': '搜索列表(文章)', 'menu.list.searchlist.articles': '搜索列表(文章)',
'menu.list.searchlist.projects': '搜索列表(项目)', 'menu.list.searchlist.projects': '搜索列表(项目)',
'menu.list.searchlist.applications': '搜索列表(应用)', 'menu.list.searchlist.applications': '搜索列表(应用)',
......
...@@ -26,10 +26,11 @@ const getBreadcrumbNameMap = memoizeOne(meun => { ...@@ -26,10 +26,11 @@ const getBreadcrumbNameMap = memoizeOne(meun => {
const routerMap = {}; const routerMap = {};
const mergeMeunAndRouter = meunData => { const mergeMeunAndRouter = meunData => {
meunData.forEach(meunItem => { meunData.forEach(meunItem => {
routerMap[meunItem.path] = meunItem;
if (meunItem.children) { if (meunItem.children) {
mergeMeunAndRouter(meunItem.children); mergeMeunAndRouter(meunItem.children);
} }
// Reduce memory usage
routerMap[meunItem.path] = meunItem;
}); });
}; };
mergeMeunAndRouter(meun); mergeMeunAndRouter(meun);
...@@ -66,7 +67,6 @@ class BasicLayout extends React.PureComponent { ...@@ -66,7 +67,6 @@ class BasicLayout extends React.PureComponent {
super(props); super(props);
const { menuData } = this.props; const { menuData } = this.props;
this.getPageTitle = memoizeOne(this.getPageTitle); this.getPageTitle = memoizeOne(this.getPageTitle);
console.log(getBreadcrumbNameMap(menuData));
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData); this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
} }
......
...@@ -7,7 +7,7 @@ import BasicLayout from './BasicLayout'; ...@@ -7,7 +7,7 @@ import BasicLayout from './BasicLayout';
import config from '../../../config/config'; import config from '../../../config/config';
const menuData = config['routes']; const menuData = config['routes'];
// change router to menu. // Conversion router to menu.
function formatter(data, parentPath = '', parentAuthority, parentName) { function formatter(data, parentPath = '', parentAuthority, parentName) {
return data.map(item => { return data.map(item => {
const id = parentName ? `${parentName}.${item.name}` : `menu.${item.name}`; const id = parentName ? `${parentName}.${item.name}` : `menu.${item.name}`;
...@@ -17,8 +17,11 @@ function formatter(data, parentPath = '', parentAuthority, parentName) { ...@@ -17,8 +17,11 @@ function formatter(data, parentPath = '', parentAuthority, parentName) {
authority: item.authority || parentAuthority, authority: item.authority || parentAuthority,
}; };
if (item.routes) { 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; return result;
}); });
} }
......
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