fix: add scroll.x='max-content' to 15 tables, widen narrow columns to prevent header wrapping
This commit is contained in:
@@ -691,7 +691,7 @@ const AttendancePage: React.FC = () => {
|
||||
columns={columns}
|
||||
dataSource={records}
|
||||
loading={loading}
|
||||
scroll={{ x: 1100 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
current: page,
|
||||
pageSize,
|
||||
|
||||
@@ -392,7 +392,7 @@ const BillsPage: React.FC = () => {
|
||||
</Space>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 1200 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={columns}
|
||||
dataSource={filteredBills}
|
||||
rowKey="id"
|
||||
|
||||
@@ -169,7 +169,7 @@ const ClassesPage: React.FC = () => {
|
||||
render: (_: unknown, r: ClassItem) => `${r.studentCount || 0}/${r.maxStudents || '-'}`,
|
||||
},
|
||||
{
|
||||
title: '状态', dataIndex: 'status', width: 90,
|
||||
title: '状态', dataIndex: 'status', width: 100,
|
||||
render: (v: string) => {
|
||||
const cfg = STATUS_MAP[v] || { color: 'default', text: v };
|
||||
return <Tag color={cfg.color}>{cfg.text}</Tag>;
|
||||
@@ -231,6 +231,7 @@ const ClassesPage: React.FC = () => {
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
|
||||
@@ -319,7 +319,7 @@ const ClassroomRentalsPage: React.FC = () => {
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||
scroll={{ x: 1200 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
|
||||
@@ -277,7 +277,7 @@ const ClassroomsPage: React.FC = () => {
|
||||
</Space>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 900 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={columns}
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
|
||||
@@ -345,6 +345,7 @@ const DepartmentsPage: React.FC = () => {
|
||||
loading={membersLoading}
|
||||
pagination={false}
|
||||
size="small"
|
||||
scroll={{ x: 'max-content' }}
|
||||
locale={{ emptyText: '暂无成员' }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -414,7 +414,7 @@ const DepositsPage: React.FC = () => {
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 1300 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||
/>
|
||||
</>
|
||||
@@ -429,7 +429,7 @@ const DepositsPage: React.FC = () => {
|
||||
dataSource={pendingRefunds}
|
||||
rowKey="id"
|
||||
loading={pendingLoading}
|
||||
scroll={{ x: 800 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -441,7 +441,7 @@ const ExpensesPage: React.FC = () => {
|
||||
dataSource={filteredRoomExpenses}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 800 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
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: 800 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||
rowSelection={{
|
||||
selectedRowKeys: selectedPersonalKeys,
|
||||
|
||||
@@ -187,7 +187,7 @@ const OccupanciesPage: React.FC = () => {
|
||||
{ title: '退宿原因', dataIndex: 'checkOutReason', render: (v: any) => v || '-' },
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
width: 220,
|
||||
render: (_: any, record: any) =>
|
||||
!record.checkOutDate ? (
|
||||
<Space>
|
||||
@@ -451,7 +451,7 @@ const OccupanciesPage: React.FC = () => {
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 900 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 15, showTotal: (total) => `共 ${total} 条` }}
|
||||
rowSelection={rowSelection}
|
||||
/>
|
||||
|
||||
@@ -61,14 +61,14 @@ const OperationLogsPage: React.FC = () => {
|
||||
{
|
||||
title: '模块',
|
||||
dataIndex: 'module',
|
||||
width: 80,
|
||||
width: 100,
|
||||
render: (v: string) => <Tag color={moduleColorMap[v] || 'default'}>{v}</Tag>,
|
||||
},
|
||||
{ title: '操作', dataIndex: 'action', width: 150 },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: 70,
|
||||
width: 80,
|
||||
render: (v: string) => {
|
||||
const s = statusMap[v] || statusMap['success'];
|
||||
return <Tag color={s.color}>{s.text}</Tag>;
|
||||
@@ -91,7 +91,7 @@ const OperationLogsPage: React.FC = () => {
|
||||
{
|
||||
title: '终端',
|
||||
dataIndex: 'userAgent',
|
||||
width: 100,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
render: (v: string) => {
|
||||
if (!v) return '-';
|
||||
@@ -153,7 +153,7 @@ const OperationLogsPage: React.FC = () => {
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 1000 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
current: page,
|
||||
total,
|
||||
|
||||
@@ -225,7 +225,7 @@ const RolesPage: React.FC = () => {
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 800 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={false}
|
||||
/>
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ const RoomsPage: React.FC = () => {
|
||||
{
|
||||
title: '租赁类型',
|
||||
dataIndex: 'rentalCategory',
|
||||
width: 80,
|
||||
width: 100,
|
||||
render: (v: string) => {
|
||||
if (v === 'long') return <Tag color="blue">长租</Tag>;
|
||||
if (v === 'short') return <Tag color="green">短租</Tag>;
|
||||
@@ -204,7 +204,7 @@ const RoomsPage: React.FC = () => {
|
||||
{
|
||||
title: '月租金',
|
||||
dataIndex: 'monthlyRate',
|
||||
width: 80,
|
||||
width: 100,
|
||||
render: (v: number) => (v ? `¥${v}` : '-'),
|
||||
},
|
||||
{ title: '额定人数', dataIndex: 'capacity' },
|
||||
@@ -225,7 +225,7 @@ const RoomsPage: React.FC = () => {
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'gender',
|
||||
width: 60,
|
||||
width: 80,
|
||||
render: (v: any) => (v ? <Tag color={v === '男' ? 'blue' : 'pink'}>{v}</Tag> : '-'),
|
||||
},
|
||||
{
|
||||
@@ -392,7 +392,7 @@ const RoomsPage: React.FC = () => {
|
||||
columns={columns}
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
scroll={{ x: 900 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
loading={loading}
|
||||
pagination={{ pageSize: 20, showTotal: (total) => `共 ${total} 间` }}
|
||||
rowClassName={(record) => (record.status === 'archived' ? 'archived-row' : '')}
|
||||
|
||||
@@ -221,9 +221,9 @@ const StudentsPage: React.FC = () => {
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{ title: 'ID', dataIndex: 'id', width: 60 },
|
||||
{ title: 'ID', dataIndex: 'id', width: 70 },
|
||||
{ title: '姓名', dataIndex: 'name', ellipsis: true },
|
||||
{ title: '性别', dataIndex: 'gender', width: 60 },
|
||||
{ title: '性别', dataIndex: 'gender', width: 70 },
|
||||
{
|
||||
title: '电话',
|
||||
dataIndex: 'phone',
|
||||
@@ -265,7 +265,7 @@ const StudentsPage: React.FC = () => {
|
||||
);
|
||||
},
|
||||
},
|
||||
{ title: '民族', dataIndex: 'ethnicity', width: 80 },
|
||||
{ title: '民族', dataIndex: 'ethnicity', width: 90 },
|
||||
{ title: '紧急联系人', dataIndex: 'emergencyContact', ellipsis: true },
|
||||
{ title: '紧急联系人电话', dataIndex: 'emergencyPhone', ellipsis: true },
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ const TeachersPage: React.FC = () => {
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{ title: '姓名', dataIndex: 'name', key: 'name', width: 100 },
|
||||
{ title: '姓名', dataIndex: 'name', key: 'name', width: 120 },
|
||||
{ title: '用户名', dataIndex: 'username', key: 'username', width: 130 },
|
||||
{
|
||||
title: '角色',
|
||||
@@ -135,7 +135,7 @@ const TeachersPage: React.FC = () => {
|
||||
title: '状态',
|
||||
dataIndex: 'isActive',
|
||||
key: 'status',
|
||||
width: 80,
|
||||
width: 90,
|
||||
render: (v: boolean) => <Tag color={v ? 'green' : 'red'}>{v ? '在职' : '停用'}</Tag>,
|
||||
},
|
||||
{
|
||||
@@ -148,7 +148,7 @@ const TeachersPage: React.FC = () => {
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 80,
|
||||
width: 100,
|
||||
render: (_: unknown, r: TeacherRow) => (
|
||||
<Button
|
||||
size="small"
|
||||
|
||||
@@ -186,7 +186,7 @@ const TenantsPage: React.FC = () => {
|
||||
</PermissionButton>
|
||||
</div>
|
||||
<Table
|
||||
scroll={{ x: 700 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
columns={columns}
|
||||
dataSource={filteredData}
|
||||
rowKey="id"
|
||||
|
||||
@@ -248,7 +248,7 @@ const UsersPage: React.FC = () => {
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
scroll={{ x: 1000 }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={false}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user