调整部分NumberInput组件为VariableInput组件

This commit is contained in:
fofolee 2025-02-17 12:14:28 +08:00
parent 174d3ed7e7
commit daef39b02a
10 changed files with 181 additions and 154 deletions

View File

@ -135,12 +135,11 @@ export const browserCommands = {
config: [ config: [
{ {
label: "浏览器实例端口", label: "浏览器实例端口",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "label", icon: "label",
width: 12, width: 12,
min: 9222,
max: 9322,
step: 1,
placeholder: "留空关闭当前操控的实例", placeholder: "留空关闭当前操控的实例",
}, },
], ],
@ -176,13 +175,11 @@ export const browserCommands = {
config: [ config: [
{ {
label: "浏览器实例端口", label: "浏览器实例端口",
component: "NumberInput", component: "VariableInput",
icon: "label", icon: "label",
width: 12, width: 12,
defaultValue: 9222, defaultValue: newVarInputVal("var"),
min: 9222, disableToggleType: true,
max: 9322,
step: 1,
}, },
], ],
}, },
@ -701,17 +698,19 @@ export const browserCommands = {
config: [ config: [
{ {
label: "X坐标", label: "X坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_right", icon: "arrow_right",
width: 12, width: 12,
defaultValue: 0, defaultValue: newVarInputVal("var", "0"),
disableToggleType: true,
}, },
{ {
label: "Y坐标", label: "Y坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_drop_down", icon: "arrow_drop_down",
width: 12, width: 12,
defaultValue: 0, defaultValue: newVarInputVal("var", "0"),
disableToggleType: true,
}, },
], ],
}, },

View File

