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
9990e54b
Commit
9990e54b
authored
Apr 12, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改历史回放
parent
1230e64f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+14
-11
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
9990e54b
...
...
@@ -25,7 +25,7 @@ let twoID = '';
let
myDiagram
=
null
;
let
editionArr
=
[];
const
guidAggre
=
{};
cons
t
bindData
=
[];
le
t
bindData
=
[];
const
stationList
=
[];
let
historyData
=
[];
// 历史数据
...
...
@@ -554,6 +554,7 @@ const ConfigurationView = (props) => {
nodeDataArray: [],
linkDataArray: [],
};
bindData = [];
devices.forEach((item, index) => {
const name = `设备${stationList[index]}`;
bindData.push({
...
...
@@ -575,7 +576,8 @@ const ConfigurationView = (props) => {
speed = 0;
const json = JSON.parse(myDiagram.model.toJson());
const jsonCopy = JSON.parse(JSON.stringify(json));
const acrossTables = bindData.map((list) => {
const acrossTables = [];
bindData.map((list) => {
let sensors = [];
jsonCopy.nodeDataArray.forEach((item) => {
item.shName && item.stationName === list.name && sensors.push(item.shName);
...
...
@@ -583,11 +585,12 @@ const ConfigurationView = (props) => {
jsonCopy.linkDataArray.forEach((item) => {
item.shName && item.stationName === list.name && sensors.push(item.shName);
});
return {
deviceType: list.type,
sensors: Array.from(new Set(sensors)).join('
,
'),
deviceCode: list.code,
};
if (sensors.length)
acrossTables.push({
deviceType: list.type,
sensors: Array.from(new Set(sensors)).join('
,
'),
deviceCode: list.code,
});
});
const params = {
isDilute: true,
...
...
@@ -605,7 +608,7 @@ const ConfigurationView = (props) => {
let timeArr = [];
historyData.forEach((item) => {
const timeList = item.dataModel.map((list) => {
return moment(list.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
');
return moment(list.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
:
ss
');
});
timeArr = timeArr.concat(timeList);
});
...
...
@@ -638,7 +641,7 @@ const ConfigurationView = (props) => {
return arr.code === list.stationCode;
});
const pvList = list.dataModel.find((arr) => {
return moment(arr.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
') === time;
return moment(arr.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
:
ss
') === time;
});
if (!bindList || item.stationName !== bindList.name) return false;
if (
...
...
@@ -680,7 +683,7 @@ const ConfigurationView = (props) => {
return arr.code === list.stationCode;
});
const pvList = list.dataModel.find((arr) => {
return moment(arr.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
') === time;
return moment(arr.pt).format('
yyyy
-
MM
-
DD
HH
:
mm
:
ss
') === time;
});
if (!bindList || item.stationName !== bindList.name) return false;
if (
...
...
@@ -735,7 +738,7 @@ const ConfigurationView = (props) => {
speed = speed + 1;
if (speed >= timeData.length) {
play = false;
loopLoadMethod(timeData.
pop()
);
loopLoadMethod(timeData.
slice(-1)[0]
);
return false;
}
chartHistoryDataRender(historyData);
...
...
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