From 6673121f3fa982911871e3bf7f1fe62a22cb2b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=87=AF?= Date: Wed, 24 Jun 2026 13:09:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1):=20?= =?UTF-8?q?=E9=80=89=E5=86=85=E7=BD=AE=E6=A8=A1=E6=9D=BF=E6=97=B6=E5=8A=A0?= =?UTF-8?q?=E3=80=8C=E6=89=A7=E8=A1=8C=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E3=80=8D=E5=BC=80=E5=85=B3=EF=BC=8C=E5=85=B3=E9=97=AD=E5=88=99?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E7=94=A8=E9=BB=98=E8=AE=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - html_config.template_extract(默认关,仅参考选 tpl: 时显示开关): 关闭→跳过检索/转换,直接用模板默认数据填充;开启→才执行检索+转换抽取 - 后端 _run_html_template_reference 在只展示分支后先判开关 - 前端 ScheduledTasksPage:参考选内置模板时显示 Switch,存进 html_config.template_extract,编辑回显 - 测试覆盖 开/关 两条路径 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/core/scheduled-tasks/types.ts | 2 ++ frontend-web/src/pages/ScheduledTasksPage.tsx | 24 +++++++++++++++++++ offline-backend-20260512/backend/CLAUDE.md | 2 +- .../deerflow/runtime/scheduler/service.py | 18 ++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/frontend-web/src/core/scheduled-tasks/types.ts b/frontend-web/src/core/scheduled-tasks/types.ts index a7eaa734..63cfac2e 100644 --- a/frontend-web/src/core/scheduled-tasks/types.ts +++ b/frontend-web/src/core/scheduled-tasks/types.ts @@ -22,6 +22,8 @@ export type HtmlPageConfig = { negative_prompt?: string | null; reference_favorite_id?: string | null; model_name?: string | null; + /** 仅当参考选了内置模板(tpl:)时生效:关闭则直接用模板默认数据,开启才检索抽取。 */ + template_extract?: boolean; }; /** 选中内置「模板数据转换器」agent 后,要把源 JSON 填充进的 HTML 模板。 diff --git a/frontend-web/src/pages/ScheduledTasksPage.tsx b/frontend-web/src/pages/ScheduledTasksPage.tsx index fecba38c..cf8ee1df 100644 --- a/frontend-web/src/pages/ScheduledTasksPage.tsx +++ b/frontend-web/src/pages/ScheduledTasksPage.tsx @@ -133,6 +133,8 @@ const emptyForm = { html_negative_prompt: "", html_reference_favorite_id: "", html_model_name: "", + // 参考选了内置模板(tpl:)时的「数据抽取」开关:关闭=用模板默认数据,开启=检索抽取。 + html_template_extract: false, }; /** 覆盖 Textarea 默认 field-sizing-content,避免输入过多时撑破弹窗 */ @@ -320,6 +322,7 @@ export default function ScheduledTasksPage() { html_negative_prompt: html.negative_prompt ?? "", html_reference_favorite_id: html.reference_favorite_id ?? "", html_model_name: html.model_name ?? "", + html_template_extract: !!html.template_extract, }); // Prefer the canonical cron_expr over the user-typed schedule_text: the // latter may be natural language ("每天9点") that parseCron can't read, @@ -388,6 +391,10 @@ export default function ScheduledTasksPage() { // Send the user's selection; fall back to the first configured model, // else null (backend then uses the system default). No hardcoded GLM-5. model_name: form.html_model_name.trim() || availableModels[0]?.name || null, + // 仅当参考是内置模板(tpl:)时有意义:关闭=用模板默认数据,开启=检索抽取。 + template_extract: form.html_reference_favorite_id.startsWith("tpl:") + ? form.html_template_extract + : false, }, }; }; @@ -1370,6 +1377,23 @@ export default function ScheduledTasksPage() { )} + {/* 参考选了内置模板(tpl:)时:数据抽取开关。关闭=用模板默认数据。 */} + {form.html_reference_favorite_id.startsWith("tpl:") && ( +
+
+

执行数据抽取

+

+ 关闭则直接用所选模板的默认数据生成(含全部子页面);开启才检索并按模板结构抽取数据填充。 +

+
+ + setForm((value) => ({ ...value, html_template_extract: v })) + } + /> +
+ )}

生成模型