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 +7 -0
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
-
|
|
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 (
|
|
1861
|
+
else if (deviceStatus === DeviceStatus.SOS) {
|
|
1858
1862
|
el.classList.add('hy-text-danger');
|
|
1859
1863
|
}
|
|
1860
|
-
else if (
|
|
1864
|
+
else if (deviceStatus !== DeviceStatus.OFF_LINE) {
|
|
1861
1865
|
el.classList.add('hy-text-gradient');
|
|
1862
1866
|
}
|
|
1863
|
-
el.innerHTML = deviceStatusMap[
|
|
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
|
// 右侧内容
|