From 3989741f96dfd929db976adf949933c3af0a4f10 Mon Sep 17 00:00:00 2001 From: dengbf Date: Tue, 9 Sep 2025 11:58:41 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E5=85=B3=E8=81=94]#[1505893206687744]?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=A4=8D=E5=88=B6if=E6=88=96loop=E5=B7=A5=E5=85=B7=EF=BC=8C?= =?UTF-8?q?=E9=87=8C=E9=9D=A2=E5=B5=8C=E5=A5=97=E7=9A=84=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=9A=84uuid=E6=B2=A1=E6=9C=89=E9=87=8D=E6=96=B0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/?= =?UTF-8?q?939050947543040/939050947543057/1505893206687744?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/script/script-list.vue | 48 +++++++++++++++---- .../detail/actionDetail/step/step-config.vue | 9 ++++ 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/src/views/pages/autoexec/components/script/script-list.vue b/src/views/pages/autoexec/components/script/script-list.vue index 05ad1c42..d025428a 100644 --- a/src/views/pages/autoexec/components/script/script-list.vue +++ b/src/views/pages/autoexec/components/script/script-list.vue @@ -187,17 +187,9 @@ export default { updated() {}, activated() {}, deactivated() {}, - beforeDestroy() { - this.clearObservable(); - }, + beforeDestroy() {}, destroyed() {}, methods: { - clearObservable() { - //清空状态管理的数据 - Object.keys(storeScript).forEach(key => { - storeScript[key] = null; - }); - }, changeDragStatus(type) { this.dragStatus = type; if (type == 'end') { @@ -241,10 +233,48 @@ export default { uuid: this.$utils.setUuid(), letter: prevlength.length ? this.$utils.translateNumber(parseInt(prevlength.length), 'en') : null }); + this.updateCopyUuid(newitem); this.list.push(newitem); this.updatedSort(); this.$forceUpdate(); }, + updateCopyUuid(item) { //更新复制的脚本的uuid + if (item.config) { + if (!this.$utils.isEmpty(item.config.ifList)) { + this.updatePhaseOperationUuidList(item.config.ifList); + } + if (!this.$utils.isEmpty(item.config.elseList)) { + this.updatePhaseOperationUuidList(item.config.elseList); + } + if (!this.$utils.isEmpty(item.config.operations)) { + this.updatePhaseOperationUuidList(item.config.operations); + } + } + }, + updatePhaseOperationUuidList(phaseOperationList) { + phaseOperationList.forEach(p => { + this.$delete(p, 'id'); + this.$set(p, 'uuid', this.$utils.setUuid()); + if (!this.$utils.isEmpty(p.config.paramMappingList)) { + p.config.paramMappingList.forEach(param => { + if (param.mappingMode == 'prenodeoutputparam' || param.mappingMode == 'prenodeoutputparamkey') { + this.$set(param, 'value', null); + } + }); + } + if (p.config) { + if (!this.$utils.isEmpty(p.config.ifList)) { + this.updatePhaseOperationUuidList(p.config.ifList); + } + if (!this.$utils.isEmpty(p.config.elseList)) { + this.updatePhaseOperationUuidList(p.config.elseList); + } + if (!this.$utils.isEmpty(p.config.operations)) { + this.updatePhaseOperationUuidList(p.config.operations); + } + } + }); + }, updateList(list) { this.list = list.map((v, vindex) => { return { diff --git a/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue b/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue index 87878ca5..fcfb42f2 100644 --- a/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue +++ b/src/views/pages/autoexec/detail/actionDetail/step/step-config.vue @@ -39,6 +39,7 @@