From 8993a10106b65c1669c0e472cfb74de78d10ee3d Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 1 Sep 2026 13:47:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(todo-form):=20=E4=BA=BA=E7=B1=BB=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=80=9A=E9=81=93=E6=8E=A5form=5Fschema=E2=80=94?= =?UTF-8?q?=E2=80=94=E4=B8=A4=E6=9D=A1=E5=BE=85=E5=8A=9E=E9=80=9A=E9=81=93?= =?UTF-8?q?(=E9=97=AE=E9=A2=98/=E4=BA=BA=E7=B1=BB=E4=BB=BB=E5=8A=A1)?= =?UTF-8?q?=E5=85=A8=E4=BA=A7=E7=BA=BF=E9=80=9A=E7=94=A8=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/human_task_capability.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pipeline_service/human_task_capability.py b/pipeline_service/human_task_capability.py index 339079f..22d957f 100644 --- a/pipeline_service/human_task_capability.py +++ b/pipeline_service/human_task_capability.py @@ -83,11 +83,15 @@ async def _get_user_roles(sor, user_id): async def create_human_task(project_id, title, description="", task_type=T_GENERAL, assignee_role=None, assignee_id=None, - iteration_id=None, bug_id=None, created_by=None, task_id=""): + iteration_id=None, bug_id=None, created_by=None, task_id="", + form_schema=None): """派发项目级人类任务。assignee_role 或 assignee_id 至少指定一个。 task_id:确认类任务绑定原引擎任务 id(用于确认后继续派发/退回重做)。 - 返回 (True, human_task_id) 或 (False, 错误信息)。 + form_schema:动态表单声明(可选,与问题通道同格式)——待办详情按它渲染 + 上传/填写界面,人类在待办里直接完成任务(文件落项目工作空间,路径进 + result_data 供 QC 与任务链消费)。 + 返回 (True, human_task_id) 或 (False, 错误信息) """ if not project_id: return False, "缺少 project_id" @@ -112,6 +116,7 @@ async def create_human_task(project_id, title, description="", task_type=T_GENER iteration_id = getattr(it[0], 'id', '') if it else '' hid = getID() + _fs_json = json.dumps(form_schema, ensure_ascii=False) if form_schema else None await sor.C('pipeline_human_tasks', { 'id': hid, 'task_id': task_id or '', # 确认类任务绑定原引擎任务 id @@ -120,7 +125,7 @@ async def create_human_task(project_id, title, description="", task_type=T_GENER 'task_type': task_type or T_GENERAL, 'assignee_role': assignee_role or '', 'assignee_id': assignee_id or '', - 'form_schema': None, + 'form_schema': _fs_json, 'result_data': None, 'status': S_PENDING, 'submitted_by': created_by or '',