fix: 看板4项体验修复 — 时间/身份证/日期筛选/通知跳转

1. 完整16位产品身份证号显示(不再截断)
2. 日期筛选栏: 今天 | 近7天 | 近30天 | 全部
   - 后端 recent-activity 支持 since/until ISO参数
   - 默认展示今天动态,可按时间范围切换
3. 操作人兜底: TaskLog无operator_id时用任务assignee_id
4. 未读通知可点击跳转通知页面 + 快捷入口增加通知中心
This commit is contained in:
2026-08-12 13:35:23 +08:00
parent c3f3a5e291
commit 00fae01eed
4 changed files with 151 additions and 69 deletions

View File

@ -1,4 +1,5 @@
"""Dashboard API"""
from datetime import datetime
from fastapi import APIRouter, Depends, Query
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.database import get_db
@ -18,7 +19,11 @@ async def dashboard_stats(db: AsyncSession = Depends(get_db)):
@router.get("/recent-activity", response_model=list[RecentActivity])
async def recent_activity(
limit: int = Query(10, ge=1, le=50),
since: str | None = Query(None, description="起始日期 ISO格式 如 2026-08-12T00:00:00"),
until: str | None = Query(None, description="截止日期 ISO格式"),
db: AsyncSession = Depends(get_db),
):
"""最近任务动态 — 看板活动时间线"""
return await get_recent_activity(db, limit)
"""最近任务动态 — 支持日期范围筛选"""
since_dt = datetime.fromisoformat(since) if since else None
until_dt = datetime.fromisoformat(until) if until else None
return await get_recent_activity(db, limit, since=since_dt, until=until_dt)