"use client"; import { useEffect, useMemo } from "react"; import type { RecommendationSegment } from "@/src/recommendations/types"; import { useImportedPoolStore } from "@/src/stores/importedPoolStore"; import { useRecommendationsStore } from "@/src/stores/recommendationsStore"; const segmentOptions: { value: RecommendationSegment; label: string }[] = [ { value: "OPEN_AUCTION", label: "集合竞价" }, { value: "MIDDAY", label: "午盘精选" }, { value: "AFTER_HOURS", label: "盘后分析" }, ]; export default function RecommendationsPage() { const codesText = useImportedPoolStore((s) => s.codesText); const poolLoading = useImportedPoolStore((s) => s.loading); const poolError = useImportedPoolStore((s) => s.error); const loadPool = useImportedPoolStore((s) => s.load); const savePool = useImportedPoolStore((s) => s.save); const setPoolDraft = useImportedPoolStore((s) => s.setDraft); const date = useRecommendationsStore((s) => s.date); const segment = useRecommendationsStore((s) => s.segment); const recLoading = useRecommendationsStore((s) => s.loading); const recError = useRecommendationsStore((s) => s.error); const snapshot = useRecommendationsStore((s) => s.snapshot); const setDate = useRecommendationsStore((s) => s.setDate); const setSegment = useRecommendationsStore((s) => s.setSegment); const loadRec = useRecommendationsStore((s) => s.load); const generate = useRecommendationsStore((s) => s.generate); useEffect(() => { void loadPool(); }, [loadPool]); useEffect(() => { void loadRec(); }, [date, segment, loadRec]); const selectedSegmentLabel = useMemo(() => { return segmentOptions.find((x) => x.value === segment)?.label ?? segment; }, [segment]); return (
MVP:自选股 + 导入池 作为 Universe,规则 v0.1(突破+均线趋势),每段 Top 10。
每行一个代码:支持 600519 或 SH:600519 / SZ:000001 / BJ:8xxxxx。空行会忽略。
| # | 代码 | 市场 | Score | 理由 | 风险 |
|---|---|---|---|---|---|
| {it.rank} | {it.code} | {it.market} | {it.score.toFixed(2)} |
|
{it.risks.length === 0 ? (
-
) : (
|