Skip to content

Commit 9f3bc1e

Browse files
committed
BPM:修复 bpmnxml 为空时,展示的 key 被覆盖的问题
1 parent 607c2b6 commit 9f3bc1e

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
<el-form label-width="90px" :model="needProps" :rules="rules">
44
<div v-if="needProps.type == 'bpmn:Process'">
55
<!-- 如果是 Process 信息的时候,使用自定义表单 -->
6-
<el-link
7-
href="https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B"
8-
type="danger"
9-
target="_blank"
10-
>
11-
如何实现实现会签、或签?
12-
</el-link>
136
<el-form-item label="流程标识" prop="id">
147
<el-input
158
v-model="needProps.id"
@@ -139,14 +132,6 @@ const updateBaseInfo = (key) => {
139132
}
140133
}
141134
142-
onMounted(() => {
143-
// 针对上传的 bpmn 流程图时,需要延迟 1 毫秒的时间,保证 key 和 name 的更新
144-
setTimeout(() => {
145-
handleKeyUpdate(props.model.key)
146-
handleNameUpdate(props.model.name)
147-
}, 110)
148-
})
149-
150135
watch(
151136
() => props.businessObject,
152137
(val) => {

src/views/bpm/model/editor/index.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ onMounted(async () => {
8989
}
9090
// 查询模型
9191
const data = await ModelApi.getModel(modelId)
92+
if (!data.bpmnXml) {
93+
// 首次创建的 Model 模型,它是没有 bpmnXml,此时需要给它一个默认的
94+
data.bpmnXml = ` <?xml version="1.0" encoding="UTF-8"?>
95+
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.activiti.org/processdef">
96+
<process id="${data.key}" name="${data.name}" isExecutable="true" />
97+
<bpmndi:BPMNDiagram id="BPMNDiagram">
98+
<bpmndi:BPMNPlane id="${data.key}_di" bpmnElement="${data.key}" />
99+
</bpmndi:BPMNDiagram>
100+
</definitions>`
101+
}
92102
model.value = {
93103
...data,
94104
bpmnXml: undefined // 清空 bpmnXml 属性

0 commit comments

Comments
 (0)