zy-react-library 1.0.147 → 1.0.148

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.
@@ -1,6 +1,6 @@
1
1
  import { TreeSelect } from "antd";
2
2
  import { useEffect } from "react";
3
- import { getTreeNodePaths, processTreeDataByLevel, processTreeDataForOnlyLastLevel } from "../../../utils";
3
+ import { arrayObjectDeduplication, getDataType, getTreeNodePaths, processTreeDataByLevel, processTreeDataForOnlyLastLevel } from "../../../utils";
4
4
 
5
5
  /**
6
6
  * 基础下拉树组件(不建议直接使用此组件,二次继承使用)
@@ -37,6 +37,22 @@ function BasicSelectTree(props) {
37
37
 
38
38
  const handleChange = (value, label, extra) => {
39
39
  if (value) {
40
+ if (getDataType(value) === "Array") {
41
+ const parentNodes = [];
42
+ for (let i = 0; i < value.length; i++) {
43
+ const currentParentNodes = getTreeNodePaths({
44
+ data: treeData,
45
+ targetId: value[i],
46
+ idKey,
47
+ childrenKey,
48
+ isIncludeOneself: onGetNodePathsIsIncludeOneself,
49
+ });
50
+ parentNodes.push(...currentParentNodes);
51
+ }
52
+ onGetNodePaths?.(arrayObjectDeduplication(parentNodes, idKey));
53
+ onGetLabel?.(label);
54
+ return;
55
+ }
40
56
  const parentNodes = getTreeNodePaths({
41
57
  data: treeData,
42
58
  targetId: value,
@@ -27,7 +27,7 @@ function getService(service, getExtraParams = {}, transform, usePermission) {
27
27
  }
28
28
 
29
29
  if (usePermission)
30
- params.menuPath = window.location.pathname
30
+ params.menuPath = window.location.pathname;
31
31
 
32
32
  // 发起请求
33
33
  const res = await service(params);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.147",
4
+ "version": "1.0.148",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",