diff --git a/src/app/admin/content/[modelCode]/page.test.tsx b/src/app/admin/content/[modelCode]/page.test.tsx index c4fefc75..5aabca73 100644 --- a/src/app/admin/content/[modelCode]/page.test.tsx +++ b/src/app/admin/content/[modelCode]/page.test.tsx @@ -151,4 +151,20 @@ describe('内容列表页:搜索请求节流', () => { expect(screen.getByText('新查询结果')).toBeInTheDocument(); expect(screen.queryByText('慢查询结果')).toBeNull(); }); + + // ── DEF-04:390 档表格必须能横向滚动,而不是把 7 列挤成一条 ── + it('表格带最小宽度并被 overflow-x-auto 容器包住(390 档可横滚)', async () => { + nav.state.params = { modelCode: 'news' }; + api.getItems.mockResolvedValue(rowsResult([row('一条内容')])); + const { container } = render(); + await waitFor(() => expect(screen.getByText('一条内容')).toBeInTheDocument()); + + const table = container.querySelector('table'); + expect(table).not.toBeNull(); + // 固定版式宽:列宽由 white-space:nowrap 撑开,容器才有东西可滚 + expect(table!.className).toContain('min-w-[760px]'); + // 外层必须真的允许横向滚动,否则 min-w 只是把内容溢出成裁剪 + const scroller = table!.parentElement; + expect(scroller!.className).toContain('overflow-x-auto'); + }); }); diff --git a/src/app/admin/content/[modelCode]/page.tsx b/src/app/admin/content/[modelCode]/page.tsx index 779b7f40..aa7c866e 100644 --- a/src/app/admin/content/[modelCode]/page.tsx +++ b/src/app/admin/content/[modelCode]/page.tsx @@ -177,14 +177,14 @@ export default function ContentListPage() { {/* Table */}
- +
- - - - - + + + + + @@ -205,15 +205,15 @@ export default function ContentListPage() { ) : ( items.map((item) => ( - - - -
标题Slug状态更新时间操作标题Slug状态更新时间操作
+ {item.title} + {item.slug || '-'} + + {item.updatedAt ? new Date(item.updatedAt).toLocaleDateString('zh-CN') : '-'} diff --git a/src/app/admin/users/page.tsx b/src/app/admin/users/page.tsx index 58846dcc..2f3e59c3 100644 --- a/src/app/admin/users/page.tsx +++ b/src/app/admin/users/page.tsx @@ -287,16 +287,16 @@ export default function UsersPage() { {/* Users table */}
- +
- - - - - - - + + + + + + + @@ -318,14 +318,14 @@ export default function UsersPage() { ) : ( users.map((u) => ( - - - +
用户名昵称邮箱角色状态创建时间操作用户名昵称邮箱角色状态创建时间操作
+
{u.username}
{u.nickname || '-'} + {u.nickname || '-'} {u.email ? (