hy-virtual-tree 1.1.52 → 1.1.53

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,12 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.1.53
4
+
5
+ _2025-12-23_
6
+
7
+ - 扩展[VirtualTree] 功能
8
+ (1)当通道状态为监控中时,且设备状态处于在线时,将设备状态回显为监控中
9
+
3
10
  ### 1.1.52
4
11
 
5
12
  _2025-12-18_
package/dist/index.js CHANGED
@@ -1851,16 +1851,20 @@ const useStatus = (config, data, node) => {
1851
1851
  if (data.dataType !== 3)
1852
1852
  return;
1853
1853
  el.classList.add('hy-tree-node__status');
1854
- if (data.deviceStatus === 1) {
1854
+ let { deviceStatus } = data;
1855
+ if (deviceStatus === DeviceStatus.ON_LINE && node.children?.some((item) => item.data.deviceStatus === DeviceStatus.BE_MONITOR)) {
1856
+ deviceStatus = DeviceStatus.BE_MONITOR;
1857
+ }
1858
+ if (deviceStatus === DeviceStatus.ON_LINE) {
1855
1859
  el.classList.add('hy-text-success');
1856
1860
  }
1857
- else if (data.deviceStatus === 7) {
1861
+ else if (deviceStatus === DeviceStatus.SOS) {
1858
1862
  el.classList.add('hy-text-danger');
1859
1863
  }
1860
- else if (data.deviceStatus !== 0) {
1864
+ else if (deviceStatus !== DeviceStatus.OFF_LINE) {
1861
1865
  el.classList.add('hy-text-gradient');
1862
1866
  }
1863
- el.innerHTML = deviceStatusMap[data.deviceStatus];
1867
+ el.innerHTML = deviceStatusMap[deviceStatus];
1864
1868
  return el;
1865
1869
  }
1866
1870
  };
@@ -9226,7 +9230,7 @@ class VirtualTree {
9226
9230
  statusSlot = this._customRender(config.renderStatus, item, {
9227
9231
  inset: true,
9228
9232
  className: 'hy-tree-node__status',
9229
- defaultFn: (data, node) => useStatus(config, data)
9233
+ defaultFn: (data, node) => useStatus(config, data, node)
9230
9234
  });
9231
9235
  }
9232
9236
  // 右侧内容
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",