import React, { Component, useState, useEffect } from 'react';
import { Card, Row, Col, Statistic, Icon } from 'antd';
// import IndexEcharts from './components/indexEcharts';
// import Swiper from './swiper/index';
import router from 'umi/router';
import request from '@/utils/request';
import apis from '@/services/apis';
import Count from './components/Count';
import SourceRole from './components/SourceRole';
import UserSource from './components/UserSource';
import UserBehavior from './components/UserBehavior';
import UserActive from './components/UserActive';

import UserSex from './components/UserSex';
import UserConversion from './components/UserConversion';
import NewUsers from './components/NewUsers';

import BuildingStatistic from './BuildingStatistic';
import CityNums from './CityNums';
import TimeSelect from '../compents/TimeSelect';
import NewUserTable from './components/newUserTable';
import moment  from 'moment';
const newAdd = props => {
  const [data, setData] = useState([]);
  const [time, setTime] = useState({});
  const onTimeChange = e => {
    setTime({
      startDate: moment(e[0]).format('YYYY-MM-DDT00:00:00.000') + 'Z',
      endDate: moment(e[1]).format('YYYY-MM-DDT23:59:59.999') + 'Z',
    });
    // getData({ startDate: e[0], endDate: e[1] });
  };

  return (
    <Card>
      <TimeSelect onChange={onTimeChange}></TimeSelect>
      <NewUsers startDate={time.startDate} endDate={time.endDate} simple={true}></NewUsers>
      <NewUserTable startDate={time.startDate} endDate={time.endDate} simple={true}></NewUserTable>
    </Card>
  );
};
export default newAdd;
