feat: 历史周报+图片预览+照片管理+导入优化+用户合并
新增: - 历史周报: Dashboard/周报详情支持周选择器翻看往周,归档只读 - 图片预览: 全屏大图(移动端+PC端),点击遮罩关闭 - PC端照片管理: 编辑时可上传/删除照片 - 客户导入改为更新模式: 重名自动更新信息,显示操作明细 - 导入跳过原因: 旧周报导入也显示每条跳过原因 优化: - 填报进度权限: 经理只看到自己,支局长/领导看全员 - 客户经理暖灰色hash标签列 - 用户去重合并(4组),数据完整迁移 - CLAUDE.md 更新到最新状态 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from typing import Optional
|
||||
from datetime import date
|
||||
from fastapi import APIRouter, Depends, Query
|
||||
from fastapi.responses import StreamingResponse
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from app.database import get_db
|
||||
@@ -10,11 +12,13 @@ router = APIRouter(prefix="/export", tags=["Export"])
|
||||
|
||||
@router.get("/weekly-report")
|
||||
async def download_weekly_report(
|
||||
reference_date: Optional[str] = Query(None),
|
||||
current_user: dict = Depends(require_director_or_leader),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Export this week's report as a 4-sheet .xlsx file."""
|
||||
excel_bytes = await export_weekly_report(db)
|
||||
"""Export week report as 4-sheet .xlsx. Pass reference_date for historical weeks."""
|
||||
ref = date.fromisoformat(reference_date) if reference_date else None
|
||||
excel_bytes = await export_weekly_report(db, ref)
|
||||
return StreamingResponse(
|
||||
excel_bytes,
|
||||
media_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
|
||||
Reference in New Issue
Block a user