feat: 定投标记展示

This commit is contained in:
hzm
2026-03-04 08:30:30 +08:00
parent be4fc5eabe
commit c9038757dd
5 changed files with 30 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -310,6 +310,7 @@ export default function MobileFundTable({
const original = info.row.original || {}; const original = info.row.original || {};
const code = original.code; const code = original.code;
const isUpdated = original.isUpdated; const isUpdated = original.isUpdated;
const hasDca = original.hasDca;
const hasHoldingAmount = original.holdingAmountValue != null; const hasHoldingAmount = original.holdingAmountValue != null;
const holdingAmountDisplay = hasHoldingAmount ? (original.holdingAmount ?? '—') : null; const holdingAmountDisplay = hasHoldingAmount ? (original.holdingAmount ?? '—') : null;
const isFavorites = favorites?.has?.(code); const isFavorites = favorites?.has?.(code);
@@ -365,6 +366,7 @@ export default function MobileFundTable({
}} }}
> >
{holdingAmountDisplay} {holdingAmountDisplay}
{hasDca && <span className="dca-indicator"></span>}
{isUpdated && <span className="updated-indicator"></span>} {isUpdated && <span className="updated-indicator"></span>}
</span> </span>
) : code ? ( ) : code ? (
@@ -386,6 +388,7 @@ export default function MobileFundTable({
}} }}
> >
#{code} #{code}
{hasDca && <span className="dca-indicator"></span>}
{isUpdated && <span className="updated-indicator"></span>} {isUpdated && <span className="updated-indicator"></span>}
</span> </span>
) : null} ) : null}

View File

@@ -348,6 +348,7 @@ export default function PcFundTable({
const original = info.row.original || {}; const original = info.row.original || {};
const code = original.code; const code = original.code;
const isUpdated = original.isUpdated; const isUpdated = original.isUpdated;
const hasDca = original.hasDca;
const isFavorites = favorites?.has?.(code); const isFavorites = favorites?.has?.(code);
const isGroupTab = currentTab && currentTab !== 'all' && currentTab !== 'fav'; const isGroupTab = currentTab && currentTab !== 'all' && currentTab !== 'fav';
const rowContext = useContext(SortableRowContext); const rowContext = useContext(SortableRowContext);
@@ -399,6 +400,7 @@ export default function PcFundTable({
</span> </span>
{code ? <span className="muted code-text"> {code ? <span className="muted code-text">
#{code} #{code}
{hasDca && <span className="dca-indicator"></span>}
{isUpdated && <span className="updated-indicator"></span>} {isUpdated && <span className="updated-indicator"></span>}
</span> : null} </span> : null}
</div> </div>

View File

@@ -1412,6 +1412,28 @@ input[type="number"] {
transform: translateY(-1px); transform: translateY(-1px);
} }
.dca-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 16px;
height: 16px;
padding: 0 4px;
border-radius: 999px;
background: rgba(34, 211, 238, 0.15);
color: #22d3ee;
font-size: 10px;
font-weight: 500;
margin-left: 6px;
vertical-align: middle;
transform: translateY(-1px);
}
[data-theme="light"] .dca-indicator {
background: rgba(6, 182, 212, 0.15);
color: #0891b2;
}
.code-text { .code-text {
font-size: 11px; font-size: 11px;
} }

View File

@@ -799,6 +799,7 @@ export default function HomePage() {
code: f.code, code: f.code,
fundName: f.name, fundName: f.name,
isUpdated: f.jzrq === todayStr, isUpdated: f.jzrq === todayStr,
hasDca: dcaPlans[f.code]?.enabled === true,
latestNav, latestNav,
estimateNav, estimateNav,
yesterdayChangePercent, yesterdayChangePercent,
@@ -818,7 +819,7 @@ export default function HomePage() {
holdingProfitValue, holdingProfitValue,
}; };
}), }),
[displayFunds, holdings, isTradingDay, todayStr, getHoldingProfit], [displayFunds, holdings, isTradingDay, todayStr, getHoldingProfit, dcaPlans],
); );
// 自动滚动选中 Tab 到可视区域 // 自动滚动选中 Tab 到可视区域
@@ -4160,6 +4161,7 @@ export default function HomePage() {
</span> </span>
<span className="muted"> <span className="muted">
#{f.code} #{f.code}
{dcaPlans[f.code]?.enabled === true && <span className="dca-indicator"></span>}
{f.jzrq === todayStr && <span className="updated-indicator"></span>} {f.jzrq === todayStr && <span className="updated-indicator"></span>}
</span> </span>
</div> </div>