Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ReactWeb5
wisdom-components
Commits
6f5b036e
Commit
6f5b036e
authored
May 17, 2021
by
涂茜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bug
parent
eccb9363
Pipeline
#27760
passed with stages
in 5 minutes 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
index.js
packages/extend-components/EC_HistoryInfo/src/index.js
+26
-9
No files found.
packages/extend-components/EC_HistoryInfo/src/index.js
View file @
6f5b036e
...
...
@@ -212,7 +212,6 @@ const HistoryInfo = (props) => {
const
[
dataThinKey
,
setDataThinKey
]
=
useState
(
timeIntervalList
[
0
].
key
);
const
[
options
,
setOptions
]
=
useState
({});
const
[
colors
,
setColors
]
=
useState
(
defaultColors
);
const
[
params
,
setParams
]
=
useState
(
historyInfoParams
);
const
[
tableData
,
setTableData
]
=
useState
([]);
const
[
pageSize
,
setPageSize
]
=
useState
(
20
);
const
[
series
,
setSeries
]
=
useState
([]);
...
...
@@ -237,9 +236,21 @@ const HistoryInfo = (props) => {
const
seriesData
=
[];
resData
.
forEach
((
item
)
=>
{
const
data
=
[];
item
.
dataModel
.
forEach
((
child
)
=>
{
data
.
push
([
moment
(
child
.
pt
).
valueOf
(),
child
.
pv
]);
});
if
(
item
.
dataModel
.
length
)
{
if
(
timeValue
===
'contrast'
)
{
// 同期对比
item
.
dataModel
.
forEach
((
child
)
=>
{
const
formatTime
=
moment
(
child
.
pt
).
format
(
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
,
);
data
.
push
([
moment
(
formatTime
).
valueOf
(),
child
.
pv
]);
});
}
else
{
item
.
dataModel
.
forEach
((
child
)
=>
{
data
.
push
([
moment
(
child
.
pt
).
valueOf
(),
child
.
pv
]);
});
}
}
const
obj
=
{
name
:
item
.
equipmentName
+
'-'
+
item
.
sensorName
,
sensorName
:
item
.
sensorName
,
...
...
@@ -274,8 +285,11 @@ const HistoryInfo = (props) => {
// 处理采集时间
resData
.
forEach
((
item
)
=>
{
item
.
dataModel
.
forEach
((
data
)
=>
{
if
(
!
timeData
.
includes
(
data
.
pt
))
{
timeData
.
push
(
data
.
pt
);
const
formatTime
=
moment
(
data
.
pt
).
format
(
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
,
);
if
(
!
timeData
.
includes
(
formatTime
))
{
timeData
.
push
(
formatTime
);
}
});
});
...
...
@@ -301,7 +315,10 @@ const HistoryInfo = (props) => {
tableData
.
forEach
((
item
,
i
)
=>
{
resData
.
forEach
((
child
,
index
)
=>
{
child
.
dataModel
.
forEach
((
value
,
j
)
=>
{
if
(
timeData
[
i
]
===
value
.
pt
)
item
[
`value
${
index
+
1
}
`
]
=
value
.
pv
;
const
formatTime
=
moment
(
value
.
pt
).
format
(
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
,
);
if
(
timeData
[
i
]
===
formatTime
)
item
[
`value
${
index
+
1
}
`
]
=
value
.
pv
;
});
});
});
...
...
@@ -315,8 +332,8 @@ const HistoryInfo = (props) => {
const
requestArr
=
[];
dateRange
.
forEach
((
item
)
=>
{
const
param
=
{
...
p
arams
,
stream
:
p
arams
.
stream
.
map
((
child
)
=>
({
...
historyInfoP
arams
,
stream
:
historyInfoP
arams
.
stream
.
map
((
child
)
=>
({
...
child
,
dateFrom
:
item
.
dateFrom
,
dateTo
:
item
.
dateTo
,
...
...
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