// ============================================================ // AudioListInput — audioList → Dragger(音频文件拖拽上传) // 用于声纹克隆的音频样本上传场景 // ============================================================ import { Upload } from 'antd'; import { InboxOutlined } from '@ant-design/icons'; import type { UploadFile } from 'antd/es/upload'; import type { WidgetProps } from './types'; import { useFileUpload } from '@/hooks/use-api'; const { Dragger } = Upload; export function AudioListInput({ value, onChange, disabled, config }: WidgetProps) { const fileList = (value as UploadFile[]) || []; const maxSizeMb = (config.maxFileSizeMb as number) || 10; const maxCount = (config.maxFiles as number) || 10; const filters = config.fileFilter as string[] | undefined; const { customRequest } = useFileUpload(); return ( `.${ext}`).join(',') : '.wav,.mp3,.m4a,.flac' } fileList={fileList} customRequest={customRequest} onChange={({ fileList: newList }) => onChange?.(newList)} disabled={disabled} beforeUpload={() => true} maxCount={maxCount} >

点击或拖拽音频文件到此区域上传

支持 {filters?.join(' / ').toUpperCase() || 'WAV / MP3 / M4A / FLAC'} ,单文件不超过 {maxSizeMb}MB

); }