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

View File

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

View File

@@ -1412,6 +1412,28 @@ input[type="number"] {
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 {
font-size: 11px;
}

View File

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