fix(selection): 列表仅展示单个 J 值
This commit is contained in:
@@ -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
|
||||
<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)}
|
||||
|
||||
Reference in New Issue
Block a user