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
d47334d7
Commit
d47334d7
authored
Jun 03, 2021
by
涂茜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改历史曲线表格采集时间展示问题及分页问题
parent
10071c85
Pipeline
#29060
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
index.js
packages/extend-components/EC_HistoryInfo/src/index.js
+8
-8
No files found.
packages/extend-components/EC_HistoryInfo/src/index.js
View file @
d47334d7
...
...
@@ -213,7 +213,7 @@ const HistoryInfo = (props) => {
const
[
options
,
setOptions
]
=
useState
({});
const
[
colors
,
setColors
]
=
useState
(
defaultColors
);
const
[
tableData
,
setTableData
]
=
useState
([]);
const
[
pageSize
,
setPageSize
]
=
useState
(
2
0
);
const
[
pageSize
,
setPageSize
]
=
useState
(
2
);
const
[
series
,
setSeries
]
=
useState
([]);
const
[
columns
,
setColumns
]
=
useState
([
{
...
...
@@ -282,12 +282,14 @@ const HistoryInfo = (props) => {
return
aa
.
localeCompare
(
bb
);
});
};
let
format
=
timeFormat
;
if
(
timeValue
===
'contrast'
)
{
format
=
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
;
}
// 处理采集时间
resData
.
forEach
((
item
)
=>
{
item
.
dataModel
.
forEach
((
data
)
=>
{
const
formatTime
=
moment
(
data
.
pt
).
format
(
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
,
);
const
formatTime
=
moment
(
data
.
pt
).
format
(
format
);
if
(
!
timeData
.
includes
(
formatTime
))
{
timeData
.
push
(
formatTime
);
}
...
...
@@ -315,9 +317,7 @@ const HistoryInfo = (props) => {
tableData
.
forEach
((
item
,
i
)
=>
{
resData
.
forEach
((
child
,
index
)
=>
{
child
.
dataModel
.
forEach
((
value
,
j
)
=>
{
const
formatTime
=
moment
(
value
.
pt
).
format
(
contrastOption
===
'day'
?
'2020-01-01 HH:mm:00'
:
'2020-01-DD HH:mm:00'
,
);
const
formatTime
=
moment
(
value
.
pt
).
format
(
format
);
if
(
timeData
[
i
]
===
formatTime
)
item
[
`value
${
index
+
1
}
`
]
=
value
.
pv
;
});
});
...
...
@@ -789,7 +789,7 @@ const HistoryInfo = (props) => {
dataSource
=
{
tableData
}
columns
=
{
columns
}
{...
tableProps
}
pagination
=
{{
pageSize
}}
pagination
=
{{
pageSize
,
showQuickJumper
:
true
,
showSizeChanger
:
true
}}
onChange
=
{(
value
)
=>
{
setPageSize
(
value
.
pageSize
);
}}
...
...
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