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}
|
columns={columns}
|
||||||
dataSource={records}
|
dataSource={records}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1100 }}
|
||||||
pagination={{
|
pagination={{
|
||||||
current: page,
|
current: page,
|
||||||
pageSize,
|
pageSize,
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ const BillsPage: React.FC = () => {
|
|||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
<Table
|
<Table
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1400 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={filteredBills}
|
dataSource={filteredBills}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ const ClassesPage: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{ pageSize: 20 }}
|
pagination={{ pageSize: 20 }}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1100 }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ const ClassroomRentalsPage: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ const ClassroomsPage: React.FC = () => {
|
|||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
<Table
|
<Table
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1100 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={filteredData}
|
dataSource={filteredData}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ const DepartmentsPage: React.FC = () => {
|
|||||||
loading={membersLoading}
|
loading={membersLoading}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
size="small"
|
size="small"
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1000 }}
|
||||||
locale={{ emptyText: '暂无成员' }}
|
locale={{ emptyText: '暂无成员' }}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ const DepositsPage: React.FC = () => {
|
|||||||
dataSource={filteredData}
|
dataSource={filteredData}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
@@ -429,7 +429,7 @@ const DepositsPage: React.FC = () => {
|
|||||||
dataSource={pendingRefunds}
|
dataSource={pendingRefunds}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={pendingLoading}
|
loading={pendingLoading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ const ExpensesPage: React.FC = () => {
|
|||||||
dataSource={filteredRoomExpenses}
|
dataSource={filteredRoomExpenses}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
selectedRowKeys: selectedRoomKeys,
|
selectedRowKeys: selectedRoomKeys,
|
||||||
@@ -591,7 +591,7 @@ const ExpensesPage: React.FC = () => {
|
|||||||
dataSource={filteredPersonalExpenses}
|
dataSource={filteredPersonalExpenses}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
selectedRowKeys: selectedPersonalKeys,
|
selectedRowKeys: selectedPersonalKeys,
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ const OccupanciesPage: React.FC = () => {
|
|||||||
dataSource={filteredData}
|
dataSource={filteredData}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1300 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ const OperationLogsPage: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1100 }}
|
||||||
pagination={{
|
pagination={{
|
||||||
current: page,
|
current: page,
|
||||||
total,
|
total,
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ const RolesPage: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 900 }}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ const RoomsPage: React.FC = () => {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={filteredData}
|
dataSource={filteredData}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1200 }}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{ pageSize: 20, showTotal: (total) => `共 ${total} 间` }}
|
pagination={{ pageSize: 20, showTotal: (total) => `共 ${total} 间` }}
|
||||||
rowClassName={(record) => (record.status === 'archived' ? 'archived-row' : '')}
|
rowClassName={(record) => (record.status === 'archived' ? 'archived-row' : '')}
|
||||||
|
|||||||
@@ -668,13 +668,9 @@ const AttachmentsTab: React.FC<TabProps & { data: AttachmentRecord[] }> = ({ dat
|
|||||||
<div>
|
<div>
|
||||||
<Upload
|
<Upload
|
||||||
showUploadList={false}
|
showUploadList={false}
|
||||||
customRequest={async (options: {
|
customRequest={async (options) => {
|
||||||
file: File | Blob;
|
|
||||||
onSuccess?: (body: unknown) => void;
|
|
||||||
onError?: (error: Error) => void;
|
|
||||||
}) => {
|
|
||||||
const formData = new FormData();
|
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);
|
setUploading(true);
|
||||||
try {
|
try {
|
||||||
await api.post(`/archive/${studentId}/attachments`, formData, {
|
await api.post(`/archive/${studentId}/attachments`, formData, {
|
||||||
@@ -684,9 +680,9 @@ const AttachmentsTab: React.FC<TabProps & { data: AttachmentRecord[] }> = ({ dat
|
|||||||
options.onSuccess?.({});
|
options.onSuccess?.({});
|
||||||
onRefresh();
|
onRefresh();
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
const err = e as { message?: string };
|
const msg = e instanceof Error ? e.message : '上传失败';
|
||||||
message.error(err?.message || '上传失败');
|
message.error(msg);
|
||||||
options.onError?.(err instanceof Error ? err : new Error('Upload failed'));
|
options.onError?.(e instanceof Error ? e : new Error(msg));
|
||||||
} finally {
|
} finally {
|
||||||
setUploading(false);
|
setUploading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ const StudentsPage: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 1200 }}
|
scroll={{ x: 1300 }}
|
||||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 人` }}
|
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 人` }}
|
||||||
rowClassName={(record: any) => (record.status === 'archived' ? 'archived-row' : '')}
|
rowClassName={(record: any) => (record.status === 'archived' ? 'archived-row' : '')}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ const TeachersPage: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 1200 }}
|
scroll={{ x: 1300 }}
|
||||||
pagination={{
|
pagination={{
|
||||||
current: page,
|
current: page,
|
||||||
pageSize: PAGE_SIZE,
|
pageSize: PAGE_SIZE,
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ const TenantsPage: React.FC = () => {
|
|||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
</div>
|
</div>
|
||||||
<Table
|
<Table
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1000 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={filteredData}
|
dataSource={filteredData}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ const UsersPage: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 1000 }}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user