hy-virtual-tree 1.1.30 → 1.1.32

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.1.32
4
+
5
+ _2025-09-17_
6
+
7
+ - 扩展[VirtualTree] 功能
8
+ (1)修改设置仅显示在线设备时,可以通过方法勾选隐藏的离线设备
9
+
10
+ ### 1.1.31
11
+
12
+ _2025-09-17_
13
+
14
+ - 扩展[VirtualTree] 功能
15
+ (1)修改更新数据逻辑,在仅显示在线设备时,不取消勾选离线设备
16
+
3
17
  ### 1.1.30
4
18
 
5
19
  _2025-09-17_
package/dist/index.js CHANGED
@@ -917,7 +917,7 @@ function useCheck(props, tree) {
917
917
  // 多选
918
918
  const toggle = (node, checked) => {
919
919
  // 对隐藏的节点不做处理
920
- if (hiddenNodeKeySet.has(node.key) || tree.hiddenNodeKeySet.has(node.key))
920
+ if (hiddenNodeKeySet.has(node.key) || (tree.hiddenNodeKeySet.has(node.key) && nodeClick))
921
921
  return;
922
922
  checkedKeySet[checked ? 'add' : 'delete'](node.key);
923
923
  const children = node.children;
@@ -1924,7 +1924,7 @@ class VirtualTree {
1924
1924
  return;
1925
1925
  this._tree = await this._createTree(config.data);
1926
1926
  this._flattenTree = this._genereateFlattenTree();
1927
- const { checkedKeys, updateCheckedKeys, isIndeterminate, isChecked, toggleCheckbox, getChecked, afterNodeCheck, getCheckedKeys, getCheckedNodes,
1927
+ const { checkedKeys, updateCheckedKeys, isIndeterminate, isChecked, toggleCheckbox, getChecked, getCheckedKeys, getCheckedNodes,
1928
1928
  // getHalfCheckedKeys,
1929
1929
  // getHalfCheckedNodes,
1930
1930
  setChecked, setCheckedKeys, setCheckedNodes } = useCheck(config, this._tree);
@@ -2292,7 +2292,7 @@ class VirtualTree {
2292
2292
  reject({});
2293
2293
  return;
2294
2294
  }
2295
- const { tree, beOfflineList } = updateMethod(this._tree, data, {
2295
+ const { tree } = updateMethod(this._tree, data, {
2296
2296
  business: this._business,
2297
2297
  props: {
2298
2298
  value: this._props.value,
@@ -2304,17 +2304,18 @@ class VirtualTree {
2304
2304
  businessConfig: this._businessConfig
2305
2305
  });
2306
2306
  Object.assign(this._tree, tree);
2307
- let updateNode = null;
2308
- for (const node of (beOfflineList || [])) {
2309
- if (checkedKeys.has(node.key)) {
2310
- checkedKeys.delete(node.key);
2311
- updateNode = node;
2312
- }
2313
- }
2307
+ // 设备离线时取消勾选状态
2308
+ // let updateNode = null
2309
+ // for (const node of (beOfflineList || [])) {
2310
+ // if (checkedKeys.has(node.key)) {
2311
+ // checkedKeys.delete(node.key)
2312
+ // updateNode = node
2313
+ // }
2314
+ // }
2314
2315
  updateCheckedKeys();
2315
- if (updateNode) {
2316
- afterNodeCheck(updateNode, false);
2317
- }
2316
+ // if (updateNode) {
2317
+ // afterNodeCheck(updateNode, false)
2318
+ // }
2318
2319
  resolve({});
2319
2320
  return;
2320
2321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",