1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import { service } from '@wisdom-utils/utils';
import HistoryInfo from '../index';
const REQUEST_HTTP = 'http';
const REQUEST_METHOD_POST = 'post';
const REQUEST_METHOD_GET = 'get';
const GET_HISTORY_INFO =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/PandaCore/Monitor/Device/SensorsDataForStation'; //获取历史信息
const GET_DICTIONARY_LIST =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/PandaCore/OMS/Data/GetDataDictionaryList'; //获取数据字典信息
// const GET_HISTORY_INFO = '/api/PandaCore/GCK/Device/SensorsDataForStation'; //获取历史信息
// const GET_DICTIONARY_LIST = '/api/PandaCore/OMS/DataManger/GetDataDictionaryList'; //获取数据字典信息
const historyInfoService = {
getHistoryInfo: {
url: GET_HISTORY_INFO,
method: REQUEST_METHOD_POST,
type: REQUEST_HTTP,
},
getDictionaryList: {
url: GET_DICTIONARY_LIST,
method: REQUEST_METHOD_GET,
type: REQUEST_HTTP,
},
};
const hsService = service(historyInfoService);
const getHistoryInfo = hsService.getHistoryInfo;
const getDictionaryList = hsService.getDictionaryList;
const Demo = () => {
return (
<div style={{ height: '800px' }}>
<HistoryInfo
title={'指标曲线'}
tableProps={{ bordered: true }}
historyInfoService={getHistoryInfo}
historyInfoParams={initialParams}
dictionaryService={getDictionaryList}
dictionaryParams={{ nodeID: 149 }}
/>
</div>
);
};
export default Demo;
const initialParams = {
stream: [
{
stationCode: 'EGBF00000022',
sensors: '进水压力,今日供水量',
pointVersions: '二供泵房',
dateFrom: '2021-06-16 13:01:37',
dateTo: '2021-06-16 14:01:37',
},
// {
// stationCode: 'EGJZ00000044',
// sensors: '进水压力,今日供水量',
// pointVersions: '二供机组',
// dateFrom: '2021-06-16 13:01:37',
// dateTo: '2021-06-16 14:01:37',
// },
],
ignoreOutliers: false, // 过滤异常值
isVertical: false, // 是否展示竖表
zoom: '', // 数据抽稀
unit: '', // 数据抽稀 min h
};