修复 bpmnProcessDesigner 由于改造,导致 key 和 name 未同步到 bpmn xml 的问题

This commit is contained in:
YunaiV 2022-01-03 08:55:06 +08:00
parent 513c23efbb
commit 72c8b24604

View File

@ -3,10 +3,10 @@
<el-form size="mini" label-width="90px" :model="model" :rules="rules" @submit.native.prevent>
<el-form-item label="流程标识" prop="key">
<el-input v-model="model.key" placeholder="请输入流标标识"
:disabled="model.id !== undefined && model.id.length > 0"/>
:disabled="model.id !== undefined && model.id.length > 0" @change="handleKeyUpdate" />
</el-form-item>
<el-form-item label="流程名称" prop="name">
<el-input v-model="model.name" placeholder="请输入流程名称" clearable />
<el-input v-model="model.name" placeholder="请输入流程名称" clearable @change="handleNameUpdate" />
</el-form-item>
<el-form-item label="流程分类" prop="category">
<el-select v-model="model.category" placeholder="请选择流程分类" clearable style="width: 100%">
@ -71,6 +71,15 @@ export default {
this.bpmnElement = window?.bpmnInstances?.bpmnElement;
this.elementBaseInfo = JSON.parse(JSON.stringify(this.bpmnElement.businessObject));
},
handleKeyUpdate(value) {
// BPMN XML key id
this.elementBaseInfo['id'] = value;
this.updateBaseInfo('id');
},
handleNameUpdate(value) {
this.elementBaseInfo['name'] = value;
this.updateBaseInfo('name');
},
updateBaseInfo(key) {
// elementBaseInfo
const attrObj = Object.create(null);