hy-virtual-tree 1.1.34 → 1.1.35
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.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +11 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1032,6 +1032,10 @@ function useCheck(props, tree) {
|
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
1034
|
function setCheckedKeys(keys, isBusiness = false) {
|
|
1035
|
+
if (!Array.isArray(keys)) {
|
|
1036
|
+
console.warn('setCheckedKeys请传入数组');
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1035
1039
|
const { type } = props.rowSelection;
|
|
1036
1040
|
checkedKeys.clear();
|
|
1037
1041
|
indeterminateKeys.clear();
|
|
@@ -1108,6 +1112,10 @@ function useCheck(props, tree) {
|
|
|
1108
1112
|
}
|
|
1109
1113
|
}
|
|
1110
1114
|
function setCheckedNodes(data, isBusiness = false) {
|
|
1115
|
+
if (!Array.isArray(data)) {
|
|
1116
|
+
console.warn('setCheckedNodes请传入数组');
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1111
1119
|
const { type } = props.rowSelection;
|
|
1112
1120
|
checkedKeys.clear();
|
|
1113
1121
|
indeterminateKeys.clear();
|
|
@@ -1550,7 +1558,7 @@ function updateUserTree(tree, data, config) {
|
|
|
1550
1558
|
const userMap = tree.userMap || new Map();
|
|
1551
1559
|
data.forEach((v) => {
|
|
1552
1560
|
const userList = userMap.get(v.id);
|
|
1553
|
-
if (!userList
|
|
1561
|
+
if (!userList || !userList?.length)
|
|
1554
1562
|
return;
|
|
1555
1563
|
userList.forEach((node) => {
|
|
1556
1564
|
const target = tree.treeNodeMap.get(node.key);
|
|
@@ -1575,7 +1583,7 @@ function updateCsTree(tree, data, config) {
|
|
|
1575
1583
|
const csMap = tree.csMap || new Map();
|
|
1576
1584
|
data.forEach((v) => {
|
|
1577
1585
|
const csList = csMap.get(v.id);
|
|
1578
|
-
if (!csList
|
|
1586
|
+
if (!csList || !csList?.length)
|
|
1579
1587
|
return;
|
|
1580
1588
|
csList.forEach((node) => {
|
|
1581
1589
|
const target = tree.treeNodeMap.get(node.key);
|
|
@@ -2261,7 +2269,7 @@ class VirtualTree {
|
|
|
2261
2269
|
continue;
|
|
2262
2270
|
let count = isCountFiler ? 0 : target.data.count;
|
|
2263
2271
|
let total = isTotalFiler ? 0 : target.data.total;
|
|
2264
|
-
if (isCountFiler || isTotalFiler) {
|
|
2272
|
+
if ((isCountFiler || isTotalFiler) && target.children) {
|
|
2265
2273
|
for (let i = 0; i < target.children.length; i++) {
|
|
2266
2274
|
const item = target.children[i];
|
|
2267
2275
|
count =
|