diff --git a/src/pages/price-analysis/index.tsx b/src/pages/price-analysis/index.tsx index 9567597..6ca8035 100644 --- a/src/pages/price-analysis/index.tsx +++ b/src/pages/price-analysis/index.tsx @@ -388,12 +388,17 @@ export default function PriceAnalysisPage() { { value: 12, label: '12 месяцев' }, ]} /> - {region ? ( td { background-color: #bae0ff !important; } + .price-row-same { + background-color: #f6ffed !important; + } + .price-row-same:hover > td { + background-color: #d9f7be !important; + } .cte-info-card .ant-card-head-wrapper { gap: 8px; padding-top: 8px; diff --git a/src/widgets/price-table/ui/price-card-list.tsx b/src/widgets/price-table/ui/price-card-list.tsx index 9287b8e..cdff9c4 100644 --- a/src/widgets/price-table/ui/price-card-list.tsx +++ b/src/widgets/price-table/ui/price-card-list.tsx @@ -1,4 +1,4 @@ -import { WarningOutlined } from '@ant-design/icons' +import { InfoCircleOutlined, WarningOutlined } from '@ant-design/icons' import { Card, Checkbox, Empty, List, Skeleton, Tooltip, Typography } from 'antd' import dayjs from 'dayjs' @@ -20,6 +20,7 @@ interface TableRow { isOutlier: boolean reason?: string isManual: boolean + isSame: boolean manualIndex?: number } @@ -34,6 +35,7 @@ interface PriceCardListProps { manualSelectedIndices: Set onToggleManual: (idx: number) => void loading: boolean + parentId?: string } export function PriceCardList({ @@ -47,6 +49,7 @@ export function PriceCardList({ manualSelectedIndices, onToggleManual, loading, + parentId, }: PriceCardListProps) { if (loading) { return @@ -62,6 +65,7 @@ export function PriceCardList({ isOutlier: p.isOutlier ?? false, reason: p.reason ?? undefined, isManual: false, + isSame: !!parentId && p.cteId === parentId, })), ...manualPrices.map((mp, idx) => ({ key: `manual:${idx}`, @@ -70,6 +74,7 @@ export function PriceCardList({ date: null, source: mp.reason, isOutlier: false, + isSame: false, isManual: true, manualIndex: idx, })), @@ -103,7 +108,9 @@ export function PriceCardList({ ? '3px solid #DB2B21' : row.isManual ? '3px solid #1677ff' - : undefined, + : row.isSame + ? '3px solid #52c41a' + : undefined, }} >
@@ -128,6 +135,13 @@ export function PriceCardList({ )} + {row.isSame && !row.isOutlier && ( + + + + )}
{formatPrice(row.price)} diff --git a/src/widgets/price-table/ui/price-table.tsx b/src/widgets/price-table/ui/price-table.tsx index a21b286..3192e96 100644 --- a/src/widgets/price-table/ui/price-table.tsx +++ b/src/widgets/price-table/ui/price-table.tsx @@ -1,4 +1,4 @@ -import { WarningOutlined } from '@ant-design/icons' +import { InfoCircleOutlined, WarningOutlined } from '@ant-design/icons' import { Checkbox, Table, Tooltip } from 'antd' import type { ColumnsType } from 'antd/es/table' import dayjs from 'dayjs' @@ -27,6 +27,7 @@ interface TableRow { isOutlier: boolean reason?: string isManual: boolean + isSame: boolean manualIndex?: number } @@ -39,6 +40,7 @@ interface PriceTableProps { manualSelectedIndices: Set onToggleManual: (idx: number) => void loading: boolean + parentId?: string } export function PriceTable({ @@ -50,6 +52,7 @@ export function PriceTable({ manualSelectedIndices, onToggleManual, loading, + parentId, }: PriceTableProps) { const isMobile = useIsMobile() @@ -63,6 +66,7 @@ export function PriceTable({ isOutlier: p.isOutlier ?? false, reason: p.reason ?? undefined, isManual: false, + isSame: !!parentId && p.cteId === parentId, })) const manualRows: TableRow[] = manualPrices.map((mp, idx) => ({ @@ -72,12 +76,13 @@ export function PriceTable({ date: null, source: mp.reason, isOutlier: false, + isSame: false, isManual: true, manualIndex: idx, })) return [...apiRows, ...manualRows] - }, [prices, manualPrices]) + }, [prices, manualPrices, parentId]) const totalCount = prices.length + manualPrices.length const selectedCount = selectedIds.size + manualSelectedIndices.size @@ -97,6 +102,7 @@ export function PriceTable({ manualSelectedIndices={manualSelectedIndices} onToggleManual={onToggleManual} loading={loading} + parentId={parentId} /> ) } @@ -138,6 +144,11 @@ export function PriceTable({ )} + {record.isSame && !record.isOutlier && ( + + + + )} ), }, @@ -177,6 +188,7 @@ export function PriceTable({ rowClassName={(record) => { if (record.isOutlier && !record.isManual) return 'price-row-outlier' if (record.isManual) return 'price-row-manual' + if (record.isSame) return 'price-row-same' return '' }} style={{ marginTop: 16 }}