@ -71,18 +71,18 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 6, width: 6,
}, },
{ {
label: "结束位置", label: "结束位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page", icon: "last_page",
min: 0,
step: 1,
width: 6, width: 6,
}, },
], ],
@ -169,9 +169,9 @@ export const dataCommands = {
}, },
{ {
label: "目标长度", label: "目标长度",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
icon: "straighten", icon: "straighten",
width: 4, width: 4,
}, },
@ -264,9 +264,9 @@ export const dataCommands = {
}, },
{ {
label: "重复次数", label: "重复次数",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
icon: "repeat", icon: "repeat",
width: 4, width: 4,
defaultValue: 1, defaultValue: 1,
@ -357,9 +357,9 @@ export const dataCommands = {
}, },
{ {
label: "每行字符数", label: "每行字符数",
component: "NumberInput", component: "VariableInput",
min: 1, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
icon: "straighten", icon: "straighten",
width: 4, width: 4,
defaultValue: 80, defaultValue: 80,
@ -397,9 +397,9 @@ export const dataCommands = {
}, },
{ {
label: "总宽度", label: "总宽度",
component: "NumberInput", component: "VariableInput",
min: 1, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
icon: "straighten", icon: "straighten",
width: 6, width: 6,
defaultValue: 80, defaultValue: 80,
@ -487,16 +487,18 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
step: 1, disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
{ {
label: "结束位置", label: "结束位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page", icon: "last_page",
step: 1,
width: 4, width: 4,
}, },
], ],
@ -520,13 +522,17 @@ export const dataCommands = {
}, },
{ {
label: "偏移量", label: "偏移量",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
{ {
label: "长度", label: "长度",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten", icon: "straighten",
width: 4, width: 4,
}, },
@ -568,13 +574,17 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
{ {
label: "结束位置", label: "结束位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page", icon: "last_page",
width: 4, width: 4,
}, },
@ -616,19 +626,25 @@ export const dataCommands = {
}, },
{ {
label: "目标起始位置", label: "目标起始位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
{ {
label: "源起始位置", label: "源起始位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
{ {
label: "源结束位置", label: "源结束位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page", icon: "last_page",
width: 4, width: 4,
}, },
@ -669,7 +685,9 @@ export const dataCommands = {
}, },
{ {
label: "总长度(可选)", label: "总长度(可选)",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten", icon: "straighten",
width: 12, width: 12,
}, },
@ -688,13 +706,17 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 6, width: 6,
}, },
{ {
label: "结束位置", label: "结束位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page", icon: "last_page",
width: 6, width: 6,
}, },
@ -719,7 +741,9 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page", icon: "first_page",
width: 4, width: 4,
}, },
@ -1062,19 +1086,19 @@ export const dataCommands = {
}, },
{ {
label: "起始位置", label: "起始位置",
component: "NumberInput", component: "VariableInput",
icon: "first_page", icon: "first_page",
min: 0, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
width: 6, width: 6,
placeholder: "1", placeholder: "1",
}, },
{ {
label: "结束位置", label: "结束位置",
component: "NumberInput", component: "VariableInput",
icon: "last_page", icon: "last_page",
min: 0, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
width: 6, width: 6,
placeholder: "3", placeholder: "3",
}, },
@ -1094,11 +1118,10 @@ export const dataCommands = {
}, },
{ {
label: "扁平化深度", label: "扁平化深度",
component: "NumberInput", component: "VariableInput",
icon: "format_indent_decrease", icon: "format_indent_decrease",
min: 1, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
defaultValue: 1,
width: 4, width: 4,
}, },
], ],
@ -1201,11 +1224,10 @@ export const dataCommands = {
}, },
{ {
label: "块大小", label: "块大小",
component: "NumberInput", component: "VariableInput",
icon: "straighten", icon: "straighten",
min: 1, disableToggleType: true,
step: 1, defaultValue: newVarInputVal("var"),
defaultValue: 2,
width: 4, width: 4,
}, },
], ],
@ -1344,10 +1366,11 @@ export const dataCommands = {
}, },
{ {
label: "数值", label: "数值",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var", "1"),
icon: "exposure", icon: "exposure",
width: 6, width: 6,
defaultValue: 1,
}, },
{ {
label: "单位", label: "单位",

View File

@ -140,19 +140,19 @@ export const imageCommands = {
}, },
{ {
label: "宽度(像素)", label: "宽度(像素)",
component: "NumberInput", component: "VariableInput",
icon: "compare_arrows", icon: "compare_arrows",
width: 6, width: 6,
min: 1, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var", "100"),
}, },
{ {
label: "高度(像素)", label: "高度(像素)",
component: "NumberInput", component: "VariableInput",
icon: "height", icon: "height",
width: 6, width: 6,
min: 1, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var", "100"),
}, },
{ {
label: "保持宽高比", label: "保持宽高比",
@ -293,39 +293,35 @@ export const imageCommands = {
}, },
{ {
label: "起始X坐标", label: "起始X坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_right", icon: "arrow_right",
width: 6, width: 6,
min: 0, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var", "0"),
defaultValue: 0,
}, },
{ {
label: "起始Y坐标", label: "起始Y坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_downward", icon: "arrow_downward",
width: 6, width: 6,
min: 0, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var", "0"),
defaultValue: 0,
}, },
{ {
label: "裁剪宽度", label: "裁剪宽度",
component: "NumberInput", component: "VariableInput",
icon: "compare_arrows", icon: "compare_arrows",
width: 6, width: 6,
min: 1, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var"),
defaultValue: "",
}, },
{ {
label: "裁剪高度", label: "裁剪高度",
component: "NumberInput", component: "VariableInput",
icon: "height", icon: "height",
width: 6, width: 6,
min: 1, disableToggleType: true,
step: 10, defaultValue: newVarInputVal("var"),
defaultValue: "",
}, },
{ {
label: "图片质量(0-1)", label: "图片质量(0-1)",

View File

@ -1,3 +1,5 @@
import { newVarInputVal } from "js/composer/varInputValManager";
const windowOutputStructure = { const windowOutputStructure = {
name: { label: "应用名称", suggestName: "appName" }, name: { label: "应用名称", suggestName: "appName" },
displayedName: { displayedName: {
@ -432,10 +434,10 @@ export const macosCommands = {
config: [ config: [
{ {
label: "窗口索引", label: "窗口索引",
component: "NumberInput", component: "VariableInput",
icon: "window", icon: "window",
min: 1, disableToggleType: true,
defaultValue: 1, defaultValue: newVarInputVal("var", "1"),
width: 12, width: 12,
}, },
], ],

View File

@ -201,10 +201,11 @@ export const mathCommands = {
config: [ config: [
{ {
label: "半径", label: "半径",
component: "NumberInput", component: "VariableInput",
icon: "radio_button_checked", icon: "radio_button_checked",
width: 12, width: 12,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
], ],
}, },
@ -215,17 +216,19 @@ export const mathCommands = {
config: [ config: [
{ {
label: "宽度", label: "宽度",
component: "NumberInput", component: "VariableInput",
icon: "swap_horiz", icon: "swap_horiz",
width: 6, width: 6,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
{ {
label: "高度", label: "高度",
component: "NumberInput", component: "VariableInput",
icon: "height", icon: "height",
width: 6, width: 6,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
], ],
}, },
@ -236,24 +239,27 @@ export const mathCommands = {
config: [ config: [
{ {
label: "边长a", label: "边长a",
component: "NumberInput", component: "VariableInput",
icon: "straighten", icon: "straighten",
width: 4, width: 4,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
{ {
label: "边长b", label: "边长b",
component: "NumberInput", component: "VariableInput",
icon: "straighten", icon: "straighten",
width: 4, width: 4,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
{ {
label: "边长c", label: "边长c",
component: "NumberInput", component: "VariableInput",
icon: "straighten", icon: "straighten",
width: 4, width: 4,
min: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
], ],
}, },
@ -266,9 +272,11 @@ export const mathCommands = {
config: [ config: [
{ {
label: "角度值", label: "角度值",
component: "NumberInput", component: "VariableInput",
icon: "rotate_right", icon: "rotate_right",
width: 12, width: 12,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
], ],
subCommands: [ subCommands: [

View File

@ -152,18 +152,16 @@ export const simulateCommands = {
x: { x: {
label: "X坐标", label: "X坐标",
icon: "drag_handle", icon: "drag_handle",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 10,
width: 6, width: 6,
placeholder: "XY任意留空原地点击", placeholder: "XY任意留空原地点击",
}, },
y: { y: {
label: "Y坐标", label: "Y坐标",
icon: "drag_handle", icon: "drag_handle",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 10,
width: 6, width: 6,
placeholder: "XY任意留空原地点击", placeholder: "XY任意留空原地点击",
}, },
@ -185,6 +183,8 @@ export const simulateCommands = {
}, },
defaultValue: { defaultValue: {
count: 1, count: 1,
x: newVarInputVal("var"),
y: newVarInputVal("var"),
}, },
}, },
], ],
@ -201,19 +201,17 @@ export const simulateCommands = {
{ {
label: "X坐标", label: "X坐标",
icon: "drag_handle", icon: "drag_handle",
defaultValue: 0, defaultValue: newVarInputVal("var", "0"),
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 10,
width: 6, width: 6,
}, },
{ {
label: "Y坐标", label: "Y坐标",
icon: "drag_handle", icon: "drag_handle",
defaultValue: 0, defaultValue: newVarInputVal("var", "0"),
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 10,
width: 6, width: 6,
}, },
], ],

View File

@ -549,9 +549,8 @@ export const systemCommands = {
config: [ config: [
{ {
label: "进程ID", label: "进程ID",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 100,
icon: "developer_board", icon: "developer_board",
width: 7, width: 7,
}, },

View File

@ -444,21 +444,17 @@ export const uiCommands = {
label: "标题", label: "标题",
component: "VariableInput", component: "VariableInput",
width: 6, width: 6,
defaultValue: newVarInputVal("str", "进度"),
}, },
text: { text: {
label: "文本", label: "文本",
component: "VariableInput", component: "VariableInput",
width: 6, width: 6,
defaultValue: newVarInputVal("str", "处理中..."),
}, },
value: { value: {
label: "初始进度值", label: "初始进度值",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
width: 3, width: 3,
min: 0,
max: 100,
defaultValue: 0,
}, },
position: { position: {
label: "位置", label: "位置",
@ -470,7 +466,6 @@ export const uiCommands = {
{ label: "屏幕左下角", value: "bottom-left" }, { label: "屏幕左下角", value: "bottom-left" },
{ label: "屏幕右下角", value: "bottom-right" }, { label: "屏幕右下角", value: "bottom-right" },
], ],
defaultValue: "bottom-right",
}, },
onClose: { onClose: {
label: "关闭按钮回调函数", label: "关闭按钮回调函数",
@ -496,7 +491,7 @@ export const uiCommands = {
defaultValue: { defaultValue: {
title: newVarInputVal("str", "进度"), title: newVarInputVal("str", "进度"),
text: newVarInputVal("str", "处理中..."), text: newVarInputVal("str", "处理中..."),
value: 0, value: newVarInputVal("var", "0"),
position: "bottom-right", position: "bottom-right",
onClose: newVarInputVal("var"), onClose: newVarInputVal("var"),
onPause: newVarInputVal("var"), onPause: newVarInputVal("var"),
@ -515,11 +510,9 @@ export const uiCommands = {
options: { options: {
value: { value: {
label: "进度值", label: "进度值",
component: "NumberInput", component: "VariableInput",
width: 4, width: 4,
min: 0, disableToggleType: true,
max: 100,
defaultValue: 0,
}, },
text: { text: {
label: "文本", label: "文本",
@ -534,7 +527,7 @@ export const uiCommands = {
}, },
}, },
defaultValue: { defaultValue: {
value: 0, value: newVarInputVal("var", "0"),
text: newVarInputVal("str"), text: newVarInputVal("str"),
complete: false, complete: false,
}, },

View File

@ -1,3 +1,5 @@
import { newVarInputVal } from "js/composer/varInputValManager";
export const utoolsCommands = { export const utoolsCommands = {
label: "uTools功能", label: "uTools功能",
icon: "insights", icon: "insights",
@ -49,9 +51,9 @@ export const utoolsCommands = {
config: [ config: [
{ {
label: "高度", label: "高度",
component: "NumberInput", component: "VariableInput",
min: 0, disableToggleType: true,
step: 100, defaultValue: newVarInputVal("var", "100"),
icon: "straighten", icon: "straighten",
width: 12, width: 12,
}, },

View File

@ -293,19 +293,27 @@ export const windowsCommands = {
options: { options: {
x: { x: {
label: "X坐标", label: "X坐标",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
icon: "arrow_right", icon: "arrow_right",
placeholder: "留空使用当前鼠标位置", placeholder: "留空使用当前鼠标位置",
width: 6, width: 6,
disableToggleType: true,
}, },
y: { y: {
label: "Y坐标", label: "Y坐标",
component: "NumberInput", component: "VariableInput",
disableToggleType: true,
icon: "arrow_drop_down", icon: "arrow_drop_down",
placeholder: "留空使用当前鼠标位置", placeholder: "留空使用当前鼠标位置",
width: 6, width: 6,
disableToggleType: true,
}, },
}, },
defaultValue: {
x: newVarInputVal("var"),
y: newVarInputVal("var"),
},
}, },
], ],
outputs: { outputs: {
@ -352,12 +360,11 @@ export const windowsCommands = {
config: [ config: [
{ {
label: "透明度", label: "透明度",
component: "NumberInput", component: "VariableInput",
icon: "opacity", icon: "opacity",
width: 12, width: 12,
min: 0, disableToggleType: true,
max: 100, defaultValue: newVarInputVal("var", "80"),
defaultValue: 80,
}, },
], ],
}, },
@ -368,33 +375,35 @@ export const windowsCommands = {
config: [ config: [
{ {
label: "X坐标", label: "X坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_right", icon: "arrow_right",
width: 6, width: 6,
defaultValue: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
{ {
label: "Y坐标", label: "Y坐标",
component: "NumberInput", component: "VariableInput",
icon: "arrow_drop_down", icon: "arrow_drop_down",
width: 6, width: 6,
defaultValue: 0, disableToggleType: true,
defaultValue: newVarInputVal("var"),
}, },
{ {
label: "宽度", label: "宽度",
component: "NumberInput", component: "VariableInput",
icon: "swap_horiz", icon: "swap_horiz",
width: 6, width: 6,
min: 0, disableToggleType: true,
defaultValue: 800, defaultValue: newVarInputVal("var", "800"),
}, },
{ {
label: "高度", label: "高度",
component: "NumberInput", component: "VariableInput",
icon: "height", icon: "height",
width: 6, width: 6,
min: 0, disableToggleType: true,
defaultValue: 600, defaultValue: newVarInputVal("var", "600"),
}, },
], ],
}, },
@ -629,17 +638,15 @@ export const windowsCommands = {
}, },
amount: { amount: {
label: "位置", label: "位置",
component: "NumberInput", component: "VariableInput",
icon: "straighten", icon: "straighten",
width: 6, width: 6,
min: 0, disableToggleType: true,
max: 100,
step: 10,
}, },
}, },
defaultValue: { defaultValue: {
direction: "vertical", direction: "vertical",
amount: 0, amount: newVarInputVal("var"),
}, },
}, },
], ],