From 4e0e8dd22077a0b5478ac54b016bd3df837371e7 Mon Sep 17 00:00:00 2001 From: Lesan <1960681385@qq.com> Date: Fri, 17 Jan 2025 09:57:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20bpmn=E8=B7=B3=E8=BF=87=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../descriptor/flowableDescriptor.json | 11 +++++++ .../penal/task/task-components/UserTask.vue | 32 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json index 7fe1fa79..b7442fd1 100644 --- a/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json @@ -1438,6 +1438,17 @@ "isBody": true } ] + }, + { + "name": "SkipExpression", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "skipExpression", + "isAttr": true, + "type": "String" + } + ] } ], "emumerations": [] diff --git a/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue index e563bfd6..81088ccc 100644 --- a/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue +++ b/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue @@ -192,6 +192,16 @@ + + + + @@ -220,7 +230,8 @@ const props = defineProps({ const prefix = inject('prefix') const userTaskForm = ref({ candidateStrategy: undefined, // 分配规则 - candidateParam: [] // 分配选项 + candidateParam: [], // 分配选项 + skipExpression: '' // 跳过表达式 }) const bpmnElement = ref() const bpmnInstances = () => (window as any)?.bpmnInstances @@ -311,6 +322,13 @@ const resetTaskForm = () => { (ex) => ex.$type !== `${prefix}:CandidateStrategy` && ex.$type !== `${prefix}:CandidateParam` ) ?? [] + // 跳过表达式 + if (businessObject.skipExpression != undefined) { + userTaskForm.value.skipExpression = businessObject.skipExpression + } else { + userTaskForm.value.skipExpression = '' + } + // 改用通过extensionElements来存储数据 return 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 openProcessExpressionDialog = async () => {