From c11e1d15271f865dccff970d60fbc0872d312c87 Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Mon, 2 Nov 2026 14:25:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BE=93=E5=87=BA=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=AD=97=E6=AE=B5=E6=94=B9=E7=94=A8=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 目标文件路径/输出目录这类字段指向将来才生成的文件, 原先的打开文件对话框只能选已存在文件, 导致截屏保存位置无法选择 - 字段键/标签命中 输出|保存|另存|导出|目标文件|output/save/export 等关键词时改用保存对话框, 可直接输入新文件名 - 输入类字段保持打开对话框不变 --- src/renderer/src/panels/Properties.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/renderer/src/panels/Properties.tsx b/src/renderer/src/panels/Properties.tsx index 967fb96..cf8deb5 100644 --- a/src/renderer/src/panels/Properties.tsx +++ b/src/renderer/src/panels/Properties.tsx @@ -526,6 +526,22 @@ function FieldControl({ const pickPath = async (directories: boolean) => { try { + if (!directories) { + // 输出类字段(保存/输出/目标文件等)指向将来才生成的文件,用「保存」对话框允许输入新文件名; + // 输入类字段保持「打开」对话框,只能选择已存在的文件。 + const isOutputField = /输出|保存|另存|导出|目标文件|文件名|output|save|export|dest|target/i.test( + `${field.key} ${field.label ?? ""}` + ); + if (isOutputField) { + const selected = await window.rpa.dialog.save({ + title: field.label, + defaultPath: textOf(raw) || undefined, + filters: fileFiltersFor(node.componentId, field) + }); + if (selected) onChange(field.key, selected); + return; + } + } const selected = await window.rpa.dialog.open({ title: field.label, directories,