feat: add organization settings and invitations

This commit is contained in:
2026-07-02 05:12:35 -07:00
parent a555c9dd23
commit ba8097e583
20 changed files with 2959 additions and 130 deletions

View File

@@ -28,84 +28,106 @@ type NavItem = {
icon: LucideIcon;
};
const navItems: NavItem[] = [
type NavGroup = {
label: string;
items: NavItem[];
};
const navGroups: NavGroup[] = [
{
href: "/app/dashboard",
label: "运营看板",
icon: LayoutDashboard,
label: "运营",
items: [
{
href: "/app/dashboard",
label: "运营看板",
icon: LayoutDashboard,
},
{
href: "/app/elders",
label: "老人档案",
icon: Users,
},
{
href: "/app/beds",
label: "床位房间",
icon: BedDouble,
},
{
href: "/app/health",
label: "健康照护",
icon: HeartPulse,
},
{
href: "/app/care",
label: "护理服务",
icon: ClipboardCheck,
},
{
href: "/app/emergency",
label: "安全应急",
icon: ShieldAlert,
},
],
},
{
href: "/app/elders",
label: "老人档案",
icon: Users,
label: "协同",
items: [
{
href: "/app/devices",
label: "设备运维",
icon: Wrench,
},
{
href: "/app/notices",
label: "公告通知",
icon: Bell,
},
{
href: "/app/alerts",
label: "规则预警",
icon: Radio,
},
{
href: "/app/family",
label: "家属服务",
icon: TabletSmartphone,
},
],
},
{
href: "/app/beds",
label: "床位房间",
icon: BedDouble,
},
{
href: "/app/health",
label: "健康照护",
icon: HeartPulse,
},
{
href: "/app/care",
label: "护理服务",
icon: ClipboardCheck,
},
{
href: "/app/emergency",
label: "安全应急",
icon: ShieldAlert,
},
{
href: "/app/devices",
label: "设备运维",
icon: Wrench,
},
{
href: "/app/notices",
label: "公告通知",
icon: Bell,
},
{
href: "/app/alerts",
label: "规则预警",
icon: Radio,
},
{
href: "/app/family",
label: "家属服务",
icon: TabletSmartphone,
},
{
href: "/app/settings/organizations",
label: "机构管理",
icon: Building2,
},
{
href: "/app/settings/users",
label: "用户管理",
icon: Users,
},
{
href: "/app/settings/roles",
label: "角色权限",
icon: Settings,
},
{
href: "/app/settings/audit",
label: "审计日志",
icon: ListChecks,
},
{
href: "/app/settings/status",
label: "运行状态",
icon: Wrench,
label: "系统设置",
items: [
{
href: "/app/settings/organizations",
label: "机构管理",
icon: Building2,
},
{
href: "/app/settings/users",
label: "用户管理",
icon: Users,
},
{
href: "/app/settings/roles",
label: "角色权限",
icon: Settings,
},
{
href: "/app/settings/audit",
label: "审计日志",
icon: ListChecks,
},
{
href: "/app/settings/status",
label: "运行状态",
icon: Wrench,
},
],
},
];
const navItems: NavItem[] = navGroups.flatMap((group) => group.items);
type AppShellProps = {
children: React.ReactNode;
account: PublicAccount;
@@ -129,22 +151,29 @@ export function AppShell({ children, account, permissions }: AppShellProps): Rea
</Link>
<nav className="min-h-0 flex-1 overflow-y-auto px-3 py-4" aria-label="主导航">
<ul className="space-y-1">
{navItems.map((item) => (
<li key={item.href}>
<Link
href={item.href}
className="group flex min-h-11 items-center gap-3 rounded-md px-3 text-sm transition-colors hover:bg-secondary"
>
<item.icon
className="size-4 shrink-0 text-muted-foreground group-hover:text-primary"
aria-hidden="true"
/>
<span className="min-w-0 truncate font-medium">{item.label}</span>
</Link>
</li>
<div className="space-y-5">
{navGroups.map((group) => (
<section key={group.label}>
<p className="px-3 pb-2 text-xs font-semibold text-muted-foreground">{group.label}</p>
<ul className="space-y-1">
{group.items.map((item) => (
<li key={item.href}>
<Link
href={item.href}
className="group flex min-h-11 items-center gap-3 rounded-md px-3 text-sm transition-colors hover:bg-secondary"
>
<item.icon
className="size-4 shrink-0 text-muted-foreground group-hover:text-primary"
aria-hidden="true"
/>
<span className="min-w-0 truncate font-medium">{item.label}</span>
</Link>
</li>
))}
</ul>
</section>
))}
</ul>
</div>
</nav>
</div>
</aside>