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, 'Не удалось загрузить статистику по скважинам/секциям',