From bf1d6ff0070aeb4c38f4c7e8e735a2f53b1d7d3b Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 17 Feb 2025 00:05:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=87=BA=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=B8=B4=E6=97=B6=E5=8F=98=E9=87=8F=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=92=8C=E6=9C=AA=E6=AD=A3=E7=A1=AE=E6=8B=B7?= =?UTF-8?q?=E8=B4=9D=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/composer/ComposerCard.vue | 12 +++++++++--- src/components/composer/FlowTabs.vue | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) 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 || []);