From 0f5056924653909a3582b4c10ed67e6c02bea1d6 Mon Sep 17 00:00:00 2001 From: LiuHao Date: Thu, 25 Jan 2024 18:22:19 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A2=9E=E5=8A=A0=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BpmnDesign/panel/TaskPanel.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/BpmnDesign/panel/TaskPanel.vue b/src/components/BpmnDesign/panel/TaskPanel.vue index f4efa18..8a5aa7f 100644 --- a/src/components/BpmnDesign/panel/TaskPanel.vue +++ b/src/components/BpmnDesign/panel/TaskPanel.vue @@ -169,21 +169,29 @@ const syncChange = (newVal) => { updateProperties({ 'flowable:async': newVal }); }; -const dueDateChange = (newVal) => { - console.log(newVal); - updateProperties({ 'flowable:dueDate': newVal }); -}; - watch( () => formData.value.auditUserType, (val, oldVal) => { formData.value.users = []; + formData.value.roles = []; } ); +watch( + () => formData.value.roles, + (newVal: Record[]) => { + if (newVal.length > 0) { + // 获取userId 用逗号,隔开 + const roleIds = newVal.map((item) => item.roleId).join(','); + updateProperties({ 'flowable:candidateGroups': roleIds }); + } else { + updateProperties({ 'flowable:candidateGroups': undefined }); + } + }, + { deep: true } +); watch( () => formData.value.users, (newVal: Record[]) => { - updateProperties({ 'flowable:candidateGroups': undefined }); if (newVal.length === 1) { const user = newVal[0]; const userId = user.userId;