fix Semi UI account editor viewport

This commit is contained in:
lingniu
2026-07-18 06:19:32 +08:00
parent 24d3c1dcac
commit f7cd3020f7
3 changed files with 6 additions and 2 deletions

View File

@@ -60,7 +60,9 @@ test('deduplicates vehicle candidates by VIN and renders granted vehicles plate
expect(document.querySelector('.v2-user-editor-sidesheet')).not.toBeInTheDocument();
fireEvent.click(customer);
await waitFor(() => expect(customer).toHaveAttribute('aria-expanded', 'true'));
expect(document.querySelector('.v2-user-editor-sidesheet .semi-sidesheet-inner')).toHaveAttribute('aria-label', '客户账号详情');
const editorSheet = document.querySelector<HTMLElement>('.v2-user-editor-sidesheet .semi-sidesheet-inner');
expect(editorSheet).toHaveAttribute('aria-label', '客户账号详情');
expect(editorSheet).toHaveStyle({ width: 'min(840px, 100vw)' });
expect(document.querySelector('.v2-user-editor-sidesheet .v2-user-editor-tabs.semi-tabs')).toBeInTheDocument();
expect(document.querySelector('.v2-user-editor-form')).toHaveAttribute('id', 'v2-user-editor-form');
expect(screen.getAllByRole('tab')).toHaveLength(3);

View File

@@ -352,7 +352,7 @@ export default function UsersPage() {
<SideSheet
className="v2-user-editor-sidesheet"
visible={editorVisible}
width={mobileLayout ? '100%' : 840}
width={mobileLayout ? '100%' : 'min(840px, 100vw)'}
aria-label="客户账号详情"
title={<div className="v2-user-editor-sheet-title">
<span><strong>{creating ? '创建客户账号' : selected?.displayName}</strong><small>{creating ? '设置登录身份和最小必要权限' : `@${selected?.username} · ${draft.menuKeys.length} 个菜单 · ${draft.vehicleGrants.length} 辆车 · 最近登录 ${formatTime(selected?.lastLoginAt)}`}</small></span>

View File

@@ -8794,6 +8794,8 @@
}
.v2-user-editor-sidesheet .semi-sidesheet-inner {
width: min(840px, 100vw) !important;
max-width: 100vw;
overflow: hidden;
border-left: 1px solid #d8e2ee;
background: #f6f8fb;