From 15476a9358f31204da72e8f9cee4424a434d8cb0 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 27 Jan 2025 17:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E6=8E=92=E7=94=A8=E6=88=B7=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E5=88=86=E7=B1=BB=E6=96=B0=E5=A2=9E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=E5=92=8C=E6=9B=B4=E6=96=B0=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/composer/commands/uiCommands.js | 123 +++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/src/js/composer/commands/uiCommands.js b/src/js/composer/commands/uiCommands.js index 6ddd0f8..69a3310 100644 --- a/src/js/composer/commands/uiCommands.js +++ b/src/js/composer/commands/uiCommands.js @@ -426,6 +426,129 @@ export const uiCommands = { }, ], }, + { + value: "quickcommand.showProcessBar", + label: "显示进度条", + description: + "显示一个带有暂停、恢复、关闭回调功能的进度条,支持动态更新进度,注意,即使设置等待运行完毕,显示进度条的过程中也不会阻塞后续运行,请通过关闭回调来处理关闭事件。", + asyncMode: "await", + outputs: { + label: "进度条对象", + suggestName: "processBar", + }, + config: [ + { + component: "OptionEditor", + options: { + title: { + label: "标题", + component: "VariableInput", + width: 6, + defaultValue: newVarInputVal("str", "进度"), + }, + text: { + label: "文本", + component: "VariableInput", + width: 6, + defaultValue: newVarInputVal("str", "处理中..."), + }, + value: { + label: "初始进度值", + component: "NumberInput", + width: 3, + min: 0, + max: 100, + defaultValue: 0, + }, + position: { + label: "位置", + component: "QSelect", + width: 3, + options: [ + { label: "屏幕左上角", value: "top-left" }, + { label: "屏幕右上角", value: "top-right" }, + { label: "屏幕左下角", value: "bottom-left" }, + { label: "屏幕右下角", value: "bottom-right" }, + ], + defaultValue: "bottom-right", + }, + onClose: { + label: "关闭按钮回调函数", + component: "VariableInput", + disableToggleType: true, + width: 6, + }, + onPause: { + label: "暂停按钮回调函数", + component: "VariableInput", + disableToggleType: true, + width: 6, + placeholder: "必须和恢复回调一起配置", + }, + onResume: { + label: "恢复按钮回调函数", + component: "VariableInput", + disableToggleType: true, + width: 6, + placeholder: "必须和暂停回调一起配置", + }, + }, + defaultValue: { + title: newVarInputVal("str", "进度"), + text: newVarInputVal("str", "处理中..."), + value: 0, + position: "bottom-right", + onClose: newVarInputVal("var"), + onPause: newVarInputVal("var"), + onResume: newVarInputVal("var"), + }, + }, + ], + }, + { + value: "quickcommand.updateProcessBar", + label: "更新进度条", + neverHasOutput: true, + config: [ + { + component: "OptionEditor", + options: { + value: { + label: "进度值", + component: "NumberInput", + width: 4, + min: 0, + max: 100, + defaultValue: 0, + }, + text: { + label: "文本", + component: "VariableInput", + width: 4, + }, + complete: { + label: "完成并关闭", + component: "CheckButton", + width: 4, + defaultValue: false, + }, + }, + defaultValue: { + value: 0, + text: newVarInputVal("str"), + complete: false, + }, + }, + { + label: "进度条对象", + component: "VariableInput", + width: 12, + placeholder: "不传则更新最近的进度条", + defaultValue: newVarInputVal("var"), + disableToggleType: true, + }, + ], + }, { value: "utools.showOpenDialog", label: "文件选择框",