import { Column } from '@ant-design/plots'; import { Button, Card, Col, DatePicker, Row, Tabs } from 'antd'; import type { RangePickerProps } from 'antd/es/date-picker'; import numeral from 'numeral'; import type { DataItem } from '../data.d'; import useStyles from '../style.style'; export type TimeType = 'today' | 'week' | 'month' | 'year'; const { RangePicker } = DatePicker; const rankingListData: { title: string; total: number; }[] = []; for (let i = 0; i < 7; i += 1) { rankingListData.push({ title: `工专路 ${i} 号店`, total: 323234, }); } const SalesCard = ({ rangePickerValue, salesData, isActive, handleRangePickerChange, loading, selectDate, }: { rangePickerValue: RangePickerProps['value']; isActive: (key: TimeType) => string; salesData: DataItem[]; loading: boolean; handleRangePickerChange: RangePickerProps['onChange']; selectDate: (key: TimeType) => void; }) => { const { styles } = useStyles(); return (
} size="large" tabBarStyle={{ marginBottom: 24, }} items={[ { key: 'sales', label: '销售额', children: (

门店销售额排名

    {rankingListData.map((item, i) => (
  • {i + 1} {item.title} {numeral(item.total).format('0,0')}
  • ))}
), }, { key: 'views', label: '访问量', children: (

门店访问量排名

    {rankingListData.map((item, i) => (
  • {i + 1} {item.title} {numeral(item.total).format('0,0')}
  • ))}
), }, ]} />
); }; export default SalesCard;