diff --git a/zhixing-web/src/features/selection/components/selection-presentation.ts b/zhixing-web/src/features/selection/components/selection-presentation.ts index 5cb9d50..f88c6aa 100644 --- a/zhixing-web/src/features/selection/components/selection-presentation.ts +++ b/zhixing-web/src/features/selection/components/selection-presentation.ts @@ -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, diff --git a/zhixing-web/src/features/selection/components/signal-record-list.tsx b/zhixing-web/src/features/selection/components/signal-record-list.tsx index 8a235f3..1b8e6d0 100644 --- a/zhixing-web/src/features/selection/components/signal-record-list.tsx +++ b/zhixing-web/src/features/selection/components/signal-record-list.tsx @@ -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({ J  - {stock.signals - .map((signal) => getSignalJValue(signal.details)) - .join(" / ")} + {getStockJValue(stock)}