R29-1 R29-6: 重构海音达工作台壳层与高频页面

这个提交包含在:
2026-03-23 09:59:35 +08:00
父节点 f9198a781a
当前提交 7e183c0cdc
共修改 33 个文件,包含 2193 行新增和 1564 行删除
+5 -26
查看文件
@@ -1,32 +1,11 @@
import { useEffect } from "react";
import { Outlet, useLocation } from "react-router-dom";
import { NAV_ITEMS } from "../components/navigation/NavLinks";
import { ErrorBoundary } from "../components/common/ErrorBoundary";
import { Sidebar } from "../components/navigation/Sidebar";
import { Topbar } from "../components/navigation/Topbar";
import { resolvePageMeta } from "../features/navigation/schema";
import { writeRecentVisit } from "../lib/recentVisits";
const EXTRA_TITLE_ENTRIES = [
{ path: "/notifications", title: "通知中心" },
{ path: "/reimbursements/", title: "报销详情" },
{ path: "/workflow/tasks/", title: "审批详情" },
{ path: "/people/", title: "员工档案" },
];
function resolveVisitTitle(pathname: string) {
const candidates = [
...NAV_ITEMS.map((item) => ({ path: item.to, title: item.label })),
...EXTRA_TITLE_ENTRIES,
].sort((left, right) => right.path.length - left.path.length);
const matched = candidates.find((item) => pathname === item.path || pathname.startsWith(item.path));
if (matched) {
return matched.title;
}
return pathname === "/" ? "Portal" : pathname;
}
export function AppShellLayout() {
const location = useLocation();
@@ -35,17 +14,17 @@ export function AppShellLayout() {
if (!pathname || pathname === "/login" || pathname.startsWith("/mobile/")) {
return;
}
writeRecentVisit(pathname, resolveVisitTitle(pathname));
writeRecentVisit(pathname, resolvePageMeta(pathname).title);
}, [location.pathname]);
return (
<div className="flex min-h-screen bg-zinc-50">
<div className="flex min-h-screen bg-[var(--color-bg-canvas)]">
<Sidebar />
<main className="flex-1 flex flex-col min-w-0 lg:ml-64">
<main className="flex min-w-0 flex-1 flex-col lg:ml-72">
<Topbar />
<div className="flex-1 p-4 sm:p-8">
<div className="flex-1 px-4 py-6 sm:px-8 sm:py-8">
<div className="layout-container max-w-none">
<ErrorBoundary>
<Outlet />
+30 -3
查看文件
@@ -1,10 +1,37 @@
import { Outlet } from "react-router-dom";
import { AppBrand } from "../components/shell/AppBrand";
export function AuthLayout() {
return (
<div className="flex min-h-screen items-center justify-center bg-gradient-to-br from-primary-50 via-background-light to-zinc-100 p-6">
<div className="w-full max-w-md">
<Outlet />
<div className="min-h-screen bg-[radial-gradient(circle_at_top_left,_rgba(17,24,39,0.08),_transparent_34%),linear-gradient(180deg,_#f8fafc_0%,_#f3f4f6_100%)] px-6 py-10 lg:px-10 lg:py-14">
<div className="mx-auto grid min-h-[calc(100vh-5rem)] max-w-6xl items-center gap-8 lg:grid-cols-[minmax(0,1.05fr),minmax(420px,0.95fr)]">
<section className="hidden rounded-[2rem] border border-zinc-200 bg-white/75 p-10 shadow-sm backdrop-blur lg:block">
<AppBrand />
<div className="mt-8 space-y-6">
<div>
<div className="text-xs font-semibold uppercase tracking-[0.18em] text-zinc-400">统一入口</div>
<h1 className="mt-2 text-4xl font-semibold tracking-tight text-zinc-900">让员工先找到今天要做什么</h1>
<p className="mt-3 max-w-xl text-base leading-7 text-zinc-600">
企业微信负责进入和提醒,真正的审批、项目、周报与留痕都在 OA 内完成。
</p>
</div>
<div className="grid gap-4 md:grid-cols-2">
<div className="surface-muted px-5 py-5">
<div className="text-sm font-semibold text-zinc-900">主路径稳定</div>
<div className="mt-2 text-sm leading-6 text-zinc-600">Portal、团队、请假、报销、资产、周报、待办、公告、项目保持稳定结构。</div>
</div>
<div className="surface-muted px-5 py-5">
<div className="text-sm font-semibold text-zinc-900">入口可回退</div>
<div className="mt-2 text-sm leading-6 text-zinc-600">企业微信免登失败时仍可使用账号密码,不让员工猜测下一步。</div>
</div>
</div>
</div>
</section>
<section className="mx-auto w-full max-w-xl">
<Outlet />
</section>
</div>
</div>
);