From 346e2ad3424a28c6a93dfdab87001d1b5c32ff3b Mon Sep 17 00:00:00 2001 From: yu <1919727607@qq.com> Date: Tue, 3 Nov 2026 13:46:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E4=BE=BF=E8=BE=93=E5=85=A5=E7=9A=84displayType?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6(mouseRecord/clickPosition=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E6=8B=BE=E5=8F=96=E3=80=81excelRange=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E3=80=81USB=E4=B8=B2=E5=8F=A3=E4=B8=8B=E6=8B=89=E3=80=81?= =?UTF-8?q?=E9=94=AE=E9=BC=A0=E9=A9=B1=E5=8A=A8=E4=B8=8B=E6=8B=89=E3=80=81?= =?UTF-8?q?=E9=82=AE=E7=AE=B1email=E8=BE=93=E5=85=A5=E3=80=81previewDataTa?= =?UTF-8?q?ble=E5=8F=AA=E8=AF=BB=E3=80=81customModal/itemGroup=20JSON=20te?= =?UTF-8?q?xtarea);=20pickPointToField=E5=87=BD=E6=95=B0;=20flowValidation?= =?UTF-8?q?=20match=5Ftype=E4=BC=98=E5=85=88=E7=BA=A7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/panels/Properties.tsx | 113 +++++++++++++++++- src/renderer/src/validation/flowValidation.ts | 12 +- .../src/validation/window-fields.test.ts | 63 ++++++++++ 3 files changed, 182 insertions(+), 6 deletions(-) create mode 100644 src/renderer/src/validation/window-fields.test.ts diff --git a/src/renderer/src/panels/Properties.tsx b/src/renderer/src/panels/Properties.tsx index 7482ed3..162e0c7 100644 --- a/src/renderer/src/panels/Properties.tsx +++ b/src/renderer/src/panels/Properties.tsx @@ -655,6 +655,21 @@ function FieldControl({ }; + const pickPointToField = async () => { + setPicking(true); + try { + const region = await window.rpa.desktop.pickRegion(); + const cx = region.x + Math.floor(region.width / 2); + const cy = region.y + Math.floor(region.height / 2); + onChange(field.key, JSON.stringify({ x: cx, y: cy })); + onToast("已拾取坐标:" + cx + " , " + cy); + } catch (error) { + onToast(error instanceof Error ? error.message : String(error), "error"); + } finally { + setPicking(false); + } + }; + if (field.widget === "boolean") { return (