Commit 9990e54b authored by 李纪文's avatar 李纪文

fix: 修改历史回放

parent 1230e64f
......@@ -25,7 +25,7 @@ let twoID = '';
let myDiagram = null;
let editionArr = [];
const guidAggre = {};
const bindData = [];
let 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment