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
5dde9640
Commit
5dde9640
authored
Jun 05, 2023
by
徐乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
9cf69177
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
index.js
packages/extend-components/EC_HistoryView/src/index.js
+5
-4
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+1
-1
No files found.
packages/extend-components/EC_HistoryView/src/index.js
View file @
5dde9640
...
...
@@ -613,7 +613,7 @@ const HistoryView = (props) => {
};
data.forEach((item, index) => {
const { stationCode, sensorName, dataModel } = item;
dataModel.forEach((data) => {
dataModel
&& dataModel
.forEach((data) => {
const formatTime = moment(data.pt).format(format);
let time = formatTime;
...
...
@@ -629,7 +629,7 @@ const HistoryView = (props) => {
data.forEach((child, index) => {
const { dataModel } = child;
const dataIndex = dataIndexAccess(child, index);
dataModel.forEach((value, j) => {
dataModel
&& dataModel
.forEach((value, j) => {
const formatTime = moment(value.pt).format(format);
const dataRow = timeData[formatTime];
if (dataRow) {
...
...
@@ -739,8 +739,8 @@ const HistoryView = (props) => {
const { dateFrom, dateTo } = dateRange?.[index] ?? {};
if (res.code === 0 && res.data.length) {
res.data.forEach((d) => {
d.dateFrom = dateFrom;
d.dateTo = dateTo;
d.dateFrom = dateFrom
|| ''
;
d.dateTo = dateTo
|| ''
;
});
deviceParams.forEach((p) => {
// 返回数据按查询指标顺序排序
...
...
@@ -756,6 +756,7 @@ const HistoryView = (props) => {
} else {
return {};
}
});
data = data.concat(list);
});
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
5dde9640
...
...
@@ -40,7 +40,7 @@ const nameFormatter = (data, contrast, contrastOption, nameWithSensor) => {
* @returns 图表系列数据, [[DateTime, value]]
*/
const
dataAccessor
=
(
data
,
contrast
,
contrastOption
)
=>
{
const
{
dataModel
}
=
data
;
const
dataModel
=
data
?.
dataModel
??
[]
;
let
_currentYear
=
moment
().
format
(
'YYYY'
);
const
formatStr
=
contrastOption
===
'day'
?
`
${
_currentYear
}
-01-01 HH:mm:00`
:
`
${
_currentYear
}
-01-DD HH:mm:00`
;
...
...
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