fix(admin): replace scroll.x='max-content' with calculated fixed widths for all tables
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -392,7 +392,7 @@ const BillsPage: React.FC = () => {
|
||||
</Space>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1400 }}
|
||||
columns={columns}
|
||||
dataSource={filteredBills}
|
||||
rowKey="id"
|
||||
|
||||
@@ -231,7 +231,7 @@ const ClassesPage: React.FC = () => {
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1100 }}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -277,7 +277,7 @@ const ClassroomsPage: React.FC = () => {
|
||||
</Space>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1100 }}
|
||||
columns={columns}
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
|
||||
@@ -345,7 +345,7 @@ const DepartmentsPage: React.FC = () => {
|
||||
loading={membersLoading}
|
||||
pagination={false}
|
||||
size="small"
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1000 }}
|
||||
locale={{ emptyText: '暂无成员' }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -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} 条` }}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -225,7 +225,7 @@ const RolesPage: React.FC = () => {
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 900 }}
|
||||
pagination={false}
|
||||
/>
|
||||
|
||||
|
||||
@@ -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' : '')}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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={{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -186,7 +186,7 @@ const TenantsPage: React.FC = () => {
|
||||
</PermissionButton>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1000 }}
|
||||
columns={columns}
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
|
||||
@@ -248,7 +248,7 @@ const UsersPage: React.FC = () => {
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 'max-content' }}
|
||||
scroll={{ x: 1000 }}
|
||||
pagination={false}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user