Basic.tsx 2.14 KB
Newer Older
涂茜's avatar
涂茜 committed
1 2 3 4 5 6
import React from 'react';
import { service } from '@wisdom-utils/utils';
import HistoryInfo from '../index';

const REQUEST_HTTP = 'http';
const REQUEST_METHOD_POST = 'post';
7
const REQUEST_METHOD_GET = 'get';
涂茜's avatar
涂茜 committed
8 9

const GET_HISTORY_INFO =
10
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/PandaCore/Monitor/Device/SensorsDataForStation'; //获取历史信息
涂茜's avatar
涂茜 committed
11

12 13 14 15 16
const GET_DICTIONARY_LIST =
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/PandaCore/OMS/Data/GetDataDictionaryList'; //获取数据字典信息

// const GET_HISTORY_INFO = '/api/PandaCore/GCK/Device/SensorsDataForStation'; //获取历史信息

涂茜's avatar
涂茜 committed
17
// const GET_DICTIONARY_LIST = '/api/PandaCore/OMS/DataManger/GetDataDictionaryList'; //获取数据字典信息
涂茜's avatar
涂茜 committed
18 19 20 21 22 23 24

const historyInfoService = {
  getHistoryInfo: {
    url: GET_HISTORY_INFO,
    method: REQUEST_METHOD_POST,
    type: REQUEST_HTTP,
  },
25 26 27 28 29
  getDictionaryList: {
    url: GET_DICTIONARY_LIST,
    method: REQUEST_METHOD_GET,
    type: REQUEST_HTTP,
  },
涂茜's avatar
涂茜 committed
30 31 32 33 34
};

const hsService = service(historyInfoService);

const getHistoryInfo = hsService.getHistoryInfo;
35
const getDictionaryList = hsService.getDictionaryList;
涂茜's avatar
涂茜 committed
36 37 38 39 40 41

const Demo = () => {
  return (
    <div style={{ height: '800px' }}>
      <HistoryInfo
        title={'指标曲线'}
涂茜's avatar
涂茜 committed
42
        tableProps={{ bordered: true }}
涂茜's avatar
涂茜 committed
43 44
        historyInfoService={getHistoryInfo}
        historyInfoParams={initialParams}
45 46
        dictionaryService={getDictionaryList}
        dictionaryParams={{ nodeID: 149 }}
涂茜's avatar
涂茜 committed
47 48 49 50 51 52 53 54 55 56
      />
    </div>
  );
};

export default Demo;

const initialParams = {
  stream: [
    {
涂茜's avatar
涂茜 committed
57 58
      stationCode: 'EGBF00000022',
      sensors: '进水压力,今日供水量',
涂茜's avatar
涂茜 committed
59
      pointVersions: '二供泵房',
涂茜's avatar
涂茜 committed
60 61
      dateFrom: '2021-06-16 13:01:37',
      dateTo: '2021-06-16 14:01:37',
涂茜's avatar
涂茜 committed
62
    },
涂茜's avatar
涂茜 committed
63 64 65 66 67 68 69
    // {
    //   stationCode: 'EGJZ00000044',
    //   sensors: '进水压力,今日供水量',
    //   pointVersions: '二供机组',
    //   dateFrom: '2021-06-16 13:01:37',
    //   dateTo: '2021-06-16 14:01:37',
    // },
涂茜's avatar
涂茜 committed
70 71 72 73 74 75
  ],
  ignoreOutliers: false, // 过滤异常值
  isVertical: false, // 是否展示竖表
  zoom: '', // 数据抽稀
  unit: '', // 数据抽稀 min h
};