import React, {useEffect, useState} from 'react';
import {MobileHistoryChart} from "../mobile";
import moment from 'moment'
const deviceParams = [
    {
        deviceCode: 'EGBF00000141',
        sensors: '今日供水量,今日用电量',
        deviceType: '二供泵房',
        pointAddressID: 208,
    },
/*    {
        deviceCode: 'EGBF00000141',
        sensors: '今日供水量',
        deviceType: '二供泵房',
        pointAddressID: 208,
    },*/
];

const Demo = () => {
    const [date,setData] = useState();
    useEffect(()=>{
        setTimeout(()=>{
            setData({
                dateFrom: moment().subtract(4,'days').format('YYYY-MM-DD HH:mm:ss'),
                dateTo: moment().subtract(3,'days').format('YYYY-MM-DD HH:mm:ss')
            })
        },5000)
    },[])
    return (
        <div>
            <div style={{height: 600}}>
                <MobileHistoryChart deviceParams={deviceParams} date={date}/>
            </div>
        </div>

    );
};

export default Demo;
