mobile.js 1018 Bytes
Newer Older
陈龙's avatar
陈龙 committed
1
import React, {useEffect, useState} from 'react';
陈龙's avatar
陈龙 committed
2
import {MobileHistoryChart} from "../mobile";
陈龙's avatar
陈龙 committed
3
import moment from 'moment'
陈龙's avatar
陈龙 committed
4
const deviceParams = [
陈龙's avatar
陈龙 committed
5
    {
陈龙's avatar
陈龙 committed
6 7 8 9
        deviceCode: 'EGBF00000141',
        sensors: '今日供水量,今日用电量',
        deviceType: '二供泵房',
        pointAddressID: 208,
陈龙's avatar
陈龙 committed
10 11
    },
/*    {
陈龙's avatar
陈龙 committed
12 13 14 15
        deviceCode: 'EGBF00000141',
        sensors: '今日供水量',
        deviceType: '二供泵房',
        pointAddressID: 208,
陈龙's avatar
陈龙 committed
16
    },*/
陈龙's avatar
陈龙 committed
17
];
陈龙's avatar
陈龙 committed
18

陈龙's avatar
陈龙 committed
19
const Demo = () => {
陈龙's avatar
陈龙 committed
20 21 22 23 24 25 26 27 28
    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)
    },[])
陈龙's avatar
陈龙 committed
29 30
    return (
        <div>
陈龙's avatar
陈龙 committed
31
            <div style={{height: 600}}>
陈龙's avatar
陈龙 committed
32
                <MobileHistoryChart deviceParams={deviceParams} date={date}/>
陈龙's avatar
陈龙 committed
33 34 35 36 37 38 39
            </div>
        </div>

    );
};

export default Demo;