From 4629525d2a3ead9d64b7d8e826b358fbb723b9bf Mon Sep 17 00:00:00 2001 From: seaislee1209 Date: Tue, 10 Mar 2026 11:17:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 编辑弹窗中所属项目改为可选下拉 - 后端 SubmissionUpdate 新增 project_id 字段 - 切换到内部事务项目时自动调整阶段和内容类型 - 修复编辑时产出时长校验变量名 bug Co-Authored-By: Claude Opus 4.6 --- backend/routers/submissions.py | 7 ++++++- backend/schemas.py | 1 + frontend/src/views/Submissions.vue | 21 ++++++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/backend/routers/submissions.py b/backend/routers/submissions.py index 43621a3..c9b68ee 100644 --- a/backend/routers/submissions.py +++ b/backend/routers/submissions.py @@ -194,6 +194,11 @@ def update_submission( } # 更新字段 + if req.project_id is not None: + project = db.query(Project).filter(Project.id == req.project_id).first() + if not project: + raise HTTPException(status_code=404, detail="项目不存在") + sub.project_id = req.project_id if req.project_phase is not None: sub.project_phase = PhaseGroup(req.project_phase) if req.work_type is not None: @@ -221,7 +226,7 @@ def update_submission( # 产出时长校验:前期内容不需要,中期/后期内容必须 > 0 NO_DURATION_TYPES = {'策划案', '大纲/梗概', '概念设计图', '测试片', '剧本', '分镜', '人设图', '场景图', '道具图', '培训', '招聘面试', '内部其他'} content_val = sub.content_type.value if hasattr(sub.content_type, 'value') else sub.content_type - if content_val not in PRE_PHASE_TYPES and sub.total_seconds <= 0: + if content_val not in NO_DURATION_TYPES and sub.total_seconds <= 0: raise HTTPException(status_code=422, detail="请填写产出时长") # 保存新数据 diff --git a/backend/schemas.py b/backend/schemas.py index 8278042..4071d1b 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -174,6 +174,7 @@ class SubmissionCreate(BaseModel): class SubmissionUpdate(BaseModel): + project_id: Optional[int] = None project_phase: Optional[str] = None work_type: Optional[str] = None content_type: Optional[str] = None diff --git a/frontend/src/views/Submissions.vue b/frontend/src/views/Submissions.vue index 8569e31..25b234a 100644 --- a/frontend/src/views/Submissions.vue +++ b/frontend/src/views/Submissions.vue @@ -156,8 +156,10 @@ - - + + + +