fix(流程设计): 修复多实例会签,用户任务缺失 assignee: '${assignee}' 导致任务指派失败的问题

This commit is contained in:
konbai
2022-12-14 23:52:23 +08:00
parent 54aed467b7
commit eacd4b1975

View File

@@ -41,7 +41,7 @@
checkStrictly checkStrictly
nodeKey="id" nodeKey="id"
:checkedKeys="deptIds" :checkedKeys="deptIds"
@checked-change="checkedDeptChange"> @change="checkedDeptChange">
</tree-select> </tree-select>
</div> </div>
</el-row> </el-row>
@@ -348,22 +348,53 @@ export default {
this.userOpen = false; this.userOpen = false;
}, },
changeSelectRoles(val) { changeSelectRoles(val) {
let groups = null;
let text = null;
if (val && val.length > 0) {
userTaskForm.dataType = 'ROLES'; userTaskForm.dataType = 'ROLES';
userTaskForm.candidateGroups = val.join() || null; groups = val.join() || null;
let textArr = this.roleOptions.filter(k => val.indexOf(`ROLE${k.roleId}`) >= 0); let textArr = this.roleOptions.filter(k => val.indexOf(`ROLE${k.roleId}`) >= 0);
userTaskForm.text = textArr?.map(k => k.roleName).join() || null; text = textArr?.map(k => k.roleName).join() || null;
} else {
userTaskForm.dataType = null;
this.multiLoopType = 'Null';
}
userTaskForm.candidateGroups = groups;
userTaskForm.text = text;
this.updateElementTask(); this.updateElementTask();
this.changeMultiLoopType(this.multiLoopType);
}, },
checkedDeptChange(checkedIds, checkedData) { checkedDeptChange(checkedIds) {
userTaskForm.dataType = 'DEPTS'; let groups = null;
if (checkedIds && checkedIds.length > 0) { let text = null;
this.deptIds = checkedIds; this.deptIds = checkedIds;
if (checkedIds && checkedIds.length > 0) {
userTaskForm.dataType = 'DEPTS';
groups = checkedIds.join() || null;
let textArr = []
let treeStarkData = JSON.parse(JSON.stringify(this.deptTreeData));
checkedIds.forEach(id => {
let stark = []
stark = stark.concat(treeStarkData);
while(stark.length) {
let temp = stark.shift();
if(temp.children) {
stark = temp.children.concat(stark);
} }
if (checkedData && checkedData.length > 0) { if(id === temp.id) {
userTaskForm.candidateGroups = checkedData.map(k => k.id).join() || null textArr.push(temp);
userTaskForm.text = checkedData.map(k => k.label).join() || null }
}
})
text = textArr?.map(k => k.label).join() || null;
} else {
userTaskForm.dataType = null;
this.multiLoopType = 'Null';
}
userTaskForm.candidateGroups = groups;
userTaskForm.text = text;
this.updateElementTask(); this.updateElementTask();
} this.changeMultiLoopType(this.multiLoopType);
}, },
changeDataType(val) { changeDataType(val) {
// 清空 userTaskForm 所有属性值 // 清空 userTaskForm 所有属性值
@@ -437,7 +468,7 @@ export default {
changeMultiLoopType(type) { changeMultiLoopType(type) {
// 取消多实例配置 // 取消多实例配置
if (type === "Null") { if (type === "Null") {
window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { loopCharacteristics: null }); window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { loopCharacteristics: null, assignee: null });
return; return;
} }
this.multiLoopInstance = window.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics", { isSequential: this.isSequential }); this.multiLoopInstance = window.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics", { isSequential: this.isSequential });