diff --git a/src/components/composer/ComposerCard.vue b/src/components/composer/ComposerCard.vue index a0a00c5..1d308cd 100644 --- a/src/components/composer/ComposerCard.vue +++ b/src/components/composer/ComposerCard.vue @@ -258,8 +258,11 @@ export default defineComponent({ } }, getAvailableOutputVariable() { - let outputVariable = this.localCommand.outputVariable || {}; - if (!outputVariable.name && !outputVariable.details) { + let outputVariable = { ...this.localCommand.outputVariable }; + if ( + window.lodashM.isEmpty(outputVariable.name) && + window.lodashM.isEmpty(outputVariable.details) + ) { outputVariable.name = `temp_${Date.now()}`; } return outputVariable; @@ -279,7 +282,10 @@ export default defineComponent({ handleAddPrint() { // 创建一个打印命令 const outputVariable = this.getAvailableOutputVariable(); - this.localCommand.outputVariable = outputVariable; + this.localCommand = { + ...this.localCommand, + outputVariable, + }; const consoleLogVars = this.getAvailableOutputVariableName(outputVariable); diff --git a/src/components/composer/FlowTabs.vue b/src/components/composer/FlowTabs.vue index 4522143..24cfb64 100644 --- a/src/components/composer/FlowTabs.vue +++ b/src/components/composer/FlowTabs.vue @@ -147,12 +147,12 @@ export default defineComponent({ ]; const clearFlows = () => { - updateFlows(defaultFlow); + updateFlows(window.lodashM.cloneDeep(defaultFlow)); activeTab.value = "main"; }; if (!props.modelValue.flows || props.modelValue.flows.length === 0) { - updateFlows(defaultFlow); + updateFlows(window.lodashM.cloneDeep(defaultFlow)); } const flows = computed(() => props.modelValue.flows || []);