From 6b956f7664e517810e0265b6fae4d5de591b2bd5 Mon Sep 17 00:00:00 2001 From: Grog Date: Fri, 23 Oct 2026 09:28:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BA=D0=BF=D0=B8=20=D1=8D=D0=BA=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=82=D0=B0=20=D1=88=D0=B0=D1=85=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B8=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=B0=20=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B4=D1=80=D0=B5=D0=B2=D0=BE=D0=B2=D0=B8=D0=B4=D0=BD?= =?UTF-8?q?=D0=BE=D0=BE=D0=B3=D0=BE=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/TreeFilterDropdown/TreeFilterDropdown.tsx | 9 ++++++++- .../ConsolidatedChessContent.tsx | 8 +++++--- .../ConsolidationChessTableFilter.tsx | 1 - 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/web/src/components/TreeFilterDropdown/TreeFilterDropdown.tsx b/web/src/components/TreeFilterDropdown/TreeFilterDropdown.tsx index a6e1619..d6d26d7 100644 --- a/web/src/components/TreeFilterDropdown/TreeFilterDropdown.tsx +++ b/web/src/components/TreeFilterDropdown/TreeFilterDropdown.tsx @@ -49,7 +49,6 @@ export const TreeFilterDropdown: React.FC = ({ if (isMatch || filteredChildren.length > 0) { return { ...node, - // ВАЖНО: мы оставляем родителя, но обрезаем его детей до найденных children: filteredChildren.length > 0 ? filteredChildren : undefined, }; } @@ -142,6 +141,14 @@ export const TreeFilterDropdown: React.FC = ({ if (info.checked) { newKeys.add(node.key); childrens?.forEach((elem) => newKeys.add(elem)); + const parentNode = findParentByKey(treeData, node.key); + if (parentNode?.key) { + const childrens = getAllDescendants(parentNode as OptionType); + const isAllChildrenSelected = childrens.every((childKey) => newKeys.has(childKey)); + if(!isAllChildrenSelected){ + newKeys.delete(parentNode.key) + } + } } else { const parentNode = findParentByKey(treeData, node.key); if (parentNode?.key) { diff --git a/web/src/widgets/ConsolidatedChessContent/ConsolidatedChessContent.tsx b/web/src/widgets/ConsolidatedChessContent/ConsolidatedChessContent.tsx index b1ca29d..09fa07d 100644 --- a/web/src/widgets/ConsolidatedChessContent/ConsolidatedChessContent.tsx +++ b/web/src/widgets/ConsolidatedChessContent/ConsolidatedChessContent.tsx @@ -72,9 +72,11 @@ export const ChessContent = ({ card }: { card: VersionCard | null }) => { return () => document.removeEventListener('fullscreenchange', handleFullscreenChange); }, []); + const isHalfFiltered = (debit.length > 0 && credit.length === 0) || (debit.length === 0 && credit.length > 0); + const loadData = useCallback( async (vId: string, dIds: string[], cIds: string[], isActual: () => boolean) => { - if ((dIds.length > 0 && cIds.length === 0) || (dIds.length === 0 && cIds.length > 0)) { + if (isHalfFiltered) { notification.info({ description: 'Для сравнений по Дт и Кт нужно заполнить оба фильтра' }); return; } @@ -99,7 +101,7 @@ export const ChessContent = ({ card }: { card: VersionCard | null }) => { } } }, - [notification], + [notification, isHalfFiltered], ); const loadResData = useCallback( async (vid: string) => { @@ -252,7 +254,7 @@ export const ChessContent = ({ card }: { card: VersionCard | null }) => { />
-