新闻采集修改,完成发送邮件
This commit is contained in:
@@ -588,8 +588,8 @@ function transformUsersToTree(flatData: any[]): any[] {
|
||||
flatData.forEach(item => {
|
||||
const deptID = item.deptID || 'unknown';
|
||||
const deptName = item.deptName || '未分配部门';
|
||||
// 优先使用 parentID,如果不存在则使用 parentDeptID
|
||||
const parentID = item.parentID || item.parentDeptID;
|
||||
// 优先使用 parentID,如果不存在则使用 parentID
|
||||
const parentID = item.parentID || item.parentID;
|
||||
|
||||
if (!deptMap.has(deptID)) {
|
||||
// 创建部门节点
|
||||
@@ -598,7 +598,7 @@ function transformUsersToTree(flatData: any[]): any[] {
|
||||
displayName: deptName,
|
||||
deptID: deptID,
|
||||
deptName: deptName,
|
||||
parentDeptID: parentID,
|
||||
parentID: parentID,
|
||||
children: [],
|
||||
isDept: true
|
||||
});
|
||||
@@ -629,12 +629,12 @@ function transformUsersToTree(flatData: any[]): any[] {
|
||||
const node = deptTreeMap.get(dept.deptID);
|
||||
if (!node) return;
|
||||
|
||||
if (!dept.parentDeptID || dept.parentDeptID === '0' || dept.parentDeptID === '') {
|
||||
if (!dept.parentID || dept.parentID === '0' || dept.parentID === '') {
|
||||
// 根部门
|
||||
tree.push(node);
|
||||
} else {
|
||||
// 子部门
|
||||
const parent = deptTreeMap.get(dept.parentDeptID);
|
||||
const parent = deptTreeMap.get(dept.parentID);
|
||||
if (parent) {
|
||||
// 将用户节点暂存
|
||||
const users = node.children || [];
|
||||
|
||||
@@ -607,7 +607,7 @@ async function fetchTaskUsers() {
|
||||
username: item.username,
|
||||
deptID: item.deptID,
|
||||
deptName: item.deptName,
|
||||
parentDeptID: item.parentDeptID
|
||||
parentID: item.parentID
|
||||
}));
|
||||
return {
|
||||
success: true,
|
||||
@@ -656,7 +656,7 @@ function transformUsersToTree(flatData: any[]): any[] {
|
||||
displayName: deptName,
|
||||
deptID: deptID,
|
||||
deptName: deptName,
|
||||
parentDeptID: item.parentDeptID,
|
||||
parentID: item.parentID,
|
||||
children: [],
|
||||
isDept: true // 标记这是部门节点
|
||||
});
|
||||
@@ -687,12 +687,12 @@ function transformUsersToTree(flatData: any[]): any[] {
|
||||
const node = deptTreeMap.get(dept.deptID);
|
||||
if (!node) return;
|
||||
|
||||
if (!dept.parentDeptID || dept.parentDeptID === '0' || dept.parentDeptID === '') {
|
||||
if (!dept.parentID || dept.parentID === '0' || dept.parentID === '') {
|
||||
// 根部门
|
||||
tree.push(node);
|
||||
} else {
|
||||
// 子部门
|
||||
const parent = deptTreeMap.get(dept.parentDeptID);
|
||||
const parent = deptTreeMap.get(dept.parentID);
|
||||
if (parent) {
|
||||
// 将用户节点暂存
|
||||
const users = node.children || [];
|
||||
|
||||
Reference in New Issue
Block a user