fix(selection): 列表仅展示单个 J 值

This commit is contained in:
yuxuanhui
2026-09-01 11:12:08 +08:00
parent 6b42bcfe15
commit c8b08add76
4 changed files with 17 additions and 11 deletions
@@ -90,6 +90,14 @@ export function getSignalJValue(details: SelectionSignal["details"]) {
return formatSignalDetailValue("j", details.j)
}
export function getStockJValue(stock: SelectionStockResult) {
const signal = stock.signals.find(
({ details }) =>
details.j !== null && details.j !== undefined && details.j !== "",
)
return getSignalJValue(signal?.details ?? {})
}
function formatSignalDetailValue(
key: string,
value: number | string | null | undefined,
@@ -8,7 +8,7 @@ import { PatternScoreDetails, PatternScoreSummary } from "./pattern-score"
import {
categoryToneClass,
getCategoryLabel,
getSignalJValue,
getStockJValue,
getStockKey,
} from "./selection-presentation"
import { SignalDetails } from "./signal-details"
@@ -77,9 +77,7 @@ export function SignalRecordList({
<span className="text-xs tabular-nums text-muted-foreground">
J&nbsp;
<strong className="font-semibold text-foreground">
{stock.signals
.map((signal) => getSignalJValue(signal.details))
.join(" / ")}
{getStockJValue(stock)}
</strong>
</span>
<Button
@@ -7,7 +7,7 @@ import { PatternScoreSummary } from "./pattern-score"
import {
categoryToneClass,
getCategoryLabel,
getSignalJValue,
getStockJValue,
getStockKey,
} from "./selection-presentation"
@@ -81,11 +81,7 @@ export function SignalTable({
<PatternScoreSummary score={stock.score} />
</td>
<td className="px-3 text-right align-middle font-semibold tabular-nums text-foreground">
{stock.signals.map((signal) => (
<span key={signal.category} className="block">
{getSignalJValue(signal.details)}
</span>
))}
{getStockJValue(stock)}
</td>
<td className="px-3 text-right align-middle font-medium tabular-nums text-foreground">
¥ {stock.close.toFixed(2)}