import { ImageItem } from '@/pages/gallery/typings'; import { formatBytes } from '@/utils/timelineUtils'; import { DeleteOutlined, DownloadOutlined, EyeOutlined, PlayCircleOutlined } from '@ant-design/icons'; import { Button, Card, Checkbox, Spin } from 'antd'; import React, { FC } from 'react'; import '../index.css'; import { getAuthization } from '@/utils/userUtils'; interface ListViewProps { imageList: ImageItem[]; batchMode: boolean; selectedRowKeys: string[]; onPreview: (index: number) => void; onSelect: (instanceId: string, checked: boolean) => void; onDownload: (instanceId: string, imageName: string) => void; onDelete: (instanceId: string, imageName: string) => void; loadingMore?: boolean; onScroll: (e: React.UIEvent) => void; } const ListView: FC = ({ imageList, batchMode, selectedRowKeys, onPreview, onSelect, onDownload, onDelete, loadingMore, onScroll, }) => { const imageSize = { width: '100%', height: 200 }; return (
{imageList.map((item: ImageItem, index: number) => { const imageUrl = item.thumbnailInstanceId ? `/file/image/${item.thumbnailInstanceId}?Authorization=${getAuthization()}` : `/file/image/${item.instanceId}?Authorization=${getAuthization()}`; return (
{batchMode && ( onSelect(item.instanceId, e.target.checked)} /> )}
!batchMode && onPreview(index)} > {(item.duration || item.thumbnailInstanceId) && ( )}
{item.imageName}
{item.size && 大小: {formatBytes(item.size)}} {item.createTime && ( 创建时间: {new Date(item.createTime).toLocaleString()} )}
)})} {loadingMore && (
)}
); }; export default ListView;