!18 修复UserTask在切换候选人类型时,XML仍然保留会保留另一种类型信息的问题

* feat: 修复UserTask在切换候选人类型时,XML仍然保留会保留另一种类型信息的问题,导致代办任务无法正确匹配到当前处理人。
This commit is contained in:
lyh2668
2022-04-06 17:28:58 +00:00
committed by KonBAI
parent 53b21b772b
commit 1b8a2ebe51

View File

@@ -228,6 +228,11 @@ export default {
updateElementTask(key) { updateElementTask(key) {
const taskAttr = Object.create(null); const taskAttr = Object.create(null);
taskAttr['flowable:assignType'] = this.formData.assignType; taskAttr['flowable:assignType'] = this.formData.assignType;
// 修复切换候选类型XML仍保留assignee的问题
if ((key === 'candidateUsers' || key === 'assignee') && !this.userTaskForm[key]) {
taskAttr[key] = null
}
if (key === "candidateUsers" || key === "candidateGroups") { if (key === "candidateUsers" || key === "candidateGroups") {
if (this.userTaskForm[key] && this.userTaskForm[key].length > 0) { if (this.userTaskForm[key] && this.userTaskForm[key].length > 0) {
taskAttr[key] = this.userTaskForm[key].map(k => k.userId) || null taskAttr[key] = this.userTaskForm[key].map(k => k.userId) || null
@@ -302,13 +307,12 @@ export default {
if (this.formData.groupType === 'ASSIGNEE') { if (this.formData.groupType === 'ASSIGNEE') {
val = this.selectedUserDate[0]; val = this.selectedUserDate[0];
this.userTaskForm.assignee = val; this.userTaskForm.assignee = val;
this.updateElementTask('assignee')
} else { } else {
val = this.selectedUserDate; val = this.selectedUserDate;
this.userTaskForm.candidateUsers = val; this.userTaskForm.candidateUsers = val;
this.updateElementTask('candidateUsers')
} }
this.updateElementTask('assignee')
this.updateElementTask('candidateUsers')
} }
this.candidateVisible = false; this.candidateVisible = false;
}, },