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
cc5c8155
Commit
cc5c8155
authored
Apr 19, 2019
by
拷钉
Committed by
陈帅
Apr 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hiddenBreadcrumb && menu.disableLocal (#4009)
* menu.disableLocal * hiddenBreadcrumb * lint * lint
parent
edd2962e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
6 deletions
+17
-6
src/components/Authorized/CheckPermissions.js
src/components/Authorized/CheckPermissions.js
+1
-0
src/components/Authorized/PromiseRender.js
src/components/Authorized/PromiseRender.js
+1
-0
src/components/Authorized/Secured.js
src/components/Authorized/Secured.js
+1
-0
src/components/PageHeaderWrapper/breadcrumb.js
src/components/PageHeaderWrapper/breadcrumb.js
+5
-1
src/components/PageHeaderWrapper/index.js
src/components/PageHeaderWrapper/index.js
+9
-5
No files found.
src/components/Authorized/CheckPermissions.js
View file @
cc5c8155
import
React
from
'
react
'
;
import
React
from
'
react
'
;
// eslint-disable-next-line import/no-cycle
import
PromiseRender
from
'
./PromiseRender
'
;
import
PromiseRender
from
'
./PromiseRender
'
;
import
{
CURRENT
}
from
'
./renderAuthorize
'
;
import
{
CURRENT
}
from
'
./renderAuthorize
'
;
...
...
src/components/Authorized/PromiseRender.js
View file @
cc5c8155
import
{
Spin
}
from
'
antd
'
;
import
{
Spin
}
from
'
antd
'
;
import
isEqual
from
'
lodash/isEqual
'
;
import
isEqual
from
'
lodash/isEqual
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
// eslint-disable-next-line import/no-cycle
import
{
isComponentClass
}
from
'
./Secured
'
;
import
{
isComponentClass
}
from
'
./Secured
'
;
export
default
class
PromiseRender
extends
React
.
Component
{
export
default
class
PromiseRender
extends
React
.
Component
{
...
...
src/components/Authorized/Secured.js
View file @
cc5c8155
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
Exception
from
'
../Exception
'
;
import
Exception
from
'
../Exception
'
;
// eslint-disable-next-line import/no-cycle
import
CheckPermissions
from
'
./CheckPermissions
'
;
import
CheckPermissions
from
'
./CheckPermissions
'
;
/**
/**
...
...
src/components/PageHeaderWrapper/breadcrumb.js
View file @
cc5c8155
...
@@ -3,6 +3,7 @@ import pathToRegexp from 'path-to-regexp';
...
@@ -3,6 +3,7 @@ import pathToRegexp from 'path-to-regexp';
import
Link
from
'
umi/link
'
;
import
Link
from
'
umi/link
'
;
import
{
formatMessage
}
from
'
umi-plugin-react/locale
'
;
import
{
formatMessage
}
from
'
umi-plugin-react/locale
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
import
{
menu
}
from
'
../../defaultSettings
'
;
// 渲染Breadcrumb 子节点
// 渲染Breadcrumb 子节点
// Render the Breadcrumb child node
// Render the Breadcrumb child node
...
@@ -21,7 +22,10 @@ const itemRender = (route, params, routes, paths) => {
...
@@ -21,7 +22,10 @@ const itemRender = (route, params, routes, paths) => {
const
renderItemLocal
=
item
=>
{
const
renderItemLocal
=
item
=>
{
if
(
item
.
locale
)
{
if
(
item
.
locale
)
{
return
formatMessage
({
id
:
item
.
locale
,
defaultMessage
:
item
.
name
});
const
name
=
menu
.
disableLocal
?
item
.
name
:
formatMessage
({
id
:
item
.
locale
,
defaultMessage
:
item
.
name
});
return
name
;
}
}
return
item
.
name
;
return
item
.
name
;
};
};
...
...
src/components/PageHeaderWrapper/index.js
View file @
cc5c8155
...
@@ -44,6 +44,7 @@ const PageHeaderWrapper = ({
...
@@ -44,6 +44,7 @@ const PageHeaderWrapper = ({
content
,
content
,
logo
,
logo
,
extraContent
,
extraContent
,
hiddenBreadcrumb
,
...
restProps
...
restProps
})
=>
{
})
=>
{
return
(
return
(
...
@@ -66,11 +67,14 @@ const PageHeaderWrapper = ({
...
@@ -66,11 +67,14 @@ const PageHeaderWrapper = ({
}
}
key
=
"
pageheader
"
key
=
"
pageheader
"
{...
restProps
}
{...
restProps
}
breadcrumb
=
{
conversionBreadcrumbList
({
breadcrumb
=
{
!
hiddenBreadcrumb
&&
conversionBreadcrumbList
({
...
value
,
...
value
,
...
restProps
,
...
restProps
,
home
:
<
FormattedMessage
id
=
"
menu.home
"
defaultMessage
=
"
Home
"
/>
,
home
:
<
FormattedMessage
id
=
"
menu.home
"
defaultMessage
=
"
Home
"
/>
,
})}
})
}
className
=
{
styles
.
pageHeader
}
className
=
{
styles
.
pageHeader
}
linkElement
=
{
Link
}
linkElement
=
{
Link
}
footer
=
{
renderFooter
(
restProps
)}
footer
=
{
renderFooter
(
restProps
)}
...
...
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