Commit 37e05e0e authored by 陈龙's avatar 陈龙

feat: 提交变更

parent ff3d1098
import React from 'react';
import HistoryView from '../index';
/*const deviceParams = [
const deviceParams = [
{
deviceCode: 'EGBF00000146',
sensors: '进水压力,出水瞬时流量,出水累计流量',
......@@ -21,8 +21,8 @@ import HistoryView from '../index';
deviceType: '二供泵房',
pointAddressID: 4,
},
];*/
const deviceParams = [
];
/*const deviceParams = [
{
"deviceCode": "LLJ00000055",
"sensors": "瞬时流量,正累计流量,是否在线",
......@@ -33,7 +33,7 @@ const deviceParams = [
"sensors": "瞬时流量,正累计流量,是否在线",
"deviceType": "流量计"
}
]
]*/
const Demo = () => {
return <div style={{ height: 700 }}>
<HistoryView deviceParams={deviceParams} grid />
......
......@@ -3,13 +3,13 @@ import HistoryView from '../index';
import {MobileHistoryChart} from "../mobile";
const deviceParams = [
{
/* {
deviceCode: 'EGBF00000141',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力',
deviceType: '二供泵房',
pointAddressID: 208,
},
},*/
/* {
// deviceCode: 'EGBF00000002',
// deviceCode: 'EGBF00000018',
......@@ -37,6 +37,12 @@ const deviceParams = [
"sensors": "进水压力,是否在线",
"deviceType": "二供机组"
}*/
// 邳州张楼水厂
{
"deviceCode": "LLJ00000004",
"sensors": "瞬时流量,是否在线",
"deviceType": "流量计"
}
];
const Demo = () => {
return (
......
......@@ -554,10 +554,11 @@ const HistoryView = (props) => {
let fileName = `数据报表-${i.deviceType}-${i.deviceCode}-${moment(timeFrom).format(
dateFormat,
)}${moment(timeTo).format(dateFormat)}`;
let _quotas = i.sensors.split(',').filter(item=> item!=='是否在线').join(',')
getExportDeviceHistoryUrl({
deviceType: i.deviceType,
deviceCode: i.deviceCode,
quotas: i.sensors,
quotas: _quotas,
startTime: timeFrom,
endTime: timeTo,
fileName: fileName,
......@@ -576,6 +577,8 @@ const HistoryView = (props) => {
};
const handleTableData = useCallback((data) => {
// eslint-disable-next-line no-param-reassign
data = data.filter(item => item.sensorName !== '是否在线');
const ignoreOutliers = checkboxData.find((item) => item.key === 'ignoreOutliers').checked;
const dataIndexAccess = (dataItem, index) => {
const {stationCode, sensorName} = dataItem;
......@@ -659,7 +662,7 @@ const HistoryView = (props) => {
const tableData = times.map((time) => timeData[time]);
setColumns([timeColumn, ...columnsData]);
setTableData(tableData);
}, [timeOrder]);
}, [timeOrder, timeValue, contrastOption]);
const [deviceAlarmSchemes, setDeviceAlarmSchemes] = useState([]);
const beforChangeParams = (value = {}) => {
......@@ -778,6 +781,8 @@ const HistoryView = (props) => {
handleTableData(data);
setChartDataSource(data);
}
}).catch(err => {
setLoading(false)
});
};
......@@ -811,6 +816,16 @@ const HistoryView = (props) => {
dataSource={tableData.sort((a, b) => {
let _a = a.time;
let _b = b.time
if (timeValue === 'contrast') {
if (contrastOption === 'day') {
_a = `2000-01-01 ${a.time}:00`;
_b = `2000-01-01 ${b.time}:00`;
}
if (contrastOption === 'month') {
_a = `2000-01-${a.time}:00`;
_b = `2000-01-${b.time}:00`;
}
}
return timeOrder === 'ascend' ? moment(_a) - moment(_b) : moment(_b) - moment(_a);
})}
columns={columns}
......
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