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