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
3928e0d6
Commit
3928e0d6
authored
Aug 18, 2018
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:Decoupling component dependency
parent
4fdd2b03
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
32 deletions
+52
-32
src/components/Exception/index.js
src/components/Exception/index.js
+48
-31
src/locales/en-US.js
src/locales/en-US.js
+1
-1
src/pages/Exception/403.js
src/pages/Exception/403.js
+1
-0
src/pages/Exception/404.js
src/pages/Exception/404.js
+1
-0
src/pages/Exception/500.js
src/pages/Exception/500.js
+1
-0
No files found.
src/components/Exception/index.js
View file @
3928e0d6
import
React
,
{
createElement
}
from
'
react
'
;
import
React
,
{
createElement
}
from
'
react
'
;
import
{
injectIntl
,
FormattedMessage
}
from
'
react-intl
'
;
import
classNames
from
'
classnames
'
;
import
classNames
from
'
classnames
'
;
import
{
Button
}
from
'
antd
'
;
import
{
Button
}
from
'
antd
'
;
import
config
from
'
./typeConfig
'
;
import
config
from
'
./typeConfig
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
const
Exception
=
({
className
,
linkElement
=
'
a
'
,
type
,
title
,
desc
,
img
,
actions
,
...
rest
})
=>
{
class
Excrption
extends
React
.
PureComponent
{
const
pageType
=
type
in
config
?
type
:
'
404
'
;
static
defaultProps
=
{
const
clsString
=
classNames
(
styles
.
exception
,
className
);
backText
:
'
back to home
'
,
return
(
};
<
div
className
=
{
clsString
}
{...
rest
}
>
constructor
(
props
)
{
<
div
className
=
{
styles
.
imgBlock
}
>
super
(
props
);
<
div
this
.
state
=
{};
className
=
{
styles
.
imgEle
}
}
style
=
{{
backgroundImage
:
`url(
${
img
||
config
[
pageType
].
img
}
)`
}}
render
()
{
/
>
const
{
<
/div
>
className
,
<
div
className
=
{
styles
.
content
}
>
backText
,
<
h1
>
{
title
||
config
[
pageType
].
title
}
<
/h1
>
linkElement
=
'
a
'
,
<
div
className
=
{
styles
.
desc
}
>
{
desc
||
config
[
pageType
].
desc
}
<
/div
>
type
,
<
div
className
=
{
styles
.
actions
}
>
title
,
{
actions
||
desc
,
createElement
(
img
,
linkElement
,
actions
,
{
...
rest
to
:
'
/
'
,
}
=
this
.
props
;
href
:
'
/
'
,
const
pageType
=
type
in
config
?
type
:
'
404
'
;
},
const
clsString
=
classNames
(
styles
.
exception
,
className
);
<
Button
type
=
"
primary
"
>
return
(
<
FormattedMessage
id
=
"
app.exception.back
"
defaultMessage
=
"
Back to home
"
/>
<
div
className
=
{
clsString
}
{...
rest
}
>
<
/Button
>
<
div
className
=
{
styles
.
imgBlock
}
>
)}
<
div
className
=
{
styles
.
imgEle
}
style
=
{{
backgroundImage
:
`url(
${
img
||
config
[
pageType
].
img
}
)`
}}
/
>
<
/div
>
<
div
className
=
{
styles
.
content
}
>
<
h1
>
{
title
||
config
[
pageType
].
title
}
<
/h1
>
<
div
className
=
{
styles
.
desc
}
>
{
desc
||
config
[
pageType
].
desc
}
<
/div
>
<
div
className
=
{
styles
.
actions
}
>
{
actions
||
createElement
(
linkElement
,
{
to
:
'
/
'
,
href
:
'
/
'
,
},
<
Button
type
=
"
primary
"
>
{
backText
}
<
/Button
>
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
}
}
;
}
export
default
injectIntl
(
Exception
)
;
export
default
Excrption
;
src/locales/en-US.js
View file @
3928e0d6
...
@@ -36,7 +36,7 @@ export default {
...
@@ -36,7 +36,7 @@ export default {
'
menu.account.settings
'
:
'
Account Settings
'
,
'
menu.account.settings
'
:
'
Account Settings
'
,
'
menu.account.trigger
'
:
'
Trigger Error
'
,
'
menu.account.trigger
'
:
'
Trigger Error
'
,
'
app.home.introduce
'
:
'
introduce
'
,
'
app.home.introduce
'
:
'
introduce
'
,
'
app.analysis.test
'
:
'
Gongzhuan
road
No.{no} shop
'
,
'
app.analysis.test
'
:
'
Gongzhuan No.{no} shop
'
,
'
app.analysis.introduce
'
:
'
Introduce
'
,
'
app.analysis.introduce
'
:
'
Introduce
'
,
'
app.analysis.total-sales
'
:
'
total sales
'
,
'
app.analysis.total-sales
'
:
'
total sales
'
,
'
app.analysis.day-sales
'
:
'
Day Sales
'
,
'
app.analysis.day-sales
'
:
'
Day Sales
'
,
...
...
src/pages/Exception/403.js
View file @
3928e0d6
...
@@ -11,6 +11,7 @@ class Exception403 extends Component {
...
@@ -11,6 +11,7 @@ class Exception403 extends Component {
desc
=
{
formatMessage
({
id
:
'
app.exception.description.403
'
},
{})}
desc
=
{
formatMessage
({
id
:
'
app.exception.description.403
'
},
{})}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
linkElement
=
{
Link
}
linkElement
=
{
Link
}
backText
=
{
formatMessage
({
id
:
'
app.exception.back
'
})}
/
>
/
>
);
);
}
}
...
...
src/pages/Exception/404.js
View file @
3928e0d6
...
@@ -11,6 +11,7 @@ class Exception404 extends Component {
...
@@ -11,6 +11,7 @@ class Exception404 extends Component {
desc
=
{
formatMessage
({
id
:
'
app.exception.description.404
'
},
{})}
desc
=
{
formatMessage
({
id
:
'
app.exception.description.404
'
},
{})}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
linkElement
=
{
Link
}
linkElement
=
{
Link
}
backText
=
{
formatMessage
({
id
:
'
app.exception.back
'
})}
/
>
/
>
);
);
}
}
...
...
src/pages/Exception/500.js
View file @
3928e0d6
...
@@ -11,6 +11,7 @@ class Exception500 extends Component {
...
@@ -11,6 +11,7 @@ class Exception500 extends Component {
desc
=
{
formatMessage
({
id
:
'
app.exception.description.500
'
},
{})}
desc
=
{
formatMessage
({
id
:
'
app.exception.description.500
'
},
{})}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
style
=
{{
minHeight
:
500
,
height
:
'
80%
'
}}
linkElement
=
{
Link
}
linkElement
=
{
Link
}
backText
=
{
formatMessage
({
id
:
'
app.exception.back
'
})}
/
>
/
>
);
);
}
}
...
...
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