From 6bf8e90c638d8a5babb2e43cbf26652e541fb706 Mon Sep 17 00:00:00 2001 From: yu <1919727607@qq.com> Date: Tue, 3 Nov 2026 14:11:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AA=97=E5=8F=A3=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E4=BB=8E=E5=BE=AA=E7=8E=AFconfirm=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E5=88=97=E8=A1=A8modal,=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=AF=E4=B8=80=E6=AC=A1=E7=9C=8B=E5=88=B0=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=B9=B6=E7=82=B9=E5=87=BB=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/panels/Properties.tsx | 35 ++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/panels/Properties.tsx b/src/renderer/src/panels/Properties.tsx index 348e181..30708b0 100644 --- a/src/renderer/src/panels/Properties.tsx +++ b/src/renderer/src/panels/Properties.tsx @@ -511,6 +511,8 @@ function FieldControl({ }) { const raw = node.values[field.key] ?? field.defaultValue; const [picking, setPicking] = useState(false); + const [windowList, setWindowList] = useState<{ title: string; process?: string }[]>([]); + const [windowPickerField, setWindowPickerField] = useState(null); const isGroundTarget = node.componentId.endsWith("Ground"); const isVisionSource = /^(OcrOffline_|CV_|Image_)/.test(node.componentId); const isWindowTarget = /^(Window_|System_ConnectRemoteDesktop)/.test(node.componentId); @@ -636,16 +638,8 @@ function FieldControl({ onToast("未找到可见窗口", "error"); return; } - for (let wi = 0; wi < list.length; wi++) { - const w = list[wi] as { title: string; process?: string }; - const ok = confirm(`窗口 ${wi + 1}/${list.length}:${w.title}(${w.process ?? "未知"})\n\n确定选这个窗口?取消看下一个`); - if (ok) { - onChange(field.key, w.title); - onToast("已选择窗口:" + w.title); - return; - } - } - onToast("未选择窗口"); + setWindowList(list as { title: string; process?: string }[]); + setWindowPickerField(field.key); } catch (error) { onToast(error instanceof Error ? error.message : String(error), "error"); @@ -704,6 +698,7 @@ function FieldControl({ const hint = field.description || fallbackHint; return ( + <>
+ + {windowPickerField && ( +
setWindowPickerField(null)}> +
e.stopPropagation()}> +
选择窗口
+ {windowList.map((w, i) => ( + + ))} +
+
+ )} + ); }