fix: 导航交互对齐 Ant Design Pro 体验(issue #131)
- 父级菜单整行点击 = 就地展开/收起 inline 子菜单(不再跳转), 只有子项才导航,与 Pro 的 Menu inline 模式一致 - 子菜单展开加 max-height 过渡动画 - 菜单加 AntD Menu.ItemGroup 风格分组标题,hover 态补半透明白底 - 页内旧 topbar 去背景去边线,融入内容区当页标题行,消除双顶栏感
This commit is contained in:
@@ -162,16 +162,16 @@
|
||||
|
||||
var head = el("a", "pro-menu-item pro-submenu-title" +
|
||||
(isActiveModule ? " active" : ""));
|
||||
head.href = prefix + m.url;
|
||||
head.href = "#";
|
||||
head.title = m.title;
|
||||
head.appendChild(el("span", "pro-menu-icon", m.icon));
|
||||
head.appendChild(el("span", "pro-menu-text", m.title));
|
||||
var arrow = el("span", "pro-submenu-arrow", "▸");
|
||||
head.appendChild(arrow);
|
||||
// 箭头区域点击只展开/收起,不跳转;点标题文字跳转
|
||||
arrow.addEventListener("click", function (e) {
|
||||
// AntD Pro inline 菜单交互:整行点击 = 就地展开/收起(不跳转),
|
||||
// 只有子项才导航(跨页跳转或同页 hash 切换)
|
||||
head.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
wrap.classList.toggle("open");
|
||||
});
|
||||
wrap.appendChild(head);
|
||||
@@ -203,6 +203,9 @@
|
||||
|
||||
function renderMenu(user) {
|
||||
menu.innerHTML = "";
|
||||
// AntD Menu.ItemGroup 风格分组标题
|
||||
var group = el("div", "pro-menu-group-title", "功能模块");
|
||||
menu.appendChild(group);
|
||||
// 无门户页(2026-08):菜单即模块清单,按角色过滤
|
||||
var mods = user ? IAOP_SESSION.modulesFor(user.role) : [];
|
||||
mods.forEach(function (m) {
|
||||
|
||||
Reference in New Issue
Block a user