Исправлена ошибка поиска значения для WellTreeSelector

This commit is contained in:
Александр Сироткин 2021-12-23 15:23:38 +05:00
parent f5c6496d38
commit a824bddbc4

View File

@ -33,7 +33,7 @@ const getLabel = (wellsTree: any[], value?: string): string | undefined => {
switch (type) { switch (type) {
case 'cluster': case 'cluster':
deposit = wellsTree.find((deposit) => ( deposit = wellsTree.find((deposit) => (
cluster = deposit.children?.find((cluster: any) => cluster.value === value) cluster = deposit.children?.find((cluster: any) => cluster.key === value)
)) ))
if (deposit && cluster) if (deposit && cluster)
return `${deposit.title} / ${cluster.title}` return `${deposit.title} / ${cluster.title}`
@ -41,7 +41,7 @@ const getLabel = (wellsTree: any[], value?: string): string | undefined => {
case 'well': case 'well':
deposit = wellsTree.find((deposit) => ( deposit = wellsTree.find((deposit) => (
cluster = deposit.children?.find((cluster: any) => ( cluster = deposit.children?.find((cluster: any) => (
well = cluster.children?.find((well: any) => well.value === value) well = cluster.children?.find((well: any) => well.key === value)
)) ))
)) ))
if (deposit && cluster && well) if (deposit && cluster && well)