zmdms-webui 3.2.9 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,15 +70,17 @@ var MainMenu = function (props) {
|
|
|
70
70
|
filterMenus = filterMenuHandle(filterMenus);
|
|
71
71
|
}
|
|
72
72
|
return filterMenus.map(function (userMenu) {
|
|
73
|
+
var _a;
|
|
73
74
|
return {
|
|
74
75
|
label: getLabel(userMenu),
|
|
75
|
-
title: userMenu.name,
|
|
76
|
+
title: (_a = userMenu.name) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
76
77
|
key: userMenu.id,
|
|
77
78
|
icon: userMenu.source ? (jsx(IconFont, { type: userMenu.source, style: { fontSize: "18px" } })) : null,
|
|
78
79
|
};
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
return userMenus.map(function (userMenu) {
|
|
83
|
+
var _a, _b;
|
|
82
84
|
var children = userMenu.children;
|
|
83
85
|
var filterMenus = [];
|
|
84
86
|
if (children) {
|
|
@@ -88,17 +90,22 @@ var MainMenu = function (props) {
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
return {
|
|
91
|
-
label: jsx("span", __assign({ title: userMenu.name }, { children: userMenu.name })),
|
|
92
|
-
title: userMenu.name,
|
|
93
|
+
label: jsx("span", __assign({ title: (_a = userMenu.name) === null || _a === void 0 ? void 0 : _a.trim() }, { children: userMenu.name })),
|
|
94
|
+
title: (_b = userMenu.name) === null || _b === void 0 ? void 0 : _b.trim(),
|
|
93
95
|
key: userMenu.id,
|
|
94
96
|
icon: userMenu.source ? (jsx(IconFont, { type: userMenu.source, style: { fontSize: "18px" } })) : null,
|
|
95
97
|
children: children
|
|
96
98
|
? filterMenus.map(function (item) {
|
|
99
|
+
var _a;
|
|
97
100
|
return {
|
|
98
101
|
label: getLabel(item),
|
|
99
|
-
title: item.name,
|
|
102
|
+
title: (_a = item.name) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
100
103
|
key: item.id,
|
|
101
|
-
icon: item.source ? (jsx(IconFont, { type: item.source, style: { fontSize: "18px" } })) :
|
|
104
|
+
icon: item.source ? (jsx(IconFont, { type: item.source, style: { fontSize: "18px" } })) : (jsx("span", { style: {
|
|
105
|
+
fontSize: "18px",
|
|
106
|
+
display: "inline-block",
|
|
107
|
+
width: "1em",
|
|
108
|
+
} })),
|
|
102
109
|
};
|
|
103
110
|
})
|
|
104
111
|
: null,
|
|
@@ -150,11 +150,18 @@ var SubMenu = function (props, ref) {
|
|
|
150
150
|
// 这里为什么要用newPath 而不是menuItem.id
|
|
151
151
|
// 因为如果要选到叶子节点,是直接拿路由去做匹配
|
|
152
152
|
// 如果这个菜单有子元素,那么这个菜单是不需要跳转的,他的key应该取menuItem.id
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
// 20260529 这里做一个调整 如果有子元素,那么他的key应该取menuItem.id
|
|
154
|
+
key: ((_a = menuItem.children) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
155
|
+
? menuItem.id
|
|
156
|
+
: newPath !== "/"
|
|
157
|
+
? newPath
|
|
158
|
+
: menuItem.id,
|
|
159
|
+
// key:
|
|
160
|
+
// newPath !== "/"
|
|
161
|
+
// ? newPath
|
|
162
|
+
// : menuItem.children?.length > 0
|
|
163
|
+
// ? menuItem.id
|
|
164
|
+
// : newPath,
|
|
158
165
|
// newPath === "/" || menuItem.children?.length > 0
|
|
159
166
|
// ? menuItem.id
|
|
160
167
|
// : newPath,
|
|
@@ -185,7 +192,7 @@ var SubMenu = function (props, ref) {
|
|
|
185
192
|
"zmdms-menu--sub-hide-bg": hideSubMenuBg,
|
|
186
193
|
"zmdms-menu--sub-item-line": subMenuItemLine,
|
|
187
194
|
});
|
|
188
|
-
return (jsx(Drawer, __assign({ mask: false, placement: "left", width: subMenuWidth, zIndex: 101, closable: false, open: visible, className: classes, style: { marginLeft: marginLeft }, footer: footerDom, title: subMenuLogo ? (jsx("img", { src: subMenuLogo, title: "\u4EBA\u529B\u8D44\u6E90\u7CFB\u7EDF", alt: "cico_logo" })) : (jsx("div", {})) }, { children: jsx(Menu, { inlineIndent: 5, selectedKeys: subMenusSelectedKeys, mode: "inline", items: items, openKeys: subMenuOpenKeys, onOpenChange: onSubMenuOpenChange }) })));
|
|
195
|
+
return (jsx(Drawer, __assign({ mask: false, placement: "left", width: subMenuWidth, zIndex: 101, closable: false, open: visible, className: classes, style: { marginLeft: marginLeft }, footer: footerDom, title: subMenuLogo ? (jsx("img", { src: subMenuLogo, title: "\u4EBA\u529B\u8D44\u6E90\u7CFB\u7EDF", alt: "cico_logo" })) : (jsx("div", {})), getContainer: process.env.NODE_ENV === 'development' ? false : undefined }, { children: jsx(Menu, { inlineIndent: 5, selectedKeys: subMenusSelectedKeys, mode: "inline", items: items, openKeys: subMenuOpenKeys, onOpenChange: onSubMenuOpenChange }) })));
|
|
189
196
|
};
|
|
190
197
|
var SubMenu$1 = memo(forwardRef(SubMenu));
|
|
191
198
|
|