Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟@五瓣科技
graph
Commits
7f547e82
Commit
7f547e82
authored
Nov 10, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
3485911c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
App.js
src/App.js
+24
-3
No files found.
src/App.js
View file @
7f547e82
...
@@ -25,6 +25,8 @@ class App extends Component {
...
@@ -25,6 +25,8 @@ class App extends Component {
// endblockOld:0,
// endblockOld:0,
// count:0,
// count:0,
// endCount:0,
// endCount:0,
altitude
:
0
,
datazoom
:
false
,
}
}
inputChangeValue
(){
inputChangeValue
(){
let
val
=
this
.
refs
.
inputvalue
.
value
;
let
val
=
this
.
refs
.
inputvalue
.
value
;
...
@@ -232,6 +234,9 @@ class App extends Component {
...
@@ -232,6 +234,9 @@ class App extends Component {
}
}
if
(
item2
.
label
!==
undefined
){
if
(
item2
.
label
!==
undefined
){
startBlock
=
item2
.
label
.
formatter
startBlock
=
item2
.
label
.
formatter
that
.
setState
({
altitude
:
startBlock
})
endBlock
=
item2
.
label
.
formatter
endBlock
=
item2
.
label
.
formatter
min3
=
item2
.
xAxis
min3
=
item2
.
xAxis
}
}
...
@@ -248,6 +253,9 @@ class App extends Component {
...
@@ -248,6 +253,9 @@ class App extends Component {
min
=
min2
min
=
min2
if
(
item2
.
label
!==
undefined
){
if
(
item2
.
label
!==
undefined
){
startBlock
=
item2
.
label
.
formatter
startBlock
=
item2
.
label
.
formatter
that
.
setState
({
altitude
:
startBlock
})
min3
=
item2
.
xAxis
min3
=
item2
.
xAxis
}
}
}
}
...
@@ -264,6 +272,7 @@ class App extends Component {
...
@@ -264,6 +272,7 @@ class App extends Component {
})
})
})
})
if
(
params
.
start
===
0
){
if
(
params
.
start
===
0
){
myChart
.
showLoading
()
myChart
.
showLoading
()
console
.
log
(
startBlock
,
'
startBlock
'
)
console
.
log
(
startBlock
,
'
startBlock
'
)
...
@@ -280,6 +289,7 @@ class App extends Component {
...
@@ -280,6 +289,7 @@ class App extends Component {
// })
// })
// }
// }
that
.
setState
({
that
.
setState
({
datazoom
:
true
,
// requestDuration:-100,
// requestDuration:-100,
duration
:
-
10
,
duration
:
-
10
,
},()
=>
{
},()
=>
{
...
@@ -517,7 +527,11 @@ class App extends Component {
...
@@ -517,7 +527,11 @@ class App extends Component {
mintime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
mintime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
mintime
.
subtract
(
-
(
this
.
state
.
duration
),
'
seconds
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
mintime
.
subtract
(
-
(
this
.
state
.
duration
),
'
seconds
'
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
}
}
// console.log(this.state.duration,'duration' , '--------','requestDuration:',this.state.requestDuration)
// console.log(moment(data.result.AxisX.BlockTime/1000000).format('YYYY-MM-DD HH:mm:ss'),'maxtime')
// console.log(mintime.subtract(-(this.state.duration),'seconds').format('YYYY-MM-DD HH:mm:ss'),'mintime')
if
(
this
.
state
.
duration
>
0
){
if
(
this
.
state
.
duration
>
0
){
mintime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
);
mintime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
);
maxtime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
maxtime
=
moment
(
data
.
result
.
AxisX
.
BlockTime
/
1000000
)
...
@@ -663,7 +677,9 @@ class App extends Component {
...
@@ -663,7 +677,9 @@ class App extends Component {
})
})
},
},
max
:
this
.
state
.
duration
<
0
?
maxtime
.
unix
()
*
1000000000
:
maxtime
.
add
(
100
,
'
second
'
).
unix
()
*
1000000000
,
max
:
this
.
state
.
duration
<
0
?
maxtime
.
unix
()
*
1000000000
:
maxtime
.
add
(
100
,
'
second
'
).
unix
()
*
1000000000
,
min
:
this
.
state
.
duration
<
0
?
mintime
.
subtract
(
100
,
'
second
'
).
unix
()
*
1000000000
:
mintime
.
unix
()
*
1000000000
,
min
:
this
.
state
.
duration
<
0
?
mintime
.
subtract
(
-
(
this
.
state
.
inputtime
),
'
second
'
).
unix
()
*
1000000000
:
mintime
.
unix
()
*
1000000000
,
// max:this.state.requestDuration < 0 ? maxtime.unix()*1000000000 : maxtime.add(100,'second').unix()*1000000000,
// min:this.state.requestDuration <0 ? mintime.subtract(100,'second').unix()*1000000000 : mintime.unix()*1000000000,
axisLine
:{
axisLine
:{
show
:
true
,
show
:
true
,
...
@@ -724,6 +740,9 @@ class App extends Component {
...
@@ -724,6 +740,9 @@ class App extends Component {
startText
:
moment
((
option
.
xAxis
[
0
].
min
)
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
startText
:
moment
((
option
.
xAxis
[
0
].
min
)
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
),
endText
:
moment
((
option
.
xAxis
[
0
].
max
)
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
endText
:
moment
((
option
.
xAxis
[
0
].
max
)
/
1000000
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
})
})
console
.
log
(
option
.
xAxis
[
0
].
min
,
'
min
'
,
option
.
xAxis
[
0
].
max
,
'
max
'
)
console
.
log
(
option
.
xAxis
,
'
aa
'
)
console
.
log
(
option
.
xAxis
[
0
],
'
aa00
'
)
myChart
.
setOption
(
option
,
true
);
myChart
.
setOption
(
option
,
true
);
this
.
extension
(
myChart
);
this
.
extension
(
myChart
);
}
}
...
@@ -800,6 +819,7 @@ class App extends Component {
...
@@ -800,6 +819,7 @@ class App extends Component {
}
}
})
})
}
}
render
()
{
render
()
{
const
{
startText
,
endText
}
=
this
.
state
const
{
startText
,
endText
}
=
this
.
state
return
(
return
(
...
@@ -820,7 +840,8 @@ class App extends Component {
...
@@ -820,7 +840,8 @@ class App extends Component {
<input ref="inputtime" defaultValue='-100' onChange={()=>this.inputChangeTime()} style={{width:'30%',textAlign:'center'}}/>
<input ref="inputtime" defaultValue='-100' onChange={()=>this.inputChangeTime()} style={{width:'30%',textAlign:'center'}}/>
<button onClick={()=>this.getInputTime()} style={{cursor:'pointer'}}>切换时间</button>
<button onClick={()=>this.getInputTime()} style={{cursor:'pointer'}}>切换时间</button>
</div> */
}
</div> */
}
<
div
>
当前高度:
{
this
.
state
.
inputvalue
}
<
/div
>
{
/* <div>当前高度:{this.state.inputvalue}</div> */
}
<
div
>
当前高度:
{
this
.
state
.
inputvalue
==
0
&&
this
.
state
.
datazoom
==
false
?
`
${
0
}
`
:
this
.
state
.
inputvalue
!=
0
&&
this
.
state
.
datazoom
==
false
?
`
${
this
.
state
.
inputvalue
}
`
:
this
.
state
.
datazoom
==
true
?
`
${
this
.
state
.
altitude
}
`
:
`
${
this
.
state
.
inputvalue
}
`
}
<
/div
>
<
div
>
当前时间:
{
this
.
state
.
inputtime
==
-
100
?
`
${
-
100
}
`
:
this
.
state
.
inputtime
}
<
/div
>
<
div
>
当前时间:
{
this
.
state
.
inputtime
==
-
100
?
`
${
-
100
}
`
:
this
.
state
.
inputtime
}
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
position
:
'
relative
'
}}
>
<
div
style
=
{{
position
:
'
relative
'
}}
>
...
...
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