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
ac133a1f
Commit
ac133a1f
authored
Sep 06, 2018
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #2173 Wrong rendering logic
parent
d247ab26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
src/components/Charts/WaterWave/index.js
src/components/Charts/WaterWave/index.js
+7
-7
src/pages/Dashboard/Monitor.js
src/pages/Dashboard/Monitor.js
+2
-1
src/pages/Dashboard/Workplace.js
src/pages/Dashboard/Workplace.js
+2
-1
No files found.
src/components/Charts/WaterWave/index.js
View file @
ac133a1f
...
@@ -27,7 +27,8 @@ class WaterWave extends PureComponent {
...
@@ -27,7 +27,8 @@ class WaterWave extends PureComponent {
componentDidUpdate
(
props
)
{
componentDidUpdate
(
props
)
{
const
{
percent
}
=
this
.
props
;
const
{
percent
}
=
this
.
props
;
if
(
props
.
percent
!==
percent
)
{
if
(
props
.
percent
!==
percent
)
{
this
.
renderChart
();
// δΈε θΏδΈͺδΌι ζη»εΆηΌζ ’
this
.
renderChart
(
'
update
'
);
}
}
}
}
...
@@ -49,10 +50,11 @@ class WaterWave extends PureComponent {
...
@@ -49,10 +50,11 @@ class WaterWave extends PureComponent {
}
}
};
};
renderChart
()
{
renderChart
(
type
)
{
const
{
percent
,
color
=
'
#1890FF
'
}
=
this
.
props
;
const
{
percent
,
color
=
'
#1890FF
'
}
=
this
.
props
;
const
data
=
percent
/
100
;
const
data
=
percent
/
100
;
const
self
=
this
;
const
self
=
this
;
cancelAnimationFrame
(
this
.
timer
);
if
(
!
this
.
node
||
(
data
!==
0
&&
!
data
))
{
if
(
!
this
.
node
||
(
data
!==
0
&&
!
data
))
{
return
;
return
;
...
@@ -60,7 +62,6 @@ class WaterWave extends PureComponent {
...
@@ -60,7 +62,6 @@ class WaterWave extends PureComponent {
const
canvas
=
this
.
node
;
const
canvas
=
this
.
node
;
const
ctx
=
canvas
.
getContext
(
'
2d
'
);
const
ctx
=
canvas
.
getContext
(
'
2d
'
);
const
canvasWidth
=
canvas
.
width
;
const
canvasWidth
=
canvas
.
width
;
const
canvasHeight
=
canvas
.
height
;
const
canvasHeight
=
canvas
.
height
;
const
radius
=
canvasWidth
/
2
;
const
radius
=
canvasWidth
/
2
;
...
@@ -115,7 +116,7 @@ class WaterWave extends PureComponent {
...
@@ -115,7 +116,7 @@ class WaterWave extends PureComponent {
const
gradient
=
ctx
.
createLinearGradient
(
0
,
0
,
0
,
canvasHeight
);
const
gradient
=
ctx
.
createLinearGradient
(
0
,
0
,
0
,
canvasHeight
);
gradient
.
addColorStop
(
0
,
'
#ffffff
'
);
gradient
.
addColorStop
(
0
,
'
#ffffff
'
);
gradient
.
addColorStop
(
1
,
'
#1890FF
'
);
gradient
.
addColorStop
(
1
,
color
);
ctx
.
fillStyle
=
gradient
;
ctx
.
fillStyle
=
gradient
;
ctx
.
fill
();
ctx
.
fill
();
ctx
.
restore
();
ctx
.
restore
();
...
@@ -123,7 +124,7 @@ class WaterWave extends PureComponent {
...
@@ -123,7 +124,7 @@ class WaterWave extends PureComponent {
function
render
()
{
function
render
()
{
ctx
.
clearRect
(
0
,
0
,
canvasWidth
,
canvasHeight
);
ctx
.
clearRect
(
0
,
0
,
canvasWidth
,
canvasHeight
);
if
(
circleLock
)
{
if
(
circleLock
&&
type
!==
'
update
'
)
{
if
(
arcStack
.
length
)
{
if
(
arcStack
.
length
)
{
const
temp
=
arcStack
.
shift
();
const
temp
=
arcStack
.
shift
();
ctx
.
lineTo
(
temp
[
0
],
temp
[
1
]);
ctx
.
lineTo
(
temp
[
0
],
temp
[
1
]);
...
@@ -145,7 +146,7 @@ class WaterWave extends PureComponent {
...
@@ -145,7 +146,7 @@ class WaterWave extends PureComponent {
ctx
.
restore
();
ctx
.
restore
();
ctx
.
clip
();
ctx
.
clip
();
ctx
.
fillStyle
=
'
#1890FF
'
;
ctx
.
fillStyle
=
color
;
}
}
}
else
{
}
else
{
if
(
data
>=
0.85
)
{
if
(
data
>=
0.85
)
{
...
@@ -180,7 +181,6 @@ class WaterWave extends PureComponent {
...
@@ -180,7 +181,6 @@ class WaterWave extends PureComponent {
}
}
self
.
timer
=
requestAnimationFrame
(
render
);
self
.
timer
=
requestAnimationFrame
(
render
);
}
}
render
();
render
();
}
}
...
...
src/pages/Dashboard/Monitor.js
View file @
ac133a1f
...
@@ -21,7 +21,6 @@ const havePermissionAsync = new Promise(resolve => {
...
@@ -21,7 +21,6 @@ const havePermissionAsync = new Promise(resolve => {
setTimeout
(()
=>
resolve
(),
300
);
setTimeout
(()
=>
resolve
(),
300
);
});
});
export
default
@
Secured
(
havePermissionAsync
)
@
Secured
(
havePermissionAsync
)
@
connect
(({
monitor
,
loading
})
=>
({
@
connect
(({
monitor
,
loading
})
=>
({
monitor
,
monitor
,
...
@@ -153,3 +152,5 @@ class Monitor extends PureComponent {
...
@@ -153,3 +152,5 @@ class Monitor extends PureComponent {
);
);
}
}
}
}
export
default
Monitor
;
src/pages/Dashboard/Workplace.js
View file @
ac133a1f
...
@@ -37,7 +37,6 @@ const links = [
...
@@ -37,7 +37,6 @@ const links = [
},
},
];
];
export
default
@
connect
(({
user
,
project
,
activities
,
chart
,
loading
})
=>
({
@
connect
(({
user
,
project
,
activities
,
chart
,
loading
})
=>
({
currentUser
:
user
.
currentUser
,
currentUser
:
user
.
currentUser
,
project
,
project
,
...
@@ -253,3 +252,5 @@ class Workplace extends PureComponent {
...
@@ -253,3 +252,5 @@ class Workplace extends PureComponent {
);
);
}
}
}
}
export
default
Workplace
;
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