Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
c4524c8b
Commit
c4524c8b
authored
Jul 15, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: TableList name searchlist change to searchtable
parent
57c9820e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
9 deletions
+14
-9
config/config.js
config/config.js
+1
-1
src/locales/en-US.js
src/locales/en-US.js
+4
-3
src/locales/zh-CN.js
src/locales/zh-CN.js
+2
-1
src/pages/layouts/BasicLayout.js
src/pages/layouts/BasicLayout.js
+2
-2
src/pages/layouts/LoadingPage.js
src/pages/layouts/LoadingPage.js
+5
-2
No files found.
config/config.js
View file @
c4524c8b
...
...
@@ -97,7 +97,7 @@ export default {
icon
:
'
table
'
,
name
:
'
list
'
,
routes
:
[
{
path
:
'
/list/table-list
'
,
name
:
'
search
list
'
,
component
:
'
./List/TableList
'
},
{
path
:
'
/list/table-list
'
,
name
:
'
search
table
'
,
component
:
'
./List/TableList
'
},
{
path
:
'
/list/basic-list
'
,
name
:
'
basiclist
'
,
component
:
'
./List/BasicList
'
},
{
path
:
'
/list/card-list
'
,
name
:
'
cardlist
'
,
component
:
'
./List/CardList
'
},
{
...
...
src/locales/en-US.js
View file @
c4524c8b
...
...
@@ -13,12 +13,13 @@ export default {
'
menu.form.stepform.result
'
:
'
Step Form(finished)
'
,
'
menu.form.advancedform
'
:
'
Advanced Form
'
,
'
menu.list
'
:
'
List
'
,
'
menu.list.search
list
'
:
'
Search List
'
,
'
menu.list.search
table
'
:
'
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
'
,
...
...
src/locales/zh-CN.js
View file @
c4524c8b
...
...
@@ -15,9 +15,10 @@ export default {
'
menu.form.stepform.result
'
:
'
分步表单(完成)
'
,
'
menu.form.advancedform
'
:
'
高级表单
'
,
'
menu.list
'
:
'
列表页
'
,
'
menu.list.search
list
'
:
'
搜索列表
'
,
'
menu.list.search
table
'
:
'
查询表格
'
,
'
menu.list.basiclist
'
:
'
标准列表
'
,
'
menu.list.cardlist
'
:
'
卡片列表
'
,
'
menu.list.searchlist
'
:
'
搜索列表
'
,
'
menu.list.searchlist.articles
'
:
'
搜索列表(文章)
'
,
'
menu.list.searchlist.projects
'
:
'
搜索列表(项目)
'
,
'
menu.list.searchlist.applications
'
:
'
搜索列表(应用)
'
,
...
...
src/pages/layouts/BasicLayout.js
View file @
c4524c8b
...
...
@@ -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
);
}
...
...
src/pages/layouts/LoadingPage.js
View file @
c4524c8b
...
...
@@ -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
;
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment