feat: 每日AI分析改造——定调摘要、环比快照、完整连板梯队带涨停原因、生成次数记账

This commit is contained in:
Sakurasan
2026-09-02 02:59:14 +08:00
parent 375d196fef
commit 0fb2f8d3a5
9 changed files with 265 additions and 21 deletions
+2
View File
@@ -14,7 +14,9 @@ export interface AiReport {
toolsUsed: string[];
model: string;
tokens_used: number;
generation_count?: number;
created_at: string;
updated_at?: string | null;
}
export async function fetchAiLatestReport(): Promise<AiReport> {
+16 -1
View File
@@ -53,9 +53,12 @@ function AiAnalysisPage() {
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 sm:gap-4 text-xs sm:text-sm text-muted-foreground">
<span className="flex items-center gap-1.5">
<Clock className="h-3.5 w-3.5 shrink-0" />
<span className="truncate">{report.created_at}</span>
<span className="truncate">{report.updated_at || report.created_at}</span>
</span>
<span>{report.tokens_used?.toLocaleString()} tokens</span>
{(report.generation_count ?? 1) > 1 && (
<span>第 {report.generation_count} 次生成</span>
)}
{report.toolsUsed && report.toolsUsed.length > 0 && (
<span className="flex items-center gap-1.5">
<Wrench className="h-3.5 w-3.5 shrink-0" />
@@ -66,6 +69,18 @@ function AiAnalysisPage() {
</CardContent>
</Card>
{/* 今日定调摘要 */}
{report.summary && (
<div className="mb-3 sm:mb-4 rounded-lg border border-primary/30 bg-primary/5 px-3 sm:px-4 py-3">
<div className="flex items-start gap-2.5">
<span className="shrink-0 mt-0.5 rounded bg-primary/10 px-1.5 py-0.5 text-[11px] font-semibold text-primary">
今日定调
</span>
<p className="text-sm leading-relaxed">{report.summary}</p>
</div>
</div>
)}
{/* Report Content */}
<Card className="bg-card border-border">
<CardContent className="p-3 sm:p-4 md:p-6 ai-report-content">