From 581239cc732959905fd8d0356e8d153f9a582d91 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 Jun 2026 11:43:15 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20unify=20table=20styles=20=E2=80=94=20no?= =?UTF-8?q?=20rounded=20rows,=20wider=20type=20col,=20horizontal=20scroll,?= =?UTF-8?q?=20pagination=20by=20filtered=20groups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logistics/LogisticsReadinessBoard.jsx | 133 +++++++++--------- src/components/orders/OrdersTable.jsx | 9 +- 2 files changed, 70 insertions(+), 72 deletions(-) diff --git a/src/components/logistics/LogisticsReadinessBoard.jsx b/src/components/logistics/LogisticsReadinessBoard.jsx index 8883a4d..3d5eef2 100644 --- a/src/components/logistics/LogisticsReadinessBoard.jsx +++ b/src/components/logistics/LogisticsReadinessBoard.jsx @@ -7,7 +7,6 @@ import { ORDER_GROUP_DISPLAY_STATUS_OPTIONS, } from "../../services/orderGroupViews"; import { Badge } from "../UI/Badge"; -import { Button } from "../UI/Button"; import { Panel } from "../UI/Panel"; import { SkeletonPage } from "../UI/Loading"; import { Pagination } from "../UI/Pagination"; @@ -33,12 +32,11 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO [filters, orderGroups], ); - // Paginate + const totalPages = Math.ceil(filteredGroups.length / PAGE_SIZE); const paginatedGroups = React.useMemo(() => { const start = (page - 1) * PAGE_SIZE; return filteredGroups.slice(start, start + PAGE_SIZE); }, [filteredGroups, page]); - const totalPages = Math.ceil(filteredGroups.length / PAGE_SIZE); const statusGroups = React.useMemo(() => { const map = new Map(); @@ -71,17 +69,18 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO const totalGroups = filteredGroups.length; - const COLS = "grid-cols-[minmax(140px,2fr)_minmax(80px,1fr)_minmax(70px,0.7fr)_minmax(100px,1.2fr)_minmax(80px,1fr)_minmax(100px,1fr)_minmax(120px,1fr)]"; + // Same column layout as OrdersTable + Тип + const COLS = "grid-cols-[minmax(130px,2fr)_minmax(80px,1fr)_minmax(100px,0.8fr)_minmax(100px,1fr)_minmax(100px,1fr)_minmax(90px,0.8fr)_minmax(110px,1fr)]"; const TableHeader = () => ( -
-
Клиент
-
Город
-
Тип
-
Дата доставки
-
Водитель
-
Статус
-
Обновлён
+
+
Клиент
+
Город
+
Тип
+
Дата доставки
+
Водитель
+
Статус
+
Обновлён
); @@ -112,7 +111,7 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO По этому поиску ничего не найдено.
) : ( -
+
{Array.from(statusGroups.entries()).sort(([a], [b]) => { const idxA = FUNNEL_ORDER.indexOf(a); const idxB = FUNNEL_ORDER.indexOf(b); @@ -124,10 +123,10 @@ export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusO const isCollapsed = collapsedSections.has(statusValue); return ( - - + 0 ? "neutral" : "muted"}>{label} + {groups.length} + {!isCollapsed && (
- - {groups.map((group) => ( - - ))} + {/* Horizontal scroll wrapper — min-w so columns don't squish */} +
+ + {groups.map((group) => ( + + ))} +
)} -
+
); })}
diff --git a/src/components/orders/OrdersTable.jsx b/src/components/orders/OrdersTable.jsx index 637e3cc..2004077 100644 --- a/src/components/orders/OrdersTable.jsx +++ b/src/components/orders/OrdersTable.jsx @@ -92,7 +92,7 @@ const StatusSection = ({ statusKey, groups, isOpen, onToggle, selectedOrderGroup {groups.map((group) => { const hasProblem = group.hasDeliveryProblem; const isAgreedRow = isAgreedDelivery(group); - const rowClassName = `grid grid-cols-[minmax(130px,2fr)_minmax(90px,1fr)_minmax(80px,0.8fr)_minmax(80px,1fr)_minmax(100px,1fr)_minmax(70px,0.7fr)_minmax(80px,0.8fr)] gap-0 w-full border-t text-left transition ${ + const rowClassName = `grid grid-cols-[minmax(130px,2fr)_minmax(90px,1fr)_minmax(80px,0.8fr)_minmax(80px,1fr)_minmax(100px,1fr)_minmax(100px,0.8fr)_minmax(80px,0.8fr)] gap-0 w-full border-t text-left transition ${ isAgreedRow ? "border-[rgba(18,128,92,0.25)] bg-[rgba(18,128,92,0.07)] hover:bg-[rgba(18,128,92,0.12)]" : hasProblem @@ -265,14 +265,13 @@ export const OrdersTable = ({ const [page, setPage] = useState(1); const PAGE_SIZE = 30; - // Paginate groups before grouping + // Paginate filtered groups (after filter, before grouping) + const totalPages = Math.ceil(orderGroups.length / PAGE_SIZE); const paginatedGroups = useMemo(() => { const start = (page - 1) * PAGE_SIZE; return orderGroups.slice(start, start + PAGE_SIZE); }, [orderGroups, page]); - const totalPages = Math.ceil(orderGroups.length / PAGE_SIZE); - // Group by status const grouped = useMemo(() => { const map = {}; @@ -354,7 +353,7 @@ export const OrdersTable = ({ ) : (
-
+
{grouped.map(({ key, groups }) => (