fix: столбцы сравнения с прошлым периодом убраны во всех таблицах

This commit is contained in:
anor
2026-08-18 00:43:48 +10:00
parent 4e8e369f4e
commit 181cbd142f
2 changed files with 4 additions and 17 deletions
+2 -6
View File
@@ -1,10 +1,10 @@
import { useMemo, useState } from 'react';
import type { Dataset } from '../types';
import { AmountCard, MetricCard, Panel, SectionHeader, DataTable, Change, Empty } from '../components/ui';
import { AmountCard, MetricCard, Panel, SectionHeader, DataTable, Empty } from '../components/ui';
import { BarChart, LineChart } from '../components/charts';
import { RussiaMap, shortLabel } from '../components/RussiaMap';
import type { RegionValue } from '../components/RussiaMap';
import { amount, monthLabel, percent, ratio, people as peopleLabel } from '../lib/format';
import { amount, monthLabel, percent, people as peopleLabel } from '../lib/format';
import {
HEADCOUNT_METRICS,
headcountByCompany,
@@ -26,13 +26,11 @@ export function People({ dataset }: { dataset: Dataset }) {
// раздел всегда показывает последний месяц в данных, фильтра периода нет
const visibleMonths = months;
const lastMonth = months[months.length - 1] ?? '';
const previousMonth = months[months.length - 2] ?? '';
const yearMonths = useMemo(() => monthsOfLastYear(months), [months]);
const regionMap = useMemo(() => regionByCompanyName(dataset), [dataset]);
const companiesLast = headcountByCompany(dataset.people, lastMonth);
const companiesPrevious = headcountByCompany(dataset.people, previousMonth);
const oprLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[0]);
const rppLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[1]);
const rssLast = peopleMetricByCompany(dataset.people, lastMonth, HEADCOUNT_METRICS[2]);
@@ -214,7 +212,6 @@ export function People({ dataset }: { dataset: Dataset }) {
{ key: 'disabled', label: 'Инвалиды', width: '7%' },
{ key: 'svo', label: 'Участники СВО', width: '8%' },
{ key: 'payroll', label: 'ФОТ', unit: 'за месяц', width: '11%' },
{ key: 'change', label: 'К прошлому месяцу', width: '9%' },
]}
rows={sortedEntries(companiesLast).map(([company, total]) => ({
key: company,
@@ -234,7 +231,6 @@ export function People({ dataset }: { dataset: Dataset }) {
amount(disabledLast.get(company) ?? 0),
amount(svoLast.get(company) ?? 0),
payrollLast.has(company) ? `${amount((payrollLast.get(company) ?? 0) * 1e6)} руб.` : 'нет данных',
<Change key="change" value={ratio(total, companiesPrevious.get(company) ?? null)} />,
],
}))}
footer={[