refactor(ui): 深度翻新仪表盘与边缘配置页的骨架与组件

这个提交包含在:
2026-03-06 09:54:14 +08:00
父节点 73b51ac068
当前提交 fe55848f75
共修改 9 个文件,包含 58 行新增和 66 行删除
+11 -12
查看文件
@@ -9,7 +9,6 @@ import { PageHeader } from "../components/common/PageHeader";
import { TableSkeleton } from "../components/common/TableSkeleton";
import { StatusBadge } from "../components/common/StatusBadge";
import { Button } from "../components/ui/button";
import { Card } from "../components/ui/card";
import { Input } from "../components/ui/input";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../components/ui/table";
@@ -80,14 +79,14 @@ export function DelegationsPage() {
<p className="rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-600">{error}</p>
) : null}
<Card className="space-y-4 p-6">
<div className="card-std space-y-4">
<h3 className="text-base font-semibold text-zinc-900">创建委派</h3>
<div className="grid gap-3 md:grid-cols-2">
<label className="space-y-1 text-sm">
<span className="font-medium text-zinc-700">委派给(审批人候选)</span>
<select
className="h-11 w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm"
className="select-std"
data-testid="delegations-create-delegate"
onChange={(event) => setDelegateEmployeeId(event.target.value)}
value={delegateEmployeeId}
@@ -107,7 +106,7 @@ export function DelegationsPage() {
<label className="space-y-1 text-sm">
<span className="font-medium text-zinc-700">范围</span>
<select
className="h-11 w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm"
className="select-std"
data-testid="delegations-create-scope"
onChange={(event) => setScope(event.target.value as "all" | "reimbursement_submit")}
value={scope}
@@ -138,13 +137,13 @@ export function DelegationsPage() {
{createMutation.isPending ? "创建中..." : "创建委派"}
</Button>
</div>
</Card>
</div>
<Card className="space-y-4 p-6">
<div className="card-std space-y-4">
<div className="flex flex-wrap items-center justify-between gap-2">
<h3 className="text-base font-semibold text-zinc-900">我的委派</h3>
<select
className="h-11 rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm"
className="select-std w-auto"
data-testid="delegations-status-filter"
onChange={(event) =>
setStatus(event.target.value as "active" | "scheduled" | "expired" | "revoked" | "all")
@@ -164,10 +163,10 @@ export function DelegationsPage() {
<p className="text-sm text-red-600">
{isApiError(listQuery.error)
? `${listQuery.error.code}: ${mapApiErrorMessage(
listQuery.error.code,
listQuery.error.details,
listQuery.error.message,
)}`
listQuery.error.code,
listQuery.error.details,
listQuery.error.message,
)}`
: "加载委派列表失败"}
</p>
) : null}
@@ -256,7 +255,7 @@ export function DelegationsPage() {
</div>
</div>
) : null}
</Card>
</div>
</div>
);
}