feat: wire health workspace pages
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import AlertsPage from "../../alerts/page";
|
||||
import { AlertsModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function ScopedAlertsPage(): React.ReactElement {
|
||||
return AlertsPage();
|
||||
return <AlertsModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import DevicesPage from "../../devices/page";
|
||||
import { DevicesModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function ScopedDevicesPage(): React.ReactElement {
|
||||
return DevicesPage();
|
||||
return <DevicesModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import FamilyPage from "../../family/page";
|
||||
import { FamilyModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function ScopedFamilyPage(): React.ReactElement {
|
||||
return FamilyPage();
|
||||
return <FamilyModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import HealthPage from "../../health/page";
|
||||
import { renderHealthWorkspacePage } from "@/modules/health/components/HealthWorkspacePage";
|
||||
|
||||
export default function ScopedHealthPage(): React.ReactElement {
|
||||
return HealthPage();
|
||||
export default async function ScopedHealthPage(): Promise<React.ReactElement> {
|
||||
return renderHealthWorkspacePage();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import NoticesPage from "../../notices/page";
|
||||
import { NoticesModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function ScopedNoticesPage(): React.ReactElement {
|
||||
return NoticesPage();
|
||||
return <NoticesModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { Radio } from "lucide-react";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
import { AlertsModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function AlertsPage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="规则预警"
|
||||
eyebrow="规则中心与风险识别"
|
||||
description="三期计划接入健康阈值、任务逾期、设备故障、应急事件和风险老人识别规则。"
|
||||
icon={Radio}
|
||||
phase="三期预留"
|
||||
/>
|
||||
);
|
||||
return <AlertsModulePage />;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ export default async function DashboardPage(): Promise<React.ReactElement> {
|
||||
careTasks={careTasks}
|
||||
emergencyHref={getWorkspaceHref(context.organization?.slug, "/emergency")}
|
||||
emergencyIncidents={emergencyIncidents}
|
||||
healthHref={getWorkspaceHref(context.organization?.slug, "/settings/health")}
|
||||
healthHref={getWorkspaceHref(context.organization?.slug, "/health")}
|
||||
healthReviews={healthReviews}
|
||||
incidents={visibleIncidents}
|
||||
metrics={metrics}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { Wrench } from "lucide-react";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
import { DevicesModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function DevicesPage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="设备运维"
|
||||
eyebrow="设备台账与维修工单"
|
||||
description="待接入设备台账、故障上报、维修派单、处理记录和状态恢复数据源。"
|
||||
icon={Wrench}
|
||||
phase="待接入"
|
||||
/>
|
||||
);
|
||||
return <DevicesModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { TabletSmartphone } from "lucide-react";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
import { FamilyModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function FamilyPage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="家属服务"
|
||||
eyebrow="家属端与探访反馈"
|
||||
description="二期计划接入家属授权、老人动态、探访预约和服务反馈数据源。"
|
||||
icon={TabletSmartphone}
|
||||
phase="二期预留"
|
||||
/>
|
||||
);
|
||||
return <FamilyModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { HeartPulse } from "lucide-react";
|
||||
import { renderHealthWorkspacePage } from "@/modules/health/components/HealthWorkspacePage";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
|
||||
export default function HealthPage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="健康照护"
|
||||
eyebrow="健康档案与生命体征"
|
||||
description="待接入生命体征、健康档案、慢病信息和异常复核数据源。"
|
||||
icon={HeartPulse}
|
||||
phase="待接入"
|
||||
/>
|
||||
);
|
||||
export default async function HealthPage(): Promise<React.ReactElement> {
|
||||
return renderHealthWorkspacePage();
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { Bell } from "lucide-react";
|
||||
|
||||
import { ModulePage } from "@/modules/shared/components/ModulePage";
|
||||
import { NoticesModulePage } from "@/modules/shared/components/ReservedModulePages";
|
||||
|
||||
export default function NoticesPage(): React.ReactElement {
|
||||
return (
|
||||
<ModulePage
|
||||
title="公告通知"
|
||||
eyebrow="公告发布与阅读状态"
|
||||
description="待接入公告草稿、发布范围、阅读状态和通知记录数据源。"
|
||||
icon={Bell}
|
||||
phase="待接入"
|
||||
/>
|
||||
);
|
||||
return <NoticesModulePage />;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { hasPermission } from "@/modules/core/server/permissions";
|
||||
import { listHealthAdminData } from "@/modules/health/server/operations";
|
||||
import { HealthAdminClient } from "@/modules/health/components/HealthAdminClient";
|
||||
import { getWorkspaceHref } from "@/modules/shared/lib/workspace-routing";
|
||||
import { renderHealthWorkspacePage } from "@/modules/health/components/HealthWorkspacePage";
|
||||
|
||||
export default async function HealthSettingsPage(): 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 <HealthAdminClient canManage={hasPermission(context.permissions, "health:manage")} initialData={data} />;
|
||||
return renderHealthWorkspacePage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user