import React from 'react'; import { Row, Col, Table, Tooltip, Card, Icon } from 'antd'; import { FormattedMessage } from 'umi-plugin-react/locale'; import Charts from './Charts'; import Trend from './Trend'; import NumberInfo from './NumberInfo'; import numeral from 'numeral'; import styles from '../style.less'; import { ISearchData, IVisitData2 } from '../data'; const { MiniArea } = Charts; const columns = [ { title: , dataIndex: 'index', key: 'index', }, { title: , dataIndex: 'keyword', key: 'keyword', render: (text: React.ReactNode) => {text}, }, { title: , dataIndex: 'count', key: 'count', sorter: (a: { count: number }, b: { count: number }) => a.count - b.count, className: styles.alignRight, }, { title: , dataIndex: 'range', key: 'range', sorter: (a: { range: number }, b: { range: number }) => a.range - b.range, render: (text: React.ReactNode, record: { status: number }) => ( {text}% ), }, ]; const TopSearch = ({ loading, visitData2, searchData, dropdownGroup, }: { loading: boolean; visitData2: IVisitData2[]; dropdownGroup: React.ReactNode; searchData: ISearchData[]; }) => ( } extra={dropdownGroup} style={{ marginTop: 24 }} > } > } gap={8} total={numeral(12321).format('0,0')} status="up" subTotal={17.1} /> } > } total={2.7} status="down" subTotal={26.2} gap={8} /> rowKey={record => record.index} size="small" columns={columns} dataSource={searchData} pagination={{ style: { marginBottom: 0 }, pageSize: 5, }} /> ); export default TopSearch;