Commit c4524c8b authored by 陈帅's avatar 陈帅

bugfix: TableList name searchlist change to searchtable

parent 57c9820e
......@@ -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' },
{
......
......@@ -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',
......
......@@ -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': '搜索列表(应用)',
......
......@@ -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);
}
......
......@@ -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;
});
}
......
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