refactor: tighten shadcn admin ui polish

This commit is contained in:
hailin
2026-07-02 11:02:59 +08:00
parent 399a5bdb73
commit dbb1ceb0e0
17 changed files with 62 additions and 76 deletions

View File

@@ -7,7 +7,7 @@ import { AppPageHeader } from '@/components/app/AppPageHeader'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Checkbox } from '@/components/ui/checkbox'
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { Switch } from '@/components/ui/switch'
@@ -139,7 +139,7 @@ export function SystemUsersPage() {
return (
<main className="min-h-screen bg-background p-6 text-foreground">
<div className="mx-auto flex max-w-7xl flex-col gap-4">
<AppPageHeader title="用户管理" description="维护平台账号、启用状态、角色和业务用户组。" />
<AppPageHeader title="用户管理" />
<form className="grid gap-3 rounded-lg border border-border bg-surface p-3 md:grid-cols-[1fr_1fr_1fr_1fr_auto]" onSubmit={handleCreateUser}>
<Input placeholder="账号" value={form.username} onChange={(event) => setForm({ ...form, username: event.target.value })} required />
@@ -160,7 +160,6 @@ export function SystemUsersPage() {
rows={filteredUsers}
getRowKey={(user) => user.id}
emptyTitle="暂无用户"
emptyDescription="创建账号后会显示在这里。"
footer={<p className="text-sm text-muted-foreground">当前显示 {filteredUsers.length} 个用户</p>}
/>
) : null}
@@ -209,8 +208,7 @@ function UserAccessDialog({
<Dialog open={Boolean(user)} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="sm:max-w-xl">
<DialogHeader>
<DialogTitle>用户授权</DialogTitle>
<DialogDescription>为 {user?.display_name || user?.username} 分配角色和用户组。</DialogDescription>
<DialogTitle>用户授权{user ? `:${user.display_name || user.username}` : ''}</DialogTitle>
</DialogHeader>
<div className="grid gap-4 md:grid-cols-2">
<div className="grid gap-2">