Files
Neo-ZQYY/docs/prd/Neo_Specs/review-audit/P9-NS1-06.md
Neo 6f8f12314f feat: 累积功能变更 — 聊天集成、租户管理、小程序更新、ETL 增强、迁移脚本
包含多个会话的累积代码变更:
- backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔
- admin-web: ETL 状态页、任务管理、调度配置、登录优化
- miniprogram: 看板页面、聊天集成、UI 组件、导航更新
- etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强
- tenant-admin: 项目初始化
- db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8)
- packages/shared: 枚举和工具函数更新
- tools: 数据库工具、报表生成、健康检查
- docs: PRD/架构/部署/合约文档更新

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 00:03:48 +08:00

56 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# P9→NS1/RNS1 缺失项 #6AI 洞察卡片的展示规范
## 简要结论
- 状态:⚠️ 部分解决
- 风险等级:🟠 中
- AI 洞察卡片已实现标题/摘要/策略列表展示,但缺少 P9 定义的"展开详情"交互和"刷新"按钮。
## 详细审查
### 审查范围
- `apps/backend/app/schemas/xcx_customers.py``AiInsight` schema
- `apps/backend/app/services/customer_service.py``_build_ai_insight()` 实现
- `apps/miniprogram/miniprogram/pages/customer-detail/customer-detail.wxml` — AI 洞察区域
- `apps/miniprogram/miniprogram/pages/customer-detail/customer-detail.wxss` — AI 洞察样式
### 发现
1. **后端AI 洞察数据已实现**
- `AiInsight` schema 含 `summary: str``strategies: list[AiStrategy]`
- `_build_ai_insight()``biz.ai_cache``cache_type='app4_analysis'`)读取缓存的 AI 分析结果
- 无缓存时返回空默认值
2. **前端:卡片展示已实现**
- 渐变背景卡片(紫色渐变 `#667eea → #764ba2`
- AI 图标 + "AI 智能洞察"标题
- 摘要文本展示
- 策略列表(带颜色左边框,支持 green/amber/pink 三色)
3. **缺失交互**
- **无"展开详情"功能**P9 定义了摘要可展开查看完整分析,当前实现直接展示全部内容
- **无"刷新"按钮**P9 定义了手动触发 AI 重新分析的刷新按钮,当前无此交互
- 后端也无对应的"触发 AI 重新分析"端点
### 证据
前端 AI 洞察卡片(无展开/刷新交互):
```html
<view class="ai-insight-card">
<view class="ai-insight-header">
<view class="ai-icon-box">...</view>
<text class="ai-insight-label">AI 智能洞察</text>
<!-- 缺少刷新按钮 -->
</view>
<view class="ai-insight-summary-v">
<text class="ai-insight-summary">{{fmt.safe(aiInsight.summary)}}</text>
<!-- 无展开/折叠控制 -->
</view>
...
</view>
```
### 建议(如未完全解决)
1. **展开详情**:如摘要较长,可添加 `wx:if="{{aiExpanded}}"` 控制展示行数,默认 3 行 + "查看更多"
2. **刷新按钮**:在 header 右侧添加刷新图标,点击调用后端 AI 分析端点
3. **后端**:添加 `POST /api/xcx/customers/{id}/ai-refresh` 端点触发重新分析