feat(web+mp): AI 分析结果增强展示
Web 端 AiAnalysisList: - 分析结果 Markdown 风格渲染(标题/列表/粗体/代码) - 趋势分析类型显示统计方法提示 - 自动分析结果显示「系统自动分析」标签 小程序 ai-report/detail: - 新增 result_metadata 字段 - 自动分析标记(紫色标签) - 趋势分析统计方法说明卡片
This commit is contained in:
@@ -99,3 +99,32 @@
|
||||
color: $tx3;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.auto-badge {
|
||||
margin-top: 16px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.auto-badge-text {
|
||||
display: inline-block;
|
||||
padding: 4px 16px;
|
||||
border-radius: 8px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
background: #f0e6ff;
|
||||
color: #7c3aed;
|
||||
}
|
||||
|
||||
.trend-tip-card {
|
||||
background: #fffbeb;
|
||||
border: 1px solid #fde68a;
|
||||
border-radius: $r;
|
||||
padding: 20px 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.trend-tip-text {
|
||||
font-size: 22px;
|
||||
color: #92400e;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ export default function AiReportDetail() {
|
||||
? markdownToHtml(analysis.result_content)
|
||||
: '<p>暂无分析结果</p>';
|
||||
|
||||
const isTrendAnalysis = analysis.analysis_type === 'trend';
|
||||
const isAutoAnalysis = (analysis.result_metadata as Record<string, unknown>)?.auto_analysis === true;
|
||||
|
||||
return (
|
||||
<View className='detail-page'>
|
||||
<View className='detail-card'>
|
||||
@@ -63,8 +66,21 @@ export default function AiReportDetail() {
|
||||
<Text className='meta-item'>模型: {analysis.model_used}</Text>
|
||||
<Text className='meta-item'>{new Date(analysis.created_at).toLocaleString('zh-CN')}</Text>
|
||||
</View>
|
||||
{isAutoAnalysis && (
|
||||
<View className='auto-badge'>
|
||||
<Text className='auto-badge-text'>系统自动分析</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{isTrendAnalysis && (
|
||||
<View className='trend-tip-card'>
|
||||
<Text className='trend-tip-text'>
|
||||
趋势分析基于最小二乘法线性回归和 2 倍标准差异常检测。R² 越接近 1 表示趋势拟合越好。斜率为正表示上升趋势,斜率为负表示下降趋势。
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
<View className='content-card'>
|
||||
<RichText className='report-content' nodes={htmlContent} />
|
||||
</View>
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface AiAnalysisItem {
|
||||
model_used: string;
|
||||
status: string;
|
||||
result_content: string | null;
|
||||
result_metadata: Record<string, unknown> | null;
|
||||
error_message: string | null;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user