feat(web): 按原型调整响应式研究工作台

This commit is contained in:
yuxuanhui
2026-08-10 10:07:55 +08:00
parent 5b650166b5
commit ed7bdda515
16 changed files with 1319 additions and 350 deletions
+20 -3
View File
@@ -1,5 +1,6 @@
import { createRootRoute, createRoute, Outlet } from "@tanstack/react-router"
import { AppLayout } from "@/app/layout/app-layout"
import { HomePage } from "@/features/home/pages/home-page"
import { SelectionResultsPage } from "@/features/selection/pages/selection-results-page"
@@ -7,16 +8,32 @@ const rootRoute = createRootRoute({
component: () => <Outlet />,
})
const indexRoute = createRoute({
const workspaceRoute = createRoute({
getParentRoute: () => rootRoute,
id: "_workspace",
component: AppLayout,
})
const indexRoute = createRoute({
getParentRoute: () => workspaceRoute,
path: "/",
component: HomePage,
})
const selectionRoute = createRoute({
getParentRoute: () => rootRoute,
getParentRoute: () => workspaceRoute,
path: "/selection",
validateSearch: (search: Record<string, unknown>) => {
const rawPage = Number(search.page)
const rawPageSize = Number(search.pageSize)
const page =
Number.isFinite(rawPage) && rawPage >= 1 ? Math.floor(rawPage) : 1
const pageSize = [5, 10, 20].includes(rawPageSize) ? rawPageSize : 10
return { page, pageSize }
},
component: SelectionResultsPage,
})
export const routeTree = rootRoute.addChildren([indexRoute, selectionRoute])
export const routeTree = rootRoute.addChildren([
workspaceRoute.addChildren([indexRoute, selectionRoute]),
])