From b4bcee8c153f8a10120468d8f990fce14b18145d Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Tue, 3 Nov 2026 14:13:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B1=8F=E5=B9=95=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E5=86=97=E4=BD=99=E5=8C=BA=E5=9F=9F=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=94=B6=E6=95=9B(action/position=5Fimg=20=E5=B9=B6=E5=85=A5?= =?UTF-8?q?=E6=88=AA=E5=9B=BE=E5=8C=BA=E5=9F=9F),=20=E4=BB=85=E6=A1=86?= =?UTF-8?q?=E9=80=89=E5=8C=BA=E5=9F=9F=E6=A8=A1=E5=BC=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/catalog.json | 30 ++----------------- src/main/capabilities/vision.ts | 4 +-- src/renderer/src/validation/flowValidation.ts | 2 ++ 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/resources/catalog.json b/resources/catalog.json index 6e2bb85..5177061 100644 --- a/resources/catalog.json +++ b/resources/catalog.json @@ -67146,42 +67146,16 @@ "rpa_str" ] }, - { - "key": "action", - "label": "action", - "widget": "region", - "type": "object", - "displayType": "getScreenShot", - "required": false, - "defaultValue": "", - "placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}", - "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成", - "advanced": false, - "valueTypes": [] - }, { "key": "position", - "label": "position", + "label": "截图区域", "widget": "region", "type": "object", "displayType": "screenShotValue", "required": false, "defaultValue": "", "placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}", - "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成", - "advanced": false, - "valueTypes": [] - }, - { - "key": "position_img", - "label": "position_img", - "widget": "region", - "type": "object", - "displayType": "screenShotValue", - "required": false, - "defaultValue": "", - "placeholder": "{\"x\":0,\"y\":0,\"width\":100,\"height\":50}", - "description": "区域坐标 JSON;点右侧「屏幕框选」在屏幕上框选生成", + "description": "截图范围为「框选区域」时生效:点右侧「屏幕框选」在屏幕上框选生成区域坐标", "advanced": false, "valueTypes": [] }, diff --git a/src/main/capabilities/vision.ts b/src/main/capabilities/vision.ts index dd53bf9..ad32bc7 100644 --- a/src/main/capabilities/vision.ts +++ b/src/main/capabilities/vision.ts @@ -212,8 +212,8 @@ register("Image_Screenshot", async (ctx, node, args) => { if (range === "2") { const regionRaw = text(args, ["position", "action", "position_img"]); if (!regionRaw.trim()) { - throw new RuntimeError("validation_error", "截图范围为「框选区域」时,position 需填写区域 JSON", { - recommendation: '在 position 填写 {"x":0,"y":0,"width":100,"height":80} 或 [x, y, width, height],或将截图范围改回「整个屏幕」' + throw new RuntimeError("validation_error", "截图范围为「框选区域」时,截图区域需填写区域 JSON", { + recommendation: '在「截图区域」点屏幕框选,或填写 {"x":0,"y":0,"width":100,"height":80},或将截图范围改回「整个屏幕」' }); } if (screenOrigin) { diff --git a/src/renderer/src/validation/flowValidation.ts b/src/renderer/src/validation/flowValidation.ts index 29bc6bb..26b9195 100644 --- a/src/renderer/src/validation/flowValidation.ts +++ b/src/renderer/src/validation/flowValidation.ts @@ -29,6 +29,8 @@ export function fieldIsActive(componentId: string, key: string, values: Record