fix: [bpm] simple 设计器导入问题修复

master-bpm-bug-fix
jason 2026-06-20 23:38:05 +08:00
parent 4aba1f9ddb
commit 950850529d
2 changed files with 16 additions and 2 deletions

View File

@ -36,7 +36,11 @@
@mouseleave="stopDrag" @mouseleave="stopDrag"
@mouseenter="setGrabCursor" @mouseenter="setGrabCursor"
> >
<ProcessNodeTree v-if="processNodeTree" v-model:flow-node="processNodeTree" /> <ProcessNodeTree
v-if="processNodeTree"
:key="importKey"
v-model:flow-node="processNodeTree"
/>
</div> </div>
</div> </div>
<Dialog v-model="errorDialogVisible" title="保存失败" width="400" :fullscreen="false"> <Dialog v-model="errorDialogVisible" title="保存失败" width="400" :fullscreen="false">
@ -222,16 +226,26 @@ const exportJson = () => {
/** 导入 JSON */ /** 导入 JSON */
const refFile = ref() const refFile = ref()
/** 导入后自增,作为 ProcessNodeTree 的 key强制重新挂载以保证画布刷新 */
const importKey = ref(0)
const importJson = () => { const importJson = () => {
refFile.value.click() refFile.value.click()
} }
const importLocalFile = () => { const importLocalFile = () => {
const file = refFile.value.files[0] const file = refFile.value.files[0]
// input value change
refFile.value.value = ''
if (!file) {
return
}
const reader = new FileReader() const reader = new FileReader()
reader.readAsText(file) reader.readAsText(file)
reader.onload = function () { reader.onload = function () {
if (isString(this.result)) { if (isString(this.result)) {
processNodeTree.value = JSON.parse(this.result) processNodeTree.value = JSON.parse(this.result)
// key ProcessNodeTree
// watch(() => props.flowNode)
importKey.value++
emits('save', processNodeTree.value) emits('save', processNodeTree.value)
} }
} }

View File

@ -817,7 +817,7 @@ const initNextAssigneesFormField = async () => {
CandidateStrategy.START_USER_SELECT === node.candidateStrategy) || CandidateStrategy.START_USER_SELECT === node.candidateStrategy) ||
// //
(isEmpty(node.candidateUsers) && (isEmpty(node.candidateUsers) &&
CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy) CandidateStrategy.APPROVE_USER_SELECT === node.candidateStrategy)
) { ) {
nextAssigneesActivityNode.value.push(node) nextAssigneesActivityNode.value.push(node)
} }