@cqsjjb/jjb-react-admin-component 3.3.1-beta.4 → 3.3.1-beta.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.
@@ -109,6 +109,7 @@ export default props => {
109
109
 
110
110
  // 获得指定索引的节点 ID
111
111
  const getLevelIndexNodeIds = (targetIndexArr, key) => {
112
+ const children = props?.fieldNames?.children || 'children';
112
113
  const pathNodes = [];
113
114
  const pathNodesIds = [];
114
115
  let currentData = props.treeData || [];
@@ -121,10 +122,10 @@ export default props => {
121
122
  }
122
123
  nextNode = currentData[index];
123
124
  } else {
124
- if (!currentData?.children || !Array.isArray(currentData.children) || index < 0 || index >= currentData.children.length) {
125
+ if (!currentData?.[children] || !Array.isArray(currentData[children]) || index < 0 || index >= currentData[children].length) {
125
126
  return null;
126
127
  }
127
- nextNode = currentData.children[index];
128
+ nextNode = currentData?.[children][index];
128
129
  }
129
130
  pathNodes.push(nextNode);
130
131
  pathNodesIds.push(nextNode[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/jjb-react-admin-component",
3
- "version": "3.3.1-beta.4",
3
+ "version": "3.3.1-beta.5",
4
4
  "description": "jjb-react-admin-组件库@new",
5
5
  "main": "index.js",
6
6
  "author": "jjb-front-team",