fix(admin): replace scroll.x='max-content' with calculated fixed widths for all tables

This commit is contained in:
2026-07-06 16:39:53 +08:00
parent 8fc697e58f
commit 43ee4dc5d5
17 changed files with 23 additions and 27 deletions

View File

@@ -691,7 +691,7 @@ const AttendancePage: React.FC = () => {
columns={columns}
dataSource={records}
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1100 }}
pagination={{
current: page,
pageSize,

View File

@@ -392,7 +392,7 @@ const BillsPage: React.FC = () => {
</Space>
</div>
<Table
scroll={{ x: 'max-content' }}
scroll={{ x: 1400 }}
columns={columns}
dataSource={filteredBills}
rowKey="id"

View File

@@ -231,7 +231,7 @@ const ClassesPage: React.FC = () => {
rowKey="id"
loading={loading}
pagination={{ pageSize: 20 }}
scroll={{ x: 'max-content' }}
scroll={{ x: 1100 }}
/>
<Modal

View File

@@ -319,7 +319,7 @@ const ClassroomRentalsPage: React.FC = () => {
rowKey="id"
loading={loading}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
/>
<Modal

View File

@@ -277,7 +277,7 @@ const ClassroomsPage: React.FC = () => {
</Space>
</div>
<Table
scroll={{ x: 'max-content' }}
scroll={{ x: 1100 }}
columns={columns}
dataSource={filteredData}
rowKey="id"

View File

@@ -345,7 +345,7 @@ const DepartmentsPage: React.FC = () => {
loading={membersLoading}
pagination={false}
size="small"
scroll={{ x: 'max-content' }}
scroll={{ x: 1000 }}
locale={{ emptyText: '暂无成员' }}
/>
</Card>

View File

@@ -414,7 +414,7 @@ const DepositsPage: React.FC = () => {
dataSource={filteredData}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
/>
</>
@@ -429,7 +429,7 @@ const DepositsPage: React.FC = () => {
dataSource={pendingRefunds}
rowKey="id"
loading={pendingLoading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
/>
),

View File

@@ -441,7 +441,7 @@ const ExpensesPage: React.FC = () => {
dataSource={filteredRoomExpenses}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
rowSelection={{
selectedRowKeys: selectedRoomKeys,
@@ -591,7 +591,7 @@ const ExpensesPage: React.FC = () => {
dataSource={filteredPersonalExpenses}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
rowSelection={{
selectedRowKeys: selectedPersonalKeys,

View File

@@ -451,7 +451,7 @@ const OccupanciesPage: React.FC = () => {
dataSource={filteredData}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1300 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
rowSelection={rowSelection}
/>

View File

@@ -153,7 +153,7 @@ const OperationLogsPage: React.FC = () => {
dataSource={data}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1100 }}
pagination={{
current: page,
total,

View File

@@ -225,7 +225,7 @@ const RolesPage: React.FC = () => {
dataSource={data}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 900 }}
pagination={false}
/>

View File

@@ -392,7 +392,7 @@ const RoomsPage: React.FC = () => {
columns={columns}
dataSource={filteredData}
rowKey="id"
scroll={{ x: 'max-content' }}
scroll={{ x: 1200 }}
loading={loading}
pagination={{ pageSize: 20, showTotal: (total) => `${total}` }}
rowClassName={(record) => (record.status === 'archived' ? 'archived-row' : '')}

View File

@@ -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);
}

View File

@@ -430,7 +430,7 @@ const StudentsPage: React.FC = () => {
dataSource={data}
rowKey="id"
loading={loading}
scroll={{ x: 1200 }}
scroll={{ x: 1300 }}
pagination={{ pageSize: 15, showTotal: (total) => `${total}` }}
rowClassName={(record: any) => (record.status === 'archived' ? 'archived-row' : '')}
rowSelection={{

View File

@@ -187,7 +187,7 @@ const TeachersPage: React.FC = () => {
dataSource={data}
rowKey="id"
loading={loading}
scroll={{ x: 1200 }}
scroll={{ x: 1300 }}
pagination={{
current: page,
pageSize: PAGE_SIZE,

View File

@@ -186,7 +186,7 @@ const TenantsPage: React.FC = () => {
</PermissionButton>
</div>
<Table
scroll={{ x: 'max-content' }}
scroll={{ x: 1000 }}
columns={columns}
dataSource={filteredData}
rowKey="id"

View File

@@ -248,7 +248,7 @@ const UsersPage: React.FC = () => {
dataSource={data}
rowKey="id"
loading={loading}
scroll={{ x: 'max-content' }}
scroll={{ x: 1000 }}
pagination={false}
/>