From 950850529d43b8cde2906cea4726f29f2c108b17 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Sat, 20 Jun 2026 23:38:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20[bpm]=20simple=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=AF=BC=E5=85=A5=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/SimpleProcessModel.vue | 16 +++++++++++++++- .../detail/ProcessInstanceOperationButton.vue | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue b/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue index 8e2c5e39b..f1585aa06 100644 --- a/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue +++ b/src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue @@ -36,7 +36,11 @@ @mouseleave="stopDrag" @mouseenter="setGrabCursor" > - + @@ -222,16 +226,26 @@ const exportJson = () => { /** 导入 JSON */ const refFile = ref() +/** 导入后自增,作为 ProcessNodeTree 的 key,强制重新挂载以保证画布刷新 */ +const importKey = ref(0) const importJson = () => { refFile.value.click() } const importLocalFile = () => { const file = refFile.value.files[0] + // 清空 input 的 value,否则再次选择同一个文件时 change 事件不会触发 + refFile.value.value = '' + if (!file) { + return + } const reader = new FileReader() reader.readAsText(file) reader.onload = function () { if (isString(this.result)) { processNodeTree.value = JSON.parse(this.result) + // 改变 key,强制 ProcessNodeTree 重新挂载, + // 规避 watch(() => props.flowNode) 在组件复用场景下同步失效导致画布不刷新的问题 + importKey.value++ emits('save', processNodeTree.value) } } diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index ca28b22f6..707e4cd90 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -817,7 +817,7 @@ const initNextAssigneesFormField = async () => { CandidateStrategy.START_USER_SELECT === node.candidateStrategy) || // 情况二:当前节点是审批人自选 (isEmpty(node.candidateUsers) && - CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy) + CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy) ) { nextAssigneesActivityNode.value.push(node) }