适配交叉评查上传接口
修复N多个BUG
This commit is contained in:
@@ -172,29 +172,19 @@ export function convertToTreeData(organizations: OrganizationNode[]): Array<{
|
||||
}>;
|
||||
}> {
|
||||
return organizations.map(org => {
|
||||
const children: Array<{
|
||||
label: string;
|
||||
value: string;
|
||||
isUser?: boolean;
|
||||
userInfo?: UserInfo;
|
||||
}> = [];
|
||||
|
||||
// 递归处理子组织
|
||||
const subOrganizations = org.children && org.children.length > 0 ? convertToTreeData(org.children) : [];
|
||||
// 添加该组织下的用户
|
||||
if (org.users && org.users.length > 0) {
|
||||
children.push(...org.users.map(user => ({
|
||||
label: user.nick_name,
|
||||
value: `user_${user.id}`,
|
||||
isUser: true,
|
||||
userInfo: user
|
||||
})));
|
||||
}
|
||||
|
||||
// 递归处理子组织,保持原有的层级结构
|
||||
if (org.children && org.children.length > 0) {
|
||||
const subOrganizations = convertToTreeData(org.children);
|
||||
children.push(...subOrganizations);
|
||||
}
|
||||
|
||||
const userChildren = (org.users && org.users.length > 0)
|
||||
? org.users.map(user => ({
|
||||
label: user.nick_name,
|
||||
value: `user_${user.id}`,
|
||||
isUser: true,
|
||||
userInfo: user
|
||||
}))
|
||||
: [];
|
||||
// 合并子组织和用户
|
||||
const children = [...subOrganizations, ...userChildren];
|
||||
return {
|
||||
label: org.ou_name,
|
||||
value: org.ou_id,
|
||||
|
||||
Reference in New Issue
Block a user