Basic.tsx 2.59 KB
Newer Older
涂茜's avatar
涂茜 committed
1 2 3 4 5 6 7 8 9
import React, { useEffect, useState } from 'react';
import { service } from '@wisdom-utils/utils';
import RealTimeInfo from '../index';

const REQUEST_HTTP = 'http';
const REQUEST_METHOD_GET = 'get';
const REQUEST_METHOD_POST = 'post';

const GET_DEVICE_CONF =
涂茜's avatar
涂茜 committed
10
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/GCK/MonitorConfig/GetMonitorConf'; //获取设备配置
涂茜's avatar
涂茜 committed
11 12 13 14 15 16 17
const GET_POINT_ADDRESS_ENTRY =
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/GCK/PointAddress/GetPointAddressEntry'; //获取点表信息
const GET_SENSOR_TYPE =
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/GCK/Sensor/GetSensorType'; //获取传感器类型
const GET_DEVICE_REAL_INFO =
  'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/GCK/Device/DeviceRealInfo'; //获取设备实时数据

涂茜's avatar
涂茜 committed
18
// const GET_DEVICE_CONF = '/api/Publish/GCK/MonitorConfig/GetMonitorConf'; //获取设备配置
涂茜's avatar
涂茜 committed
19 20 21 22
// const GET_POINT_ADDRESS_ENTRY = '/api/Publish/GCK/PointAddress/GetPointAddressEntry'; //获取点表信息
// const GET_SENSOR_TYPE = '/api/Publish/GCK/Sensor/GetSensorType'; //获取传感器类型
// const GET_DEVICE_REAL_INFO = '/api/Publish/GCK/Device/DeviceRealInfo'; //获取设备实时数据

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
// const realTimeInfoService = {
//   getDeviceConf: {
//     url: GET_DEVICE_CONF,
//     method: REQUEST_METHOD_GET,
//     type: REQUEST_HTTP,
//   },
//   getPointAddressEntry: {
//     url: GET_POINT_ADDRESS_ENTRY,
//     method: REQUEST_METHOD_GET,
//     type: REQUEST_HTTP,
//   },
//   getSensorType: {
//     url: GET_SENSOR_TYPE,
//     method: REQUEST_METHOD_GET,
//     type: REQUEST_HTTP,
//   },
//   getDeviceRealInfo: {
//     url: GET_DEVICE_REAL_INFO,
//     method: REQUEST_METHOD_POST,
//     type: REQUEST_HTTP,
//   },
// };
涂茜's avatar
涂茜 committed
45

46
// const rtService = service(realTimeInfoService);
涂茜's avatar
涂茜 committed
47

48 49 50 51
// const getDeviceConf = rtService.getDeviceConf;
// const getPointAddressEntry = rtService.getPointAddressEntry;
// const getSensorType = rtService.getSensorType;
// const getDeviceRealInfo = rtService.getDeviceRealInfo;
涂茜's avatar
涂茜 committed
52 53 54 55 56

const Demo = () => {
  return (
    <div style={{ width: '200px', height: '60px', background: 'black' }}>
      <RealTimeInfo
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        deviceParams={[
          {
            deviceType: '二供泵房',
            deviceCode: 'EGBF00000001',
          },
          {
            deviceType: '二供机组',
            deviceCode: 'EGJZ00000001',
          },
          {
            deviceType: '二供机组',
            deviceCode: 'EGJZ00000002',
          },
        ]}
        user={1}
涂茜's avatar
涂茜 committed
72 73 74 75 76 77
      />
    </div>
  );
};

export default Demo;