import React, {useContext, useEffect} from 'react'; import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; import { SearchOutlined, } from '@ant-design/icons'; import { stores_Context } from '../config'; import * as config from "../config"; import { observer } from 'mobx-react'; import 'moment/locale/zh-cn'; import moment from "moment"; import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; import { utils, writeFileXLSX } from "xlsx"; const DestinationGroupCount = () => { const {customerServicesStore} = useContext(stores_Context); const destinationGroupCount = customerServicesStore.destinationGroupCount; const destinationGroupCountColumns = customerServicesStore.destinationGroupCountColumns; const {startDate, endDate, dateType, inProgress} = customerServicesStore; useEffect(() => { customerServicesStore.selectCountry('china'); }, []); const handleSearchClick = () => { customerServicesStore.fetchDestinationGroupCount(); }; return ( <> { customerServicesStore.selectDateRange(dates[0], dates[1]); }} ranges={{ '本周': [moment().startOf('week'), moment().endOf('week')], '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], '本月': [moment().startOf('month'), moment().endOf('month')], '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')], '近30天': [moment().subtract(30, 'days'), moment()], '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')], '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')], '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')], }} /> 目的地团信息 record.key} loading={inProgress} pagination={false} scroll={{ x: "100%" }} /> { const wb = utils.table_to_book(document.getElementById("destinationGroupCount").getElementsByTagName("table")[0]); writeFileXLSX(wb, "目的地团信息.xlsx"); }}> 导出excel ); }; export default observer(DestinationGroupCount);