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) }