From 8e7cb9c46efda8d05b9742000da95850aed8fa7e Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 25 Nov 2024 12:54:15 +0100 Subject: [PATCH] fix: zoneLocationsTree check selected sons --- src/pages/Zone/Card/ZoneLocationsTree.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue index 751d8d11d..650047e40 100644 --- a/src/pages/Zone/Card/ZoneLocationsTree.vue +++ b/src/pages/Zone/Card/ZoneLocationsTree.vue @@ -75,6 +75,7 @@ const onNodeExpanded = async (nodeKeysArray) => { if (response.data) { node.childs = response.data.map((n) => { if (n.sons > 0) n.childs = [{}]; + n.selected = isSelected(n.selected); return n; }); } @@ -115,6 +116,10 @@ function getNodeIds(node) { return ids; } +function isSelected(selected) { + if (typeof selected === 'number') return !!selected; +} + watch( () => store.data, async (val) => {