mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-10-10 07:23:23 +08:00
新增quickcommand.showLoadingBar,支持显示加载条
This commit is contained in:
@@ -126,7 +126,6 @@ export default {
|
||||
if (command.program === "quickcomposer") {
|
||||
command.cmd = generateFlowsCode(command.flows);
|
||||
}
|
||||
this.$root.isRunningCommand = true;
|
||||
this.needTempPayload && (await this.getTempPayload(command));
|
||||
// 如果命令包含子输入框,则设置子输入框
|
||||
if (command.cmd.includes("{{subinput")) return this.setSubInput(command);
|
||||
@@ -292,7 +291,6 @@ export default {
|
||||
};
|
||||
},
|
||||
handleResult(stdout, stderr, options) {
|
||||
this.$root.isRunningCommand = false;
|
||||
if (stderr) {
|
||||
return options.earlyExit
|
||||
? alert(stderr)
|
||||
@@ -302,7 +300,6 @@ export default {
|
||||
},
|
||||
// 显示运行结果
|
||||
async showRunResult(content, isSuccess) {
|
||||
this.$root.isRunningCommand = false;
|
||||
content = await this.handleContent(content);
|
||||
this.runResultStatus = isSuccess;
|
||||
this.runResult = this.runResult.concat(content);
|
||||
|
@@ -17,9 +17,6 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-inner-loading :showing="hasCommandNeedLoading && $root.isRunningCommand">
|
||||
<q-spinner-cube size="50px" color="primary" />
|
||||
</q-inner-loading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +35,6 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
availableCommands,
|
||||
hasCommandNeedLoading: false,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -57,16 +53,6 @@ export default defineComponent({
|
||||
// 直接转发事件和代码
|
||||
this.$emit("action", actionType, actionData);
|
||||
},
|
||||
findCommandNeedLoading(flow) {
|
||||
// 暂时只在运行单独命令时显示载入界面,因为运行整个命令流时,如果不打印输出,是无法判断什么时候运行结束的,
|
||||
// 运行单独命令时,添加了打印流程,且showLoading参数可控
|
||||
if (!flow) return;
|
||||
return flow.some(
|
||||
(cmd) =>
|
||||
cmd.showLoading ||
|
||||
cmd.subCommands?.find((c) => c.value === cmd.value)?.showLoading
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user