feat(web): 完善选股详情图表与案例图

This commit is contained in:
yuxuanhui
2026-09-01 13:37:19 +08:00
parent 9145fe4b2c
commit feb8fd4feb
27 changed files with 788 additions and 25 deletions
@@ -7,6 +7,7 @@ import {
import { useEffect } from "react"
import {
getSelectionChart,
getSelectionResults,
getSelectionRun,
triggerSelectionRun,
@@ -17,6 +18,12 @@ import type {
SelectionStrategy,
} from "./selection.types"
export const selectionChartQueryKey = (
tsCode?: string,
targetTradeDate?: string,
) =>
["selection", "chart", tsCode ?? "none", targetTradeDate ?? "none"] as const
export const selectionResultsQueryKey = (
strategy: SelectionStrategy,
targetTradeDate?: string,
@@ -61,6 +68,15 @@ export function useSelectionResults(
})
}
export function useSelectionChart(tsCode?: string, targetTradeDate?: string) {
return useQuery({
enabled: Boolean(tsCode && targetTradeDate),
queryFn: ({ signal }) =>
getSelectionChart(tsCode ?? "", targetTradeDate ?? "", signal),
queryKey: selectionChartQueryKey(tsCode, targetTradeDate),
})
}
export function useSelectionRun(
runId: string | null,
resultQuery: SelectionResultsQuery = { page: 1, pageSize: 10 },