Commit 24c296db authored by 陈龙's avatar 陈龙

fix: 修复历史曲线中,异常数据导致的bug

parent 22fabdf0
......@@ -33,6 +33,8 @@
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"antd-mobile": "5.10.4"
"antd-mobile": "5.10.4",
"rc-resize-observer": "1.4.0",
"react-window": "1.8.9"
}
}
......@@ -12,9 +12,9 @@ path: /
基础业务组件
- 曲线模式
- 数据强制自动抽稀
- 数据强制自动抽稀
- 表格模式
- 默认开启抽稀模式,可选择抽稀
- 默认开启抽稀模式,可选择抽稀
## 何时使用
......@@ -26,21 +26,17 @@ path: /
## 单图表-状态
[//]: # (<code src="./demos/indexForStatus.js"></code>)
[//]: # '<code src="./demos/indexForStatus.js"></code>'
## 单图表-频率
[//]: # (<code src="./demos/indexForFrequency.js"></code>)
[//]: # (## 移动端)
[//]: # (<code src="./demos/mobile.js"></code>)
[//]: # '<code src="./demos/indexForFrequency.js"></code>'
[//]: # '## 移动端'
[//]: # '<code src="./demos/mobile.js"></code>'
## 多图表
<code src="./demos/GridDemo.js"></code>
<!-- <code src="./demos/GridDemo.js"></code> -->
## API
......@@ -77,7 +73,7 @@ path: /
dateFrom: '2022-02-02 00:00:00',
dateTo: '2022-02-02 23:59:59',
}
// deviceParams
// deviceParams
deviceParams:[{
deviceCode: 'EGBF00000146', // 设备编码
sensors: '进水压力,出水瞬时流量', // 设备查询指标
......
import React from 'react';
import HistoryView from '../index';
import { MobileHistoryChart } from "../mobile";
import { MobileHistoryChart } from '../mobile';
const deviceParams = [
/*10.182*/
/* {
/*10.182*/
/* {
"deviceCode": "EGBF00000136",
"sensors": "进水压力,出水压力,出水瞬时流量,今日供水量,1#水箱液位,视频报警",
// "sensors": "视频报警",
// "sensors": "进水压力,出水压力,出水瞬时流量,今日供水量,1#水箱液位,视频报警",
"sensors": "视频报警",
"deviceType": "二供泵房"
},*/
/* {
}, */
/* {
"deviceCode": "EGJZ00000158",
// "sensors": "进水压力,出水压力,泵1状态",
"sensors": "进水压力",
// "sensors": "泵1状态",
"deviceType": "二供机组"
} */
/* {
/* {
deviceCode: 'EGBF00000141',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力',
deviceType: '熊猫二供泵房',
pointAddressID: 208,
},*/
/* {
/* {
"deviceCode": "SYJ00000008",
"sensors": "瞬时流量",
"deviceType": "水源井"
},*/
/* {
/* {
deviceCode: 'EGJZ00000197',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
// sensors: '1#变频器运行频率',
deviceType: '二供机组',
// pointAddressID: 208,
},*/
/* {
/* {
deviceCode: 'EGJZ00000198',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
// sensors: '1#变频器运行频率',
deviceType: '二供机组',
// pointAddressID: 208,
}, */
/* {
/* {
// deviceCode: 'EGBF00000002',
// deviceCode: 'EGBF00000018',
// deviceCode: 'XMYL00000345',
......@@ -54,24 +54,24 @@ const deviceParams = [
deviceType: '熊猫压力表',
pointAddressID: 4,
},*/
/* {
/* {
deviceCode: 'EGJZ00000226',
sensors: '出水压力',
deviceType: '二供机组',
pointAddressID: 4,
}, */
/* {
/* {
"deviceCode": "LLJ00000055",
"sensors": "正累计流量,瞬时流量",
"deviceType": "流量计"
}*/
/* {
/* {
"deviceCode": "EGJZ00000163",
"sensors": "进水压力",
"deviceType": "二供机组"
}*/
// 邳州张楼水厂
/* {
// 邳州张楼水厂
/* {
"deviceCode": "SC00000023",
"sensors": "瞬时流量",
"deviceType": "水厂"
......@@ -82,7 +82,7 @@ const deviceParams = [
"deviceType": "加矾间"
}, */
/* {
/* {
"deviceCode": "QSBF00000001",
"sensors": "取水浊度",
"deviceType": "取水泵房"
......@@ -102,49 +102,55 @@ const deviceParams = [
"sensors": "瞬时流量",
"deviceType": "流量计"
},*/
/* {
/* {
deviceCode: 'EGJZ00000027',
sensors: '2#变频器运行频率',
deviceType: '二供机组',
}, */
/*确山*/
/*泵3状态*/
/* {
/*确山*/
/*泵3状态*/
/* {
// EGJZ00000003
deviceCode: 'EGJZ00000003',
// sensors: '3#频率',
sensors: '出1累计流量',
deviceType: '二供机组',
},*/
/* {
/* {
"deviceCode": "EGBF00000006",
"sensors": "出1累计流量",
"deviceType": "二供泵房"
}*/
// 永吉
/* {
// 永吉
/* {
"deviceCode": "SZJCY00000001",
"sensors": "pH",
"deviceType": "水质监测仪"
}*/
// 滦州
{
// 滦州
/* {
"deviceCode": "XMSB00000015",
"sensors": "今日出水量",
"deviceType": "熊猫水表"
}
} */
{
deviceCode: 'SYJ00000003',
sensors: '站点在线状态',
deviceType: '水源井',
},
];
const Demo = () => {
return (
<>
<div>
<div style={{ height: 700 }}>
<HistoryView deviceParams={deviceParams} defaultModel="table" />
</div>
</div>
</>
);
return (
<>
<div>
<div style={{ height: 700 }}>
{/* <HistoryView deviceParams={deviceParams} defaultModel="table" /> */}
<HistoryView deviceParams={deviceParams} defaultModel="curve" />
</div>
</div>
</>
);
};
export default Demo;
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -538,12 +538,12 @@ const returnXAxis = ({
// 需求变更:设备离线改用“是否在线”的数据,离线的状态标记的数据用该部分的数据。 2023年4月25日09:36:55
// 暂时注释,离线逻辑需要再确认 2023-09-15
/* let _offlineAreasData = _offlineData
.find((offline) => offline.stationCode === item.stationCode);
let offlineAreas = offlineArea(_offlineAreasData);
if (offlineAreas.data?.length) {
restOption.markArea = null;
markArea = offlineAreas;
}*/
.find((offline) => offline.stationCode === item.stationCode);
let offlineAreas = offlineArea(_offlineAreasData);
if (offlineAreas.data?.length) {
restOption.markArea = null;
markArea = offlineAreas;
}*/
// 需求新增:增加频率业务
return {
notMerge: true,
......@@ -1143,7 +1143,7 @@ const optionGenerator = (
}
// 单曲线需要标记最大值、最小值的情况下,需要增加自定义的series,将最大最小值显示在图表上
if (dataSource?.[0]?.dataModel?.length && chartType === 'lineChart') {
let _dataSource = dataSource?.filter(item => item.pv);
let _dataSource = dataSource?.filter((item) => item?.dataModel?.length);
if (_dataSource?.length) {
let _customSeries = returnCustomSeries(dataSource);
series.push(_customSeries);
......@@ -1178,7 +1178,6 @@ const handleDataSource = (dataSource) => {
let _temp = null;
let _data = [];
let _dataLength = dataSource[0].dataModel.length;
// handleSpecial2()
dataSource[0].dataModel.forEach((item, index) => {
if (index === 0) {
_data.push(item);
......@@ -1221,7 +1220,7 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => {
final[_arr[0]] = _arr[1];
return final;
}, {});
name = _valDescMap[data1.pv];
name = _valDescMap[data1.pv || 0];
color = _colorMap[name];
}
......@@ -1235,8 +1234,8 @@ const handleSpecial2 = (special, sensorName, sensorType, data1, data2) => {
0: '关',
1: '开',
};
name = _switchNameMap[data1.pv];
color = _switchColorMap[data1.pv];
name = _switchNameMap[data1.pv || 0];
color = _switchColorMap[data1.pv || 0];
}
value1 = moment(data1.pt).valueOf();
......
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