import React, { useState, useEffect, useRef, useContext } from 'react';
import classNames from 'classnames';
import moment from 'moment';
import axios from 'axios';
import Empty from '@wisdom-components/empty';
import TimeRangePicker from '@wisdom-components/timerangepicker';
import LoadBox from '@wisdom-components/loadbox';
import { Input, message, Modal, Form, ConfigProvider, Button } from 'antd';
import {
  ExclamationCircleOutlined,
  DoubleLeftOutlined,
  LeftOutlined,
  RightOutlined,
  DoubleRightOutlined,
} from '@ant-design/icons';
import { getStatisticsInfo } from './apis';

const StatisticalHistoryView = (props) => {
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('statistical-history-view');
  const componentPrefix = getPrefixCls('');

  const [dateValue, setDateValue] = useState(null);
  const [timeValue, setTimeValue] = useState(null);
  const [data, setData] = useState({ startDate: '', endDate: '' });
  const [time, setTime] = useState({ startTime: '', endTime: '' });

  const onDateChange = () => {
    
  }

  return (
    <div className={classNames(prefixCls)}>
      <div className={classNames('historyView')}>
        <div className={classNames('historyViewHeader')}>
          <span>时间选择：</span>
          <TimeRangePicker
            value={dateValue}
            onChange={onDateChange}
            defaultValue={dateList[0].key}
            dataSource={dateList}
            layout={'horizontal'}
          />
        </div>
      </div>
    </div>
  );
};

export default StatisticalHistoryView;

const dateList = [
  {
    key: 'today',
    name: '今日',
  },
  {
    key: 'thisWeek',
    name: '本周',
  },
  {
    key: 'thisMonth',
    name: '本月',
  },
  {
    key: 'customer',
    name: '自定义',
  },
];
