zmdms-webui 2.2.4 → 2.2.5

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.
@@ -21,13 +21,13 @@ var SearchInput = function () {
21
21
  subUserMenuArr.forEach(function (item) {
22
22
  var copyItem = __assign(__assign({}, item), { selectedKey: key });
23
23
  if (Array.isArray(item === null || item === void 0 ? void 0 : item.children)) {
24
- var result = item === null || item === void 0 ? void 0 : item.children.filter(function (child) {
25
- return child.name.includes(searchValue);
26
- });
24
+ var result = item === null || item === void 0 ? void 0 : item.children.filter(function (child) { return child.name && child.name.includes(searchValue); });
27
25
  copyItem.children = result.map(function (resultItem) { return (__assign(__assign({}, resultItem), { selectedKey: key })); });
28
26
  }
29
27
  if ((Array.isArray(copyItem.children) && copyItem.children.length > 0) ||
30
- (copyItem.name.includes(searchValue) && copyItem.path !== "/")) {
28
+ (copyItem.name &&
29
+ copyItem.name.includes(searchValue) &&
30
+ copyItem.path !== "/")) {
31
31
  newSubUserMenuArr.push(copyItem);
32
32
  }
33
33
  });
@@ -14,7 +14,7 @@ import { Drawer, Menu } from 'antd';
14
14
 
15
15
  var defaultSubMenu = [];
16
16
  var SubMenu = function (props, ref) {
17
- var marginLeft = props.marginLeft, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, visible = props.visible, setVisible = props.setVisible, _a = props.defaultFixed, defaultFixed = _a === void 0 ? true : _a, hideSubMenuBg = props.hideSubMenuBg, subMenuItemLine = props.subMenuItemLine, openOnlyHasSubmenus = props.openOnlyHasSubmenus;
17
+ var marginLeft = props.marginLeft, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, visible = props.visible, setVisible = props.setVisible, _a = props.defaultFixed, defaultFixed = _a === void 0 ? false : _a, hideSubMenuBg = props.hideSubMenuBg, subMenuItemLine = props.subMenuItemLine, openOnlyHasSubmenus = props.openOnlyHasSubmenus;
18
18
  var _b = useContext(LayoutMenuContext), mainMenuSelectedKeys = _b.mainMenuSelectedKeys, setMainMenuSelectedKeys = _b.setMainMenuSelectedKeys, activeTab = _b.activeTab, userMenus = _b.userMenus, userSubMenus = _b.userSubMenus, innerUserSubMenus = _b.innerUserSubMenus, drawerTitle = _b.drawerTitle, selectMainMenu = _b.selectMainMenu, getNewPath = _b.getNewPath, renderItem = _b.renderItem;
19
19
  // 二级菜单当前选中项
20
20
  var subMenusSelectedKeys = useMemo(function () {
@@ -146,9 +146,14 @@ var SubMenu = function (props, ref) {
146
146
  // 这里为什么要用newPath 而不是menuItem.id
147
147
  // 因为如果要选到叶子节点,是直接拿路由去做匹配
148
148
  // 如果这个菜单有子元素,那么这个菜单是不需要跳转的,他的key应该取menuItem.id
149
- key: newPath === "/" || ((_a = menuItem.children) === null || _a === void 0 ? void 0 : _a.length) > 0
150
- ? menuItem.id
151
- : newPath,
149
+ key: newPath !== "/"
150
+ ? newPath
151
+ : ((_a = menuItem.children) === null || _a === void 0 ? void 0 : _a.length) > 0
152
+ ? menuItem.id
153
+ : newPath,
154
+ // newPath === "/" || menuItem.children?.length > 0
155
+ // ? menuItem.id
156
+ // : newPath,
152
157
  // icon: menuItem.source ? (
153
158
  // <Icon type={menuItem.source} style={{ fontSize: "18px" }} />
154
159
  // ) : null,
@@ -7,7 +7,7 @@ import MainMenu from './MainMenu.js';
7
7
  import SubMenu from './SubMenu.js';
8
8
 
9
9
  var MenuCom = function (props) {
10
- var width = props.width, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, logo = props.logo, logoStyle = props.logoStyle, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, _a = props.defaultVisible, defaultVisible = _a === void 0 ? true : _a, openOnlyHasSubmenus = props.openOnlyHasSubmenus, defaultFixed = props.defaultFixed, isShowSearchInput = props.isShowSearchInput, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
10
+ var width = props.width, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, logo = props.logo, logoStyle = props.logoStyle, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, _a = props.defaultVisible, defaultVisible = _a === void 0 ? false : _a, openOnlyHasSubmenus = props.openOnlyHasSubmenus, defaultFixed = props.defaultFixed, isShowSearchInput = props.isShowSearchInput, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
11
11
  // 二级菜单是否显示
12
12
  var _b = useState(defaultVisible), visible = _b[0], setVisible = _b[1];
13
13
  // 二级菜单Ref对象
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",