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(), + )} +
); })}