新增quickcommand.showLoadingBar,支持显示加载条

This commit is contained in:
fofolee
2025-02-17 22:38:19 +08:00
parent d7508c36a7
commit 3eca3b448e
14 changed files with 339 additions and 84 deletions

View File

@@ -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>