import { CloseOutlined } from '@ant-design/icons'; import { Button, Card, Descriptions, Space, Tooltip, Typography } from 'antd'; import { cloneDeep, throttle } from 'lodash'; import { useIntl } from 'umi'; const { Paragraph } = Typography; type FileCardsProps = { value?: any[]; onChange?: (value?: any[]) => void; }; const FileCards: React.FC = ({ value, onChange }) => { const { formatMessage } = useIntl(); const handleDownload = throttle((ossUrl) => { window.location.href = ossUrl; }, 2000); const remove = (index: number) => { const cardList = cloneDeep(value); cardList?.splice(index, 1); onChange?.(cardList); }; return ( <> {value?.map((item, index) => { return (
remove(index)} /> {item?.type} {item?.md5} {item?.ossUrl} } >
); })} ); }; export default FileCards;