import React from 'react'; import { Card, Radio } from 'antd'; import Charts from './Charts'; import { FormattedMessage } from 'umi-plugin-react/locale'; import styles from '../style.less'; import Yuan from '../utils/Yuan'; import { RadioChangeEvent } from 'antd/lib/radio'; import { ISalesData } from '../data'; const { Pie } = Charts; const ProportionSales = ({ dropdownGroup, salesType, loading, salesPieData, handleChangeSalesType, }: { loading: boolean; dropdownGroup: React.ReactNode; salesType: 'all' | 'online' | 'stores'; salesPieData: ISalesData[]; handleChangeSalesType?: (e: RadioChangeEvent) => void; }) => { return ( } bodyStyle={{ padding: 24 }} extra={
{dropdownGroup}
} style={{ marginTop: 24 }} >

} total={() => {salesPieData.reduce((pre, now) => now.y + pre, 0)}} data={salesPieData} valueFormat={value => {value}} height={248} lineWidth={4} />
); }; export default ProportionSales;