refactor: 屏幕截图冗余区域字段收敛(action/position_img 并入截图区域), 仅框选区域模式显示
This commit is contained in:
parent
9e9617256d
commit
b4bcee8c15
@ -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": []
|
||||
},
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -29,6 +29,8 @@ export function fieldIsActive(componentId: string, key: string, values: Record<s
|
||||
}
|
||||
}
|
||||
if (componentId === "System_ScreenSaverShowV1" && key === "password") return truthy(values.set_password);
|
||||
// Image_Screenshot: 区域坐标仅截图范围为「框选区域」时显示
|
||||
if (componentId === "Image_Screenshot" && key === "position") return String(values.shotRange ?? "1") === "2";
|
||||
// Window_*_v1 series: conditional fields based on get_type mode
|
||||
if (/^Window_.*_v1$/.test(componentId) || componentId === "Window_WindowExists" || componentId === "Window_WaitWindow") {
|
||||
const gt = String(values.get_type ?? "");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user