Skip to content

Commit 33d59c8

Browse files
committed
BPM:新增顺序会签、或签的能力
1 parent 5f7ccd4 commit 33d59c8

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<template>
22
<div class="panel-tab__content">
33
<el-form label-width="90px">
4-
<el-form-item label="回路特性">
4+
<el-form-item label="快捷配置">
5+
<el-button size="small" @click="changeConfig('依次审批')">依次审批</el-button>
6+
<el-button size="small" @click="changeConfig('会签')">会签</el-button>
7+
<el-button size="small" @click="changeConfig('或签')">或签</el-button>
8+
</el-form-item>
9+
<el-form-item label="会签类型">
510
<el-select v-model="loopCharacteristics" @change="changeLoopCharacteristicsType">
611
<el-option label="并行多重事件" value="ParallelMultiInstance" />
712
<el-option label="时序多重事件" value="SequentialMultiInstance" />
8-
<el-option label="循环事件" value="StandardLoop" />
13+
<!-- <el-option label="循环事件" value="StandardLoop" />-->
914
<el-option label="" value="Null" />
1015
</el-select>
1116
</el-form-item>
@@ -15,7 +20,7 @@
1520
loopCharacteristics === 'SequentialMultiInstance'
1621
"
1722
>
18-
<el-form-item label="循环基数" key="loopCardinality">
23+
<el-form-item label="循环数量" key="loopCardinality">
1924
<el-input
2025
v-model="loopInstanceForm.loopCardinality"
2126
clearable
@@ -25,7 +30,8 @@
2530
<el-form-item label="集合" key="collection" v-show="false">
2631
<el-input v-model="loopInstanceForm.collection" clearable @change="updateLoopBase" />
2732
</el-form-item>
28-
<el-form-item label="元素变量" key="elementVariable">
33+
<!-- add by 芋艿:由于「元素变量」暂时用不到,所以这里 display 为 none -->
34+
<el-form-item label="元素变量" key="elementVariable" style="display: none">
2935
<el-input v-model="loopInstanceForm.elementVariable" clearable @change="updateLoopBase" />
3036
</el-form-item>
3137
<el-form-item label="完成条件" key="completionCondition">
@@ -35,7 +41,8 @@
3541
@change="updateLoopCondition"
3642
/>
3743
</el-form-item>
38-
<el-form-item label="异步状态" key="async">
44+
<!-- add by 芋艿:由于「异步状态」暂时用不到,所以这里 display 为 none -->
45+
<el-form-item label="异步状态" key="async" style="display: none">
3946
<el-checkbox
4047
v-model="loopInstanceForm.asyncBefore"
4148
label="异步前"
@@ -124,6 +131,7 @@ const getElementLoop = (businessObject) => {
124131
businessObject.loopCharacteristics.extensionElements.values[0].body
125132
}
126133
}
134+
127135
const changeLoopCharacteristicsType = (type) => {
128136
// this.loopInstanceForm = { ...this.defaultLoopInstanceForm }; // 切换类型取消原表单配置
129137
// 取消多实例配置
@@ -160,6 +168,7 @@ const changeLoopCharacteristicsType = (type) => {
160168
loopCharacteristics: toRaw(multiLoopInstance.value)
161169
})
162170
}
171+
163172
// 循环基数
164173
const updateLoopCardinality = (cardinality) => {
165174
let loopCardinality = null
@@ -176,6 +185,7 @@ const updateLoopCardinality = (cardinality) => {
176185
}
177186
)
178187
}
188+
179189
// 完成条件
180190
const updateLoopCondition = (condition) => {
181191
let completionCondition = null
@@ -192,6 +202,7 @@ const updateLoopCondition = (condition) => {
192202
}
193203
)
194204
}
205+
195206
// 重试周期
196207
const updateLoopTimeCycle = (timeCycle) => {
197208
const extensionElements = bpmnInstances().moddle.create('bpmn:ExtensionElements', {
@@ -209,6 +220,7 @@ const updateLoopTimeCycle = (timeCycle) => {
209220
}
210221
)
211222
}
223+
212224
// 直接更新的基础信息
213225
const updateLoopBase = () => {
214226
bpmnInstances().modeling.updateModdleProperties(
@@ -220,6 +232,7 @@ const updateLoopBase = () => {
220232
}
221233
)
222234
}
235+
223236
// 各异步状态
224237
const updateLoopAsync = (key) => {
225238
const { asyncBefore, asyncAfter } = loopInstanceForm.value
@@ -238,6 +251,20 @@ const updateLoopAsync = (key) => {
238251
)
239252
}
240253
254+
const changeConfig = (config) => {
255+
if (config === '依次审批') {
256+
changeLoopCharacteristicsType('SequentialMultiInstance')
257+
updateLoopCardinality('1')
258+
updateLoopCondition('${ nrOfCompletedInstances >= nrOfInstances }')
259+
} else if (config === '会签') {
260+
changeLoopCharacteristicsType('ParallelMultiInstance')
261+
updateLoopCondition('${ nrOfCompletedInstances >= nrOfInstances }')
262+
} else if (config === '或签') {
263+
changeLoopCharacteristicsType('ParallelMultiInstance')
264+
updateLoopCondition('${ nrOfCompletedInstances > 0 }')
265+
}
266+
}
267+
241268
onBeforeUnmount(() => {
242269
multiLoopInstance.value = null
243270
bpmnElement.value = null

0 commit comments

Comments
 (0)