fix(admin): replace scroll.x='max-content' with calculated fixed widths for all tables
This commit is contained in:
@@ -668,13 +668,9 @@ const AttachmentsTab: React.FC<TabProps & { data: AttachmentRecord[] }> = ({ dat
|
||||
<div>
|
||||
<Upload
|
||||
showUploadList={false}
|
||||
customRequest={async (options: {
|
||||
file: File | Blob;
|
||||
onSuccess?: (body: unknown) => void;
|
||||
onError?: (error: Error) => void;
|
||||
}) => {
|
||||
customRequest={async (options) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', options.file instanceof File ? options.file : new File([options.file], 'attachment'));
|
||||
formData.append('file', options.file instanceof File ? options.file : new File([options.file as Blob], 'attachment'));
|
||||
setUploading(true);
|
||||
try {
|
||||
await api.post(`/archive/${studentId}/attachments`, formData, {
|
||||
@@ -684,9 +680,9 @@ const AttachmentsTab: React.FC<TabProps & { data: AttachmentRecord[] }> = ({ dat
|
||||
options.onSuccess?.({});
|
||||
onRefresh();
|
||||
} catch (e: unknown) {
|
||||
const err = e as { message?: string };
|
||||
message.error(err?.message || '上传失败');
|
||||
options.onError?.(err instanceof Error ? err : new Error('Upload failed'));
|
||||
const msg = e instanceof Error ? e.message : '上传失败';
|
||||
message.error(msg);
|
||||
options.onError?.(e instanceof Error ? e : new Error(msg));
|
||||
} finally {
|
||||
setUploading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user