mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-10-10 07:23:23 +08:00
新增quickcommand.showSystemWaitButton接口,编排用户交互分类同步添加相应功能
This commit is contained in:
@@ -331,6 +331,44 @@ export const uiCommands = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcommand.showSystemWaitButton",
|
||||
label: "等待操作按钮",
|
||||
isAsync: true,
|
||||
config: [
|
||||
{
|
||||
component: "OptionEditor",
|
||||
options: {
|
||||
text: {
|
||||
label: "按钮文本",
|
||||
component: "VariableInput",
|
||||
width: 6,
|
||||
},
|
||||
position: {
|
||||
label: "按钮位置",
|
||||
component: "QSelect",
|
||||
width: 3,
|
||||
options: [
|
||||
{ label: "屏幕左上角", value: "top-left" },
|
||||
{ label: "屏幕右上角", value: "top-right" },
|
||||
{ label: "屏幕左下角", value: "bottom-left" },
|
||||
{ label: "屏幕右下角", value: "bottom-right" },
|
||||
],
|
||||
},
|
||||
showCancel: {
|
||||
label: "显示取消按钮",
|
||||
component: "CheckButton",
|
||||
width: 3,
|
||||
},
|
||||
},
|
||||
defaultValue: {
|
||||
text: newVarInputVal("str", "点击继续"),
|
||||
position: "bottom-right",
|
||||
showCancel: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "utools.showOpenDialog",
|
||||
label: "文件选择框",
|
||||
|
21
src/plugins/monaco/types/quickcommand.api.d.ts
vendored
21
src/plugins/monaco/types/quickcommand.api.d.ts
vendored
@@ -628,6 +628,27 @@ interface quickcommandApi {
|
||||
}
|
||||
): Promise<{ id: number; text: string | object }>;
|
||||
|
||||
/**
|
||||
* 显示一个系统级等待按钮
|
||||
* @param options 配置选项
|
||||
* @param options.text 按钮文本
|
||||
* @param options.position 按钮位置,可选值:top-left, top-right, bottom-left, bottom-right
|
||||
* @param options.showCancel 是否显示取消按钮,默认 true
|
||||
*
|
||||
* ```js
|
||||
* const result = await quickcommand.showSystemWaitButton({
|
||||
* text: "等待操作",
|
||||
* position: "bottom-right",
|
||||
* })
|
||||
* console.log(result) // true 或 false
|
||||
* ```
|
||||
*/
|
||||
showSystemWaitButton(options?: {
|
||||
text?: string;
|
||||
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
||||
showCancel?: boolean;
|
||||
}): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* 运行代码
|
||||
* @param code 代码
|
||||
|
Reference in New Issue
Block a user