feat: bpmn跳过表达式

pull/660/head
Lesan 2025-01-17 09:57:45 +08:00
parent 8e5271a6d6
commit 4e0e8dd220
2 changed files with 42 additions and 1 deletions

View File

@ -1438,6 +1438,17 @@
"isBody": true "isBody": true
} }
] ]
},
{
"name": "SkipExpression",
"extends": ["bpmn:UserTask"],
"properties": [
{
"name": "skipExpression",
"isAttr": true,
"type": "String"
}
]
} }
], ],
"emumerations": [] "emumerations": []

View File

@ -192,6 +192,16 @@
<!-- 选择弹窗 --> <!-- 选择弹窗 -->
<ProcessExpressionDialog ref="processExpressionDialogRef" @select="selectProcessExpression" /> <ProcessExpressionDialog ref="processExpressionDialogRef" @select="selectProcessExpression" />
</el-form-item> </el-form-item>
<el-form-item label="跳过表达式" prop="skipExpression">
<el-input
type="textarea"
v-model="userTaskForm.skipExpression"
clearable
style="width: 100%"
@change="updateSkipExpression"
/>
</el-form-item>
</el-form> </el-form>
</template> </template>
@ -220,7 +230,8 @@ const props = defineProps({
const prefix = inject('prefix') const prefix = inject('prefix')
const userTaskForm = ref({ const userTaskForm = ref({
candidateStrategy: undefined, // candidateStrategy: undefined, //
candidateParam: [] // candidateParam: [], //
skipExpression: '' //
}) })
const bpmnElement = ref() const bpmnElement = ref()
const bpmnInstances = () => (window as any)?.bpmnInstances const bpmnInstances = () => (window as any)?.bpmnInstances
@ -311,6 +322,13 @@ const resetTaskForm = () => {
(ex) => ex.$type !== `${prefix}:CandidateStrategy` && ex.$type !== `${prefix}:CandidateParam` (ex) => ex.$type !== `${prefix}:CandidateStrategy` && ex.$type !== `${prefix}:CandidateParam`
) ?? [] ) ?? []
//
if (businessObject.skipExpression != undefined) {
userTaskForm.value.skipExpression = businessObject.skipExpression
} else {
userTaskForm.value.skipExpression = ''
}
// extensionElements // extensionElements
return return
if (businessObject.candidateStrategy != undefined) { if (businessObject.candidateStrategy != undefined) {
@ -390,6 +408,18 @@ const updateElementTask = () => {
}) })
} }
const updateSkipExpression = () => {
if (userTaskForm.value.skipExpression && userTaskForm.value.skipExpression !== '') {
bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), {
skipExpression: userTaskForm.value.skipExpression
})
} else {
bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), {
skipExpression: null
})
}
}
// //
const processExpressionDialogRef = ref() const processExpressionDialogRef = ref()
const openProcessExpressionDialog = async () => { const openProcessExpressionDialog = async () => {