From 54ada2298c8c6c46cb08737616999c9883c6544b Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Tue, 29 Mar 2022 16:36:04 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=20=D0=BA=D0=BB=D1=8E=D1=87=D0=B0=D0=BC=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BF=D0=BE=D0=B4=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BF.=20=D1=81?= =?UTF-8?q?=D0=BA=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Analytics/WellCompositeEditor/WellCompositeSections.jsx | 4 +++- src/pages/Analytics/WellCompositeEditor/index.jsx | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx index 0c55a33..9dbe389 100755 --- a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx +++ b/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx @@ -25,6 +25,8 @@ const filtersMinMax = [ { text: 'max', value: 'max' }, ] +const sortBySectionId = (a, b) => a.sectionId - b.sectionId + const filtersSectionsType = [] const DAY_IN_MS = 1000 * 60 * 60 * 24 @@ -130,7 +132,7 @@ export const WellCompositeSections = memo(({ idWell, statsWells, selectedSection makeTextColumn('скв №', 'caption', null, null, (text, item) => {text ?? '-'} ), - makeTextColumn('Секция', 'sectionType', filtersSectionsType, null, (text) => text ?? '-'), + makeTextColumn('Секция', 'sectionType', filtersSectionsType, sortBySectionId, (text) => text ?? '-'), makeNumericColumnPlanFact('Глубина, м', 'sectionWellDepth', filtersMinMax, makeFilterMinMaxFunction), makeNumericColumnPlanFact('Продолжительность, ч', 'sectionBuildDays', filtersMinMax, makeFilterMinMaxFunction), makeNumericColumnPlanFact('МСП, м/ч', 'sectionRateOfPenetration', filtersMinMax, makeFilterMinMaxFunction), diff --git a/src/pages/Analytics/WellCompositeEditor/index.jsx b/src/pages/Analytics/WellCompositeEditor/index.jsx index cd2de0d..80f3534 100755 --- a/src/pages/Analytics/WellCompositeEditor/index.jsx +++ b/src/pages/Analytics/WellCompositeEditor/index.jsx @@ -42,13 +42,14 @@ export const WellCompositeEditor = memo(({ idWell, rootPath }) => { useEffect(() => { const wellIds = selectedSections.map((value) => value.idWellSrc) + .filter((id, idx, arr) => arr.lastIndexOf(id) === idx) setSelectedIdWells(wellIds) }, [selectedSections]) useEffect(() => invokeWebApiWrapperAsync( async () => { - const stats = await OperationStatService.getWellsStat(selectedIdWells) - setStatsWells(arrayOrDefault(stats)) + const stats = arrayOrDefault(await OperationStatService.getWellsStat(selectedIdWells)) + setStatsWells(stats) }, setShowTabLoader, 'Не удалось загрузить статистику по скважинам/секциям',