feat(config): 重构配置模块导航与版本切换,新增版本删除能力

This commit is contained in:
2026-05-15 15:30:52 +08:00
parent 000295ae2b
commit 8bd7cc3d73
20 changed files with 669 additions and 377 deletions

View File

@@ -11,6 +11,7 @@ import {
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { adminShellNavItems, ADMIN_BASE } from "@/modules/_config/admin-nav";
import { CONFIG_ROUTE_LABELS } from "@/modules/config/config-nav-model";
import React from "react";
const DRAW_ROUTE_LABELS: Record<string, string> = {
@@ -26,6 +27,12 @@ function titleCase(value: string): string {
.join(" ");
}
type BreadcrumbCrumb = {
label: string;
href: string;
isCurrent: boolean;
};
export function AdminBreadcrumb() {
const pathname = usePathname();
@@ -33,7 +40,7 @@ export function AdminBreadcrumb() {
const segments = pathname.split("/").filter(Boolean);
// 基础面包屑:首页/仪表盘
const breadcrumbs = [
const breadcrumbs: BreadcrumbCrumb[] = [
{
label: "首页",
href: ADMIN_BASE,
@@ -58,7 +65,12 @@ export function AdminBreadcrumb() {
if (segments.length > 2) {
const subSegment = segments[2];
const subLabel = subSegment ? DRAW_ROUTE_LABELS[subSegment] ?? titleCase(subSegment) : "";
let subLabel = "";
if (businessSegment === "config" && subSegment) {
subLabel = CONFIG_ROUTE_LABELS[subSegment] ?? titleCase(subSegment);
} else {
subLabel = subSegment ? DRAW_ROUTE_LABELS[subSegment] ?? titleCase(subSegment) : "";
}
if (subLabel) {
breadcrumbs.push({
label: subLabel,