zmdms-webui 2.2.3 → 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对象
@@ -571,9 +571,10 @@ interface IFields {
571
571
  /**
572
572
  * 对当前字段的值做最终处理,v 跟 showKey 或者 value的类型一一对应 如果传入的是数组 那么返回的即是数组
573
573
  * @param v 当前处理值
574
+ * @param summaryTotalObj 总结栏总对象
574
575
  * @returns
575
576
  */
576
- callback?: (v: any) => any;
577
+ callback?: (v: any, summaryTotalObj: any) => any;
577
578
  /** 对齐方式 */
578
579
  align?: "left" | "center" | "right";
579
580
  }
@@ -231,7 +231,7 @@ function getSubtotalObj(fields, dataSource) {
231
231
  }
232
232
  // 如果数据还需要最终处理的话
233
233
  if (callback && index === dataSource.length - 1) {
234
- summaryTotalObj[key] = callback(summaryTotalObj[key]);
234
+ summaryTotalObj[key] = callback(summaryTotalObj[key], summaryTotalObj);
235
235
  }
236
236
  summaryTotalConfigObj[key] = {
237
237
  align: field === null || field === void 0 ? void 0 : field.align,
@@ -289,7 +289,7 @@ function getTotalObj(fields) {
289
289
  summaryTotalObj[key] = 0;
290
290
  }
291
291
  if (callback) {
292
- summaryTotalObj[key] = callback(summaryTotalObj[key]);
292
+ summaryTotalObj[key] = callback(summaryTotalObj[key], summaryTotalObj);
293
293
  }
294
294
  summaryTotalConfigObj[key] = {
295
295
  align: field === null || field === void 0 ? void 0 : field.align,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",