BPM:新增顺序会签、或签的能力

This commit is contained in:
YunaiV 2024-03-16 00:05:58 +08:00
parent 5f7ccd4e7c
commit 33d59c8b7d

View File

@ -1,11 +1,16 @@
<template>
<div class="panel-tab__content">
<el-form label-width="90px">
<el-form-item label="回路特性">
<el-form-item label="快捷配置">
<el-button size="small" @click="changeConfig('依次审批')">依次审批</el-button>
<el-button size="small" @click="changeConfig('会签')">会签</el-button>
<el-button size="small" @click="changeConfig('或签')">或签</el-button>
</el-form-item>
<el-form-item label="会签类型">
<el-select v-model="loopCharacteristics" @change="changeLoopCharacteristicsType">
<el-option label="并行多重事件" value="ParallelMultiInstance" />
<el-option label="时序多重事件" value="SequentialMultiInstance" />
<el-option label="循环事件" value="StandardLoop" />
<!-- <el-option label="循环事件" value="StandardLoop" />-->
<el-option label="无" value="Null" />
</el-select>
</el-form-item>
@ -15,7 +20,7 @@
loopCharacteristics === 'SequentialMultiInstance'
"
>
<el-form-item label="循环数" key="loopCardinality">
<el-form-item label="循环" key="loopCardinality">
<el-input
v-model="loopInstanceForm.loopCardinality"
clearable
@ -25,7 +30,8 @@
<el-form-item label="集合" key="collection" v-show="false">
<el-input v-model="loopInstanceForm.collection" clearable @change="updateLoopBase" />
</el-form-item>
<el-form-item label="元素变量" key="elementVariable">
<!-- add by 芋艿由于元素变量暂时用不到所以这里 display none -->
<el-form-item label="元素变量" key="elementVariable" style="display: none">
<el-input v-model="loopInstanceForm.elementVariable" clearable @change="updateLoopBase" />
</el-form-item>
<el-form-item label="完成条件" key="completionCondition">
@ -35,7 +41,8 @@
@change="updateLoopCondition"
/>
</el-form-item>
<el-form-item label="异步状态" key="async">
<!-- add by 芋艿由于异步状态暂时用不到所以这里 display none -->
<el-form-item label="异步状态" key="async" style="display: none">
<el-checkbox
v-model="loopInstanceForm.asyncBefore"
label="异步前"
@ -124,6 +131,7 @@ const getElementLoop = (businessObject) => {
businessObject.loopCharacteristics.extensionElements.values[0].body
}
}
const changeLoopCharacteristicsType = (type) => {
// this.loopInstanceForm = { ...this.defaultLoopInstanceForm }; //
//
@ -160,6 +168,7 @@ const changeLoopCharacteristicsType = (type) => {
loopCharacteristics: toRaw(multiLoopInstance.value)
})
}
//
const updateLoopCardinality = (cardinality) => {
let loopCardinality = null
@ -176,6 +185,7 @@ const updateLoopCardinality = (cardinality) => {
}
)
}
//
const updateLoopCondition = (condition) => {
let completionCondition = null
@ -192,6 +202,7 @@ const updateLoopCondition = (condition) => {
}
)
}
//
const updateLoopTimeCycle = (timeCycle) => {
const extensionElements = bpmnInstances().moddle.create('bpmn:ExtensionElements', {
@ -209,6 +220,7 @@ const updateLoopTimeCycle = (timeCycle) => {
}
)
}
//
const updateLoopBase = () => {
bpmnInstances().modeling.updateModdleProperties(
@ -220,6 +232,7 @@ const updateLoopBase = () => {
}
)
}
//
const updateLoopAsync = (key) => {
const { asyncBefore, asyncAfter } = loopInstanceForm.value
@ -238,6 +251,20 @@ const updateLoopAsync = (key) => {
)
}
const changeConfig = (config) => {
if (config === '依次审批') {
changeLoopCharacteristicsType('SequentialMultiInstance')
updateLoopCardinality('1')
updateLoopCondition('${ nrOfCompletedInstances >= nrOfInstances }')
} else if (config === '会签') {
changeLoopCharacteristicsType('ParallelMultiInstance')
updateLoopCondition('${ nrOfCompletedInstances >= nrOfInstances }')
} else if (config === '或签') {
changeLoopCharacteristicsType('ParallelMultiInstance')
updateLoopCondition('${ nrOfCompletedInstances > 0 }')
}
}
onBeforeUnmount(() => {
multiLoopInstance.value = null
bpmnElement.value = null