feat:表格列最新净值和估算净值增加日期显示
This commit is contained in:
@@ -662,25 +662,41 @@ export default function MobileFundTable({
|
|||||||
{
|
{
|
||||||
accessorKey: 'latestNav',
|
accessorKey: 'latestNav',
|
||||||
header: '最新净值',
|
header: '最新净值',
|
||||||
cell: (info) => (
|
cell: (info) => {
|
||||||
<span style={{ display: 'block', width: '100%', fontWeight: 700 }}>
|
const original = info.row.original || {};
|
||||||
<FitText maxFontSize={14} minFontSize={10}>
|
const date = original.latestNavDate ?? '-';
|
||||||
{info.getValue() ?? '—'}
|
return (
|
||||||
</FitText>
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 0 }}>
|
||||||
</span>
|
<span style={{ display: 'block', width: '100%', fontWeight: 700 }}>
|
||||||
),
|
<FitText maxFontSize={14} minFontSize={10}>
|
||||||
|
{info.getValue() ?? '—'}
|
||||||
|
</FitText>
|
||||||
|
</span>
|
||||||
|
<span className="muted" style={{ fontSize: '10px' }}>{date}</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
meta: { align: 'right', cellClassName: 'value-cell', width: columnWidthMap.latestNav },
|
meta: { align: 'right', cellClassName: 'value-cell', width: columnWidthMap.latestNav },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'estimateNav',
|
accessorKey: 'estimateNav',
|
||||||
header: '估算净值',
|
header: '估算净值',
|
||||||
cell: (info) => (
|
cell: (info) => {
|
||||||
<span style={{ display: 'block', width: '100%', fontWeight: 700 }}>
|
const original = info.row.original || {};
|
||||||
<FitText maxFontSize={14} minFontSize={10}>
|
const date = original.estimateNavDate ?? '-';
|
||||||
{info.getValue() ?? '—'}
|
const displayDate = typeof date === 'string' && date.length > 5 ? date.slice(5) : date;
|
||||||
</FitText>
|
|
||||||
</span>
|
return (
|
||||||
),
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 0 }}>
|
||||||
|
<span style={{ display: 'block', width: '100%', fontWeight: 700 }}>
|
||||||
|
<FitText maxFontSize={14} minFontSize={10}>
|
||||||
|
{info.getValue() ?? '—'}
|
||||||
|
</FitText>
|
||||||
|
</span>
|
||||||
|
<span className="muted" style={{ fontSize: '10px' }}>{displayDate}</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
meta: { align: 'right', cellClassName: 'value-cell', width: columnWidthMap.estimateNav },
|
meta: { align: 'right', cellClassName: 'value-cell', width: columnWidthMap.estimateNav },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -566,11 +566,20 @@ export default function PcFundTable({
|
|||||||
header: '最新净值',
|
header: '最新净值',
|
||||||
size: 100,
|
size: 100,
|
||||||
minSize: 80,
|
minSize: 80,
|
||||||
cell: (info) => (
|
cell: (info) => {
|
||||||
<FitText style={{ fontWeight: 700 }} maxFontSize={14} minFontSize={10}>
|
const original = info.row.original || {};
|
||||||
{info.getValue() ?? '—'}
|
const date = original.latestNavDate ?? '-';
|
||||||
</FitText>
|
return (
|
||||||
),
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 0 }}>
|
||||||
|
<FitText style={{ fontWeight: 700 }} maxFontSize={14} minFontSize={10} as="div">
|
||||||
|
{info.getValue() ?? '—'}
|
||||||
|
</FitText>
|
||||||
|
<span className="muted" style={{ fontSize: '11px' }}>
|
||||||
|
{date}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
meta: {
|
meta: {
|
||||||
align: 'right',
|
align: 'right',
|
||||||
cellClassName: 'value-cell',
|
cellClassName: 'value-cell',
|
||||||
@@ -581,11 +590,20 @@ export default function PcFundTable({
|
|||||||
header: '估算净值',
|
header: '估算净值',
|
||||||
size: 100,
|
size: 100,
|
||||||
minSize: 80,
|
minSize: 80,
|
||||||
cell: (info) => (
|
cell: (info) => {
|
||||||
<FitText style={{ fontWeight: 700 }} maxFontSize={14} minFontSize={10}>
|
const original = info.row.original || {};
|
||||||
{info.getValue() ?? '—'}
|
const date = original.estimateNavDate ?? '-';
|
||||||
</FitText>
|
return (
|
||||||
),
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 0 }}>
|
||||||
|
<FitText style={{ fontWeight: 700 }} maxFontSize={14} minFontSize={10} as="div">
|
||||||
|
{info.getValue() ?? '—'}
|
||||||
|
</FitText>
|
||||||
|
<span className="muted" style={{ fontSize: '11px' }}>
|
||||||
|
{date}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
meta: {
|
meta: {
|
||||||
align: 'right',
|
align: 'right',
|
||||||
cellClassName: 'value-cell',
|
cellClassName: 'value-cell',
|
||||||
|
|||||||
@@ -660,7 +660,9 @@ export default function HomePage() {
|
|||||||
isUpdated: f.jzrq === todayStr,
|
isUpdated: f.jzrq === todayStr,
|
||||||
hasDca: dcaPlans[f.code]?.enabled === true,
|
hasDca: dcaPlans[f.code]?.enabled === true,
|
||||||
latestNav,
|
latestNav,
|
||||||
|
latestNavDate: yesterdayDate,
|
||||||
estimateNav,
|
estimateNav,
|
||||||
|
estimateNavDate: estimateTime,
|
||||||
yesterdayChangePercent,
|
yesterdayChangePercent,
|
||||||
yesterdayChangeValue,
|
yesterdayChangeValue,
|
||||||
yesterdayDate,
|
yesterdayDate,
|
||||||
|
|||||||
Reference in New Issue
Block a user