From 5691a8e48ec57907a7f1eae4c75e0c226b483c03 Mon Sep 17 00:00:00 2001 From: fofolee Date: Sat, 11 Jan 2025 14:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0quickcommandUI=E5=9C=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=E5=92=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 + src/components/CommandRunResult.vue | 3 +++ .../quickcommandUI/QuickCommand.vue | 21 +++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/App.vue b/src/App.vue index e02457b..61ffc65 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,6 +24,7 @@ export default defineComponent({ return { setCssVar: setCssVar, programs: programmings, + isRunningCommand: false, profile: defaultProfile.common, nativeProfile: defaultProfile.native, utools: UTOOLS, diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 3742df4..699244a 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -126,6 +126,7 @@ export default { methods: { // 运行命令 async runCurrentCommand(currentCommand) { + this.$root.isRunningCommand = true; await this.getTempPayload(currentCommand); if (currentCommand.cmd.includes("{{subinput")) return this.setSubInput(currentCommand); @@ -284,6 +285,7 @@ export default { }; }, handleResult(stdout, stderr, options) { + this.$root.isRunningCommand = false; if (stderr) { return options.earlyExit ? alert(stderr) @@ -293,6 +295,7 @@ export default { }, // 显示运行结果 async showRunResult(content, isSuccess) { + this.$root.isRunningCommand = false; content = await this.handleContent(content); this.runResultStatus = isSuccess; this.runResult = this.runResult.concat(content); diff --git a/src/components/quickcommandUI/QuickCommand.vue b/src/components/quickcommandUI/QuickCommand.vue index 1f87b03..e505778 100644 --- a/src/components/quickcommandUI/QuickCommand.vue +++ b/src/components/quickcommandUI/QuickCommand.vue @@ -4,6 +4,7 @@ :maximized="maximized" :transition-show="maximized ? 'fade' : 'scale'" :transition-hide="maximized ? 'fade' : 'scale'" + @hide="hideDialog" > { + switch (uiComponent) { + case InputBox: + reslove([]); + break; + case ButtonBox: + case SelectList: + reslove({}); + break; + case ConfirmBox: + reslove(false); + break; + case TextArea: + reslove(""); + break; + default: + reslove(false); + } + }; }, }, };