当前位置: 首页> 财经> 金融 > 基于jeecgboot-vue3的Flowable流程-集成仿钉钉流程(三)增加角色的选择

基于jeecgboot-vue3的Flowable流程-集成仿钉钉流程(三)增加角色的选择

时间:2025/7/9 23:58:29来源:https://blog.csdn.net/qq_40032778/article/details/140285411 浏览次数:0次

因为这个项目license问题无法开源,更多技术支持与服务请加入我的知识星球。

1、后端角色的转换

else if(this.getAssigneeType() == AssigneeTypeEnum.ROLE) {ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);extDataTypeAttribute.setName("dataType");extDataTypeAttribute.setValue("ROLES");userTask.addAttribute(extDataTypeAttribute);ExtensionAttribute extTextAttribute =  new ExtensionAttribute();extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);extTextAttribute.setName("text");extTextAttribute.setValue(String.join(",", this.getApprovalText()));userTask.addAttribute(extTextAttribute);List<String> roleslist = this.getRoles();userTask.setCandidateGroups(roleslist);userTask.setAssignee("${assignee}");}

2、选择角色改用jeecg的组件

<div v-if="dataType === 'ROLES'" style="width: 100%;"><j-select-role v-model:value="roleIds" :multi="false" @getSelectResult="selRole" placeholder="请选择角色"></j-select-role></div>

3、选择好角色的处理

function selRole(option,deptList) {console.log("selRole option",option)console.log("selRole deptList",deptList)let groups = null;let text = null;if (option && option.length > 0) {userTaskForm.value.dataType = 'ROLES';groups = deptList.join(",") || null;text = option?.map(k => k.label).join(",") || null;} else {userTaskForm.value.dataType = '';multiLoopType.value = 'Null';}userTaskForm.value.candidateGroups = groups;userTaskForm.value.text = text;updateElementTask();changeMultiLoopType();}

4、同时更新approvalNode信息

else if (assigneeType === 'role') {console.log("assigneeType === 'role'")if (roles.length > 0) {const all = roles.map((id) => getRoleById({id: id}).then(res => {console.log("getRoleById res",res)if(res.code === 200) {return res.result.roleName;}})  ) Promise.all(all).then((roles) => {console.log("all roles",roles)content.value = roles.map((role) => role).join('、')})}

5、效果图

关键字:基于jeecgboot-vue3的Flowable流程-集成仿钉钉流程(三)增加角色的选择

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: