diff --git a/src/components/composer/FlowTabs.vue b/src/components/composer/FlowTabs.vue index f7e18e0..e0a7692 100644 --- a/src/components/composer/FlowTabs.vue +++ b/src/components/composer/FlowTabs.vue @@ -154,16 +154,18 @@ export default defineComponent({ if (cmd.outputVariable && cmd.asyncMode !== "then") { const { name, details = {} } = cmd.outputVariable; variables.push( - ...[name, ...Object.values(details)].map((variable) => ({ - name: variable, - // 提供来源命令的标志信息 - sourceCommand: { - label: cmd.label, - id: cmd.id, - index, - }, - type: "output", - })) + ...[name, ...Object.values(details)] + .filter((v) => v) + .map((variable) => ({ + name: variable, + // 提供来源命令的标志信息 + sourceCommand: { + label: cmd.label, + id: cmd.id, + index, + }, + type: "output", + })) ); } } @@ -274,10 +276,7 @@ export default defineComponent({ (v) => v.type === "var" ); // 完全更新参数 - this.subFlows[index].customVariables = [ - ...newParams, - ...localVars, - ]; + this.subFlows[index].customVariables = [...newParams, ...localVars]; }, generateFlowCode(flow) { return generateCode(flow); diff --git a/src/components/composer/card/CommandButtons.vue b/src/components/composer/card/CommandButtons.vue index eadb4a1..467b6f8 100644 --- a/src/components/composer/card/CommandButtons.vue +++ b/src/components/composer/card/CommandButtons.vue @@ -19,7 +19,20 @@
输出配置
- 配置输出变量、是否等待执行完毕等 +
+ 本命令配置输出变量数 + + {{ outputLength }} + +
+
+ {{ isThenCommand ? "不用" : "需要" }}等待命令运行完毕 + + + +
@@ -139,6 +152,17 @@ export default { showOutputEditor: false, }; }, + computed: { + isThenCommand() { + return this.command.asyncMode === "then"; + }, + outputLength() { + return ( + Object.keys(this.command.outputVariable?.details || {}).length + + (this.command.outputVariable?.name ? 1 : 0) + ); + }, + }, emits: [ "update:outputVariable", "run", @@ -225,4 +249,14 @@ export default { min-width: 24px; padding: 0 4px; } + +.output-badge { + font-size: 10px; + width: 13px; + height: 13px; + display: flex; + align-items: center; + justify-content: center; + margin-left: 3px; +}