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
81ff030b
Commit
81ff030b
authored
Mar 25, 2019
by
chen shuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Optimize the display of toolTips
parent
2d409d42
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
24 deletions
+32
-24
src/components/Charts/MiniProgress/index.js
src/components/Charts/MiniProgress/index.js
+20
-22
src/components/Charts/MiniProgress/index.less
src/components/Charts/MiniProgress/index.less
+2
-0
src/pages/Dashboard/IntroduceRow.js
src/pages/Dashboard/IntroduceRow.js
+10
-2
No files found.
src/components/Charts/MiniProgress/index.js
View file @
81ff030b
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Tooltip
}
from
'
antd
'
;
import
{
Tooltip
}
from
'
antd
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
...
@@ -10,12 +9,10 @@ const MiniProgress = ({
...
@@ -10,12 +9,10 @@ const MiniProgress = ({
color
=
'
rgb(19, 194, 194)
'
,
color
=
'
rgb(19, 194, 194)
'
,
strokeWidth
,
strokeWidth
,
percent
,
percent
,
})
=>
(
})
=>
{
return
(
<
div
className
=
{
styles
.
miniProgress
}
>
<
div
className
=
{
styles
.
miniProgress
}
>
<
Tooltip
<
Tooltip
title
=
{
targetLabel
}
>
title
=
{
`
${
targetLabel
||
formatMessage
({
id
:
'
component.miniProgress.tooltipDefault
'
}).
concat
(
'
:
'
)}
${
target
}
%`
}
>
<
div
className
=
{
styles
.
target
}
style
=
{{
left
:
target
?
`
${
target
}
%`
:
null
}}
>
<
div
className
=
{
styles
.
target
}
style
=
{{
left
:
target
?
`
${
target
}
%`
:
null
}}
>
<
span
style
=
{{
backgroundColor
:
color
||
null
}}
/
>
<
span
style
=
{{
backgroundColor
:
color
||
null
}}
/
>
<
span
style
=
{{
backgroundColor
:
color
||
null
}}
/
>
<
span
style
=
{{
backgroundColor
:
color
||
null
}}
/
>
...
@@ -32,6 +29,7 @@ const MiniProgress = ({
...
@@ -32,6 +29,7 @@ const MiniProgress = ({
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
};
export
default
MiniProgress
;
export
default
MiniProgress
;
src/components/Charts/MiniProgress/index.less
View file @
81ff030b
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
position: absolute;
position: absolute;
top: 0;
top: 0;
bottom: 0;
bottom: 0;
z-index: 9;
width: 20px;
span {
span {
position: absolute;
position: absolute;
top: 0;
top: 0;
...
...
src/pages/Dashboard/IntroduceRow.js
View file @
81ff030b
import
React
,
{
memo
}
from
'
react
'
;
import
React
,
{
memo
}
from
'
react
'
;
import
{
Row
,
Col
,
Icon
,
Tooltip
}
from
'
antd
'
;
import
{
Row
,
Col
,
Icon
,
Tooltip
}
from
'
antd
'
;
import
{
FormattedMessage
}
from
'
umi/locale
'
;
import
{
FormattedMessage
,
formatMessage
}
from
'
umi/locale
'
;
import
styles
from
'
./Analysis.less
'
;
import
styles
from
'
./Analysis.less
'
;
import
{
ChartCard
,
MiniArea
,
MiniBar
,
MiniProgress
,
Field
}
from
'
@/components/Charts
'
;
import
{
ChartCard
,
MiniArea
,
MiniBar
,
MiniProgress
,
Field
}
from
'
@/components/Charts
'
;
import
Trend
from
'
@/components/Trend
'
;
import
Trend
from
'
@/components/Trend
'
;
...
@@ -135,7 +135,15 @@ const IntroduceRow = memo(({ loading, visitData }) => (
...
@@ -135,7 +135,15 @@ const IntroduceRow = memo(({ loading, visitData }) => (
}
}
contentHeight
=
{
46
}
contentHeight
=
{
46
}
>
>
<
MiniProgress
percent
=
{
78
}
strokeWidth
=
{
8
}
target
=
{
80
}
color
=
"
#13C2C2
"
/>
<
MiniProgress
percent
=
{
78
}
strokeWidth
=
{
8
}
target
=
{
80
}
targetLabel
=
{
`
${
formatMessage
({
id
:
'
component.miniProgress.tooltipDefault
'
}).
concat
(
'
:
'
)}
80%`
}
color
=
"
#13C2C2
"
/>
<
/ChartCard
>
<
/ChartCard
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
...
...
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