From 0ce7d185852335f9b87ac367d9348f6c980f4b72 Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Thu, 19 Mar 2026 22:29:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20PC=20=E8=A1=A8=E5=A4=B4=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=B1=85=E5=8F=B3=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/PcFundTable.jsx | 49 ++++++++++++++++------------------ 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/app/components/PcFundTable.jsx b/app/components/PcFundTable.jsx index 5308ac4..1fd127e 100644 --- a/app/components/PcFundTable.jsx +++ b/app/components/PcFundTable.jsx @@ -48,6 +48,7 @@ const NON_FROZEN_COLUMN_IDS = [ 'latestNav', 'estimateNav', ]; + const COLUMN_HEADERS = { relatedSector: '关联板块', latestNav: '最新净值', @@ -466,7 +467,7 @@ export default function PcFundTable({ while (queue.length) { const item = queue.shift(); if (item == null) continue; - // eslint-disable-next-line no-await-in-loop + results.push(await worker(item)); } }); @@ -1046,19 +1047,22 @@ export default function PcFundTable({ const isNameColumn = header.column.id === 'fundName' || header.column.columnDef?.accessorKey === 'fundName'; - const align = isNameColumn ? '' : 'text-center'; + const isRightAligned = NON_FROZEN_COLUMN_IDS.includes(header.column.id); + const align = isNameColumn ? '' : isRightAligned ? 'text-right' : 'text-center'; return (
- {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext(), - )} +
+ {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext(), + )} +
{!forPortal && (
{ const columnId = cell.column.id || cell.column.columnDef?.accessorKey; const isNameColumn = columnId === 'fundName'; - const rightAlignedColumns = new Set([ - 'latestNav', - 'estimateNav', - 'yesterdayChangePercent', - 'estimateChangePercent', - 'totalChangePercent', - 'holdingAmount', - 'todayProfit', - 'holdingProfit', - ]); const align = isNameColumn ? '' - : rightAlignedColumns.has(columnId) + : NON_FROZEN_COLUMN_IDS.includes(columnId) ? 'text-right' : 'text-center'; const cellClassName = @@ -1281,19 +1275,22 @@ export default function PcFundTable({ const isNameColumn = header.column.id === 'fundName' || header.column.columnDef?.accessorKey === 'fundName'; - const align = isNameColumn ? '' : 'text-center'; + const isRightAligned = NON_FROZEN_COLUMN_IDS.includes(header.column.id); + const align = isNameColumn ? '' : isRightAligned ? 'text-right' : 'text-center'; return (
- {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext(), - )} +
+ {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext(), + )} +
); })}