diff --git a/frontend/src/components/MegaNav.tsx b/frontend/src/components/MegaNav.tsx index 78e71b3..aa3c408 100644 --- a/frontend/src/components/MegaNav.tsx +++ b/frontend/src/components/MegaNav.tsx @@ -1,5 +1,11 @@ import { useState } from "react"; -import { CloseOutlined, FolderOutlined, SettingOutlined } from "@ant-design/icons"; +import { + AppstoreOutlined, + HomeOutlined, + CloseOutlined, + FolderOutlined, + SettingOutlined, +} from "@ant-design/icons"; import { MEGA_NAV, MEGA_COLUMNS } from "@/utils/data"; interface Props { @@ -11,38 +17,93 @@ export default function MegaNav({ onClose, onOpen }: Props) { const [activeId, setActiveId] = useState( MEGA_NAV.find((s) => s.active)?.id ?? "sys" ); - const columns = MEGA_COLUMNS[activeId] ?? []; + const cols = MEGA_COLUMNS[activeId]; return (
e.stopPropagation()} style={{ + height: 36, + flex: "none", display: "flex", - flex: 1, - background: "#fff", - margin: "60px auto", - maxWidth: 1100, - height: "calc(100% - 120px)", - border: "1px solid var(--border)", - boxShadow: "0 6px 32px rgba(0,0,0,0.3)", + alignItems: "center", + padding: "0 10px", + background: "#262d3a", + borderBottom: "1px solid #1a1f2a", }} > + + +
+ +
+ +
{MEGA_NAV.map((s) => { @@ -55,117 +116,99 @@ export default function MegaNav({ onClose, onOpen }: Props) { display: "flex", alignItems: "center", gap: 8, - padding: "8px 12px", - fontSize: 12, + padding: "8px 14px", cursor: "pointer", - color: active ? "var(--accent-strong)" : "var(--text)", - background: active ? "var(--accent-soft)" : "transparent", - borderLeft: active ? "3px solid var(--accent)" : "3px solid transparent", - fontWeight: active ? 500 : 400, + fontSize: 12, + background: active ? "var(--accent)" : "transparent", + color: active ? "#fff" : "var(--text-on-dark)", + borderLeft: active ? "3px solid #fff" : "3px solid transparent", + }} + onMouseEnter={(e) => { + if (!active) e.currentTarget.style.background = "rgba(255,255,255,0.06)"; + }} + onMouseLeave={(e) => { + if (!active) e.currentTarget.style.background = "transparent"; }} > {s.id === "sys" ? : } - {s.label} + {s.label}
); })}
-
-
-
- {MEGA_NAV.find((s) => s.id === activeId)?.label} -
- -
-
- {columns.length === 0 && ( -
- 此分类暂无配置内容 -
- )} - {columns.map((col) => ( -
-
- {col.title} -
- {col.items.map((it) => ( + {cols.map((col) => ( +
{ - if (it.screen) { - onOpen(it.screen, it.label); - onClose(); - } - }} style={{ - padding: "5px 6px", - fontSize: 12, - cursor: it.screen ? "pointer" : "default", - color: it.screen - ? it.featured - ? "var(--accent-strong)" - : "var(--text)" - : "var(--text-faint)", - fontWeight: it.featured ? 500 : 400, - borderRadius: 2, - }} - onMouseEnter={(e) => { - if (it.screen) e.currentTarget.style.background = "var(--bg-row-hover)"; - }} - onMouseLeave={(e) => { - e.currentTarget.style.background = "transparent"; + fontSize: 13, + fontWeight: 500, + color: "#fff", + marginBottom: 10, + paddingBottom: 6, + borderBottom: "1px solid rgba(255,255,255,0.1)", }} > - {it.label} + {col.title}
- ))} -
- ))} -
+
+ {col.items.map((it, i) => { + const clickable = !!it.screen; + return ( +
{ + onOpen(it.screen!, it.label); + onClose(); + } + : undefined + } + style={{ + fontSize: 12, + color: it.featured ? "var(--accent)" : "var(--text-on-dark-muted)", + cursor: clickable ? "pointer" : "default", + display: "inline-flex", + alignItems: "center", + gap: 4, + padding: "1px 0", + }} + onMouseEnter={(e) => { + if (clickable) e.currentTarget.style.color = "#fff"; + }} + onMouseLeave={(e) => { + if (clickable) + e.currentTarget.style.color = it.featured + ? "var(--accent)" + : "var(--text-on-dark-muted)"; + }} + > + {it.label} + {it.featured ? ( + + ) : null} +
+ ); + })} +
+
+ ))} +
+ ) : ( +
+ {MEGA_NAV.find((s) => s.id === activeId)?.label} · 模块开发中 +
+ )}
diff --git a/frontend/src/utils/data.ts b/frontend/src/utils/data.ts index 59813da..04ac3aa 100644 --- a/frontend/src/utils/data.ts +++ b/frontend/src/utils/data.ts @@ -74,8 +74,6 @@ export const NAV_TREE: NavNode[] = [ label: "系统管理", icon: "settings", children: [ - { id: "userlist", label: "用户列表", leaf: true, screen: "userlist" }, - { id: "module", label: "系统模块配置", leaf: true, screen: "module" }, { id: "roles", label: "角色管理", leaf: true }, { id: "menucfg", label: "菜单配置", leaf: true }, { id: "log", label: "操作日志", leaf: true }, @@ -97,6 +95,8 @@ export const MEGA_NAV = [ { id: "logistics", label: "物流管理" }, { id: "qc", label: "质量管理" }, { id: "fin", label: "财务管理" }, + { id: "cost-pro", label: "成本管理(专)" }, + { id: "cost", label: "成本管理" }, { id: "equip", label: "设备管理" }, { id: "hr", label: "人事行政" }, { id: "oa", label: "OA 系统" }, @@ -110,28 +110,73 @@ export const MEGA_COLUMNS: Record< > = { sys: [ { + title: "期初设置", + items: [ + { label: "客户期初" }, + { label: "供应商期初" }, + { label: "材料期初" }, + { label: "产品期初" }, + { label: "数据导入" }, + { label: "离线导出下载" }, + ], + }, + { title: "用户管理", items: [ { label: "用户列表", screen: "userlist", featured: true }, { label: "系统权限" }, + { label: "系统权限稽查表" }, { label: "权限组" }, ], }, { - title: "系统模块", + title: "系统参数", items: [ - { label: "系统模块配置", screen: "module", featured: true }, - { label: "菜单配置" }, - { label: "模块字段配置" }, + { label: "系统参数" }, + { label: "财务结账" }, + { label: "系统常量配置" }, ], }, { - title: "系统参数", - items: [{ label: "系统参数" }, { label: "财务结准" }, { label: "系统常量配置" }], + title: "计算方案", + items: [{ label: "方案列表" }, { label: "计算参数" }], }, { title: "日志", - items: [{ label: "操作日志" }, { label: "MYSQL 监听器" }], + items: [ + { label: "个性化模块" }, + { label: "操作日志" }, + { label: "异常清除KPI任务表" }, + { label: "MYSQL监听器" }, + ], + }, + { + title: "开发平台", + items: [ + { label: "自定义开发范例" }, + { label: "系统功能模块设置" }, + { label: "EBC流程清单" }, + { label: "功能模块界面设置" }, + { label: "增删改存业务处理" }, + ], + }, + { + title: "API对接管理", + items: [ + { label: "调用第三方接口(TOKEN配置)" }, + { label: "调用第三方接口(接口定义)" }, + { label: "被第三方调用(生成token)" }, + { label: "数据同步" }, + { label: "被第三方调用(API定义)" }, + ], + }, + { + title: "系统模块", + items: [ + { label: "系统模块配置", screen: "module", featured: true }, + { label: "菜单配置" }, + { label: "模块字段配置" }, + ], }, ], };