|
@@ -306,8 +306,16 @@ async def deptTree(request: Request,label: str = Query(None, description='部门
|
|
|
if len(children) > 0:
|
|
|
children_depts = build_dept_tree(children, dept)
|
|
|
dept["children"] = children_depts
|
|
|
+ userlist=dept_id_get_user_info(db,dept_info.dept_id)
|
|
|
+ if userlist:
|
|
|
+ for user_info in userlist:
|
|
|
+ dept["children"].append({"id":user_info.user_id,"label":user_info.nick_name,"isLeaf":True})
|
|
|
else:
|
|
|
dept['isLeaf']=True
|
|
|
+ userlist = dept_id_get_user_info(db, dept_info.dept_id)
|
|
|
+ if userlist:
|
|
|
+ for user_info in userlist:
|
|
|
+ dept["children"].append({"id": user_info.user_id, "label": user_info.nick_name, "isLeaf": True})
|
|
|
dept_tree.append(dept)
|
|
|
return dept_tree
|
|
|
|