feat: wire health workspace pages
This commit is contained in:
@@ -368,7 +368,7 @@ export function HealthAdminClient({ canManage, initialData }: HealthAdminClientP
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-5">
|
||||
<div className="flex w-full flex-col gap-5">
|
||||
<section className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||
<MetricCard icon={FileText} label="健康档案" value={data.metrics.eldersWithProfiles} />
|
||||
<MetricCard icon={Activity} label="今日体征" value={data.metrics.vitalsToday} />
|
||||
|
||||
44
modules/health/components/HealthWorkspacePage.tsx
Normal file
44
modules/health/components/HealthWorkspacePage.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { HeartPulse } from "lucide-react";
|
||||
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { hasPermission } from "@/modules/core/server/permissions";
|
||||
import { HealthAdminClient } from "@/modules/health/components/HealthAdminClient";
|
||||
import { listHealthAdminData } from "@/modules/health/server/operations";
|
||||
import { getWorkspaceHref } from "@/modules/shared/lib/workspace-routing";
|
||||
|
||||
export async function renderHealthWorkspacePage(): Promise<React.ReactElement> {
|
||||
const context = await getCurrentAuthContext();
|
||||
if (!context) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
if (!hasPermission(context.permissions, "health:read")) {
|
||||
redirect(getWorkspaceHref(context.organization?.slug, "/dashboard"));
|
||||
}
|
||||
|
||||
const organizationId = context.organization?.id;
|
||||
if (!organizationId) {
|
||||
redirect(getWorkspaceHref(context.organization?.slug, "/dashboard"));
|
||||
}
|
||||
|
||||
const data = await listHealthAdminData(organizationId);
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-5">
|
||||
<section className="flex flex-col gap-3 border-b pb-4 lg:flex-row lg:items-start lg:justify-between">
|
||||
<div className="flex min-w-0 items-center gap-3">
|
||||
<span className="inline-flex size-9 items-center justify-center rounded-md bg-secondary text-primary">
|
||||
<HeartPulse className="size-4" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<h1 className="truncate text-xl font-semibold tracking-normal">健康照护</h1>
|
||||
<p className="mt-1 truncate text-sm text-muted-foreground">健康档案、生命体征、慢病管理与异常复核</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<HealthAdminClient canManage={hasPermission(context.permissions, "health:manage")} initialData={data} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
51
modules/shared/components/ReservedModulePages.tsx
Normal file
51
modules/shared/components/ReservedModulePages.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Bell, Radio, TabletSmartphone, Wrench } from "lucide-react";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
|
||||
export function DevicesModulePage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="设备运维"
|
||||
eyebrow="设备台账与维修工单"
|
||||
description="待接入设备台账、故障上报、维修派单、处理记录和状态恢复数据源。"
|
||||
icon={Wrench}
|
||||
phase="待接入"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function FamilyModulePage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="家属服务"
|
||||
eyebrow="家属端与探访反馈"
|
||||
description="二期计划接入家属授权、老人动态、探访预约和服务反馈数据源。"
|
||||
icon={TabletSmartphone}
|
||||
phase="二期预留"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function NoticesModulePage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="公告通知"
|
||||
eyebrow="公告发布与阅读状态"
|
||||
description="待接入公告草稿、发布范围、阅读状态和通知记录数据源。"
|
||||
icon={Bell}
|
||||
phase="待接入"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function AlertsModulePage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="规则预警"
|
||||
eyebrow="规则中心与风险识别"
|
||||
description="三期计划接入健康阈值、任务逾期、设备故障、应急事件和风险老人识别规则。"
|
||||
icon={Radio}
|
||||
phase="三期预留"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export const navGroups: NavGroup[] = [
|
||||
path: "/health",
|
||||
label: "健康照护",
|
||||
icon: "health",
|
||||
permission: "elder:read",
|
||||
permission: "health:read",
|
||||
},
|
||||
{
|
||||
path: "/care",
|
||||
|
||||
Reference in New Issue
Block a user