setFormData({ ...formData, deptName: e.target.value })}
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
@@ -381,7 +389,7 @@ function EditDepartmentModal({ dept, closeModal, onSuccess }) {
);
}
-// 将部门列表转换为树状结构
+// 将组织机构列表转换为树状结构
function buildTree(departments, parentId = 0) {
return departments
.filter((dept) => dept.parentId === parentId)
diff --git a/frontend/src/pages/WorkspaceSettings/Members/AddMemberModal/index.jsx b/frontend/src/pages/WorkspaceSettings/Members/AddMemberModal/index.jsx
index a48f26c..4dcda7d 100644
--- a/frontend/src/pages/WorkspaceSettings/Members/AddMemberModal/index.jsx
+++ b/frontend/src/pages/WorkspaceSettings/Members/AddMemberModal/index.jsx
@@ -56,8 +56,8 @@ export default function AddMemberModal({ closeModal, workspace, users }) {
.filter((user) =>
user.username.toLowerCase().includes(searchTerm.toLowerCase())
)
- .filter((user) => user.role !== "admin")
- .filter((user) => user.role !== "manager");
+ .filter((user) => user.role !== "admin");
+ // .filter((user) => user.role !== "manager");
return (
diff --git a/server/endpoints/admin.js b/server/endpoints/admin.js
index 5be2fcc..1a3fd95 100644
--- a/server/endpoints/admin.js
+++ b/server/endpoints/admin.js
@@ -104,7 +104,7 @@ function adminEndpoints(app) {
// data: newUserParams,
// });
//
- // // 2. 将用户和部门关联到 dept_users 表
+ // // 2. 将用户和组织机构关联到 dept_users 表
// if (newUserParams.deptId) {
// await prisma.dept_users.create({
// data: {
diff --git a/server/endpoints/dept.js b/server/endpoints/dept.js
index 15d0a45..7c68f4a 100644
--- a/server/endpoints/dept.js
+++ b/server/endpoints/dept.js
@@ -13,7 +13,7 @@ function deptEndpoints(app) {
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
async (_request, response) => {
try {
- const depts = await Dept.where();
+ const depts = await Dept.where({ delFlag: 0 });
response.status(200).json({ depts });
} catch (e) {
console.error(e);
@@ -21,7 +21,7 @@ function deptEndpoints(app) {
}
}
);
- // 获取部门树状结构
+ // 获取组织机构树状结构
app.get(
"/dept/tree",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -36,7 +36,7 @@ function deptEndpoints(app) {
}
);
- // 懒加载子部门列表
+ // 懒加载子组织机构列表
app.get(
"/dept/children",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -58,20 +58,20 @@ function deptEndpoints(app) {
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
async (request, response) => {
try {
- const dept = reqBody(request); // 获取请求体中的部门数据
+ const dept = reqBody(request); // 获取请求体中的组织机构数据
console.log("dept 类型:", typeof dept);
- // 检查部门名称是否唯一
+ // 检查组织机构名称是否唯一
const isUnique = await Dept.checkDeptNameUnique(dept);
if (!isUnique) {
return response.status(400).json({
success: false,
- message: `新增部门 '${dept.deptName}' 失败,部门名称已存在`,
+ message: `新增组织机构 '${dept.deptName}' 失败,组织机构名称已存在`,
});
};
- // 按照deptId查询父部门
+ // 按照deptId查询父组织机构
const parentDept = await Dept.get({ deptId: dept.parentId });
dept.ancestors = parentDept.dept.ancestors + ',' + dept.parentId;
- // 插入部门数据
+ // 插入组织机构数据
const insertedDept = await Dept.insertDept(dept);
// 返回成功响应
response.status(200).json({
@@ -80,10 +80,10 @@ function deptEndpoints(app) {
});
} catch (error) {
// 处理错误
- console.error("添加部门失败:", error);
+ console.error("添加组织机构失败:", error);
response.status(500).json({
success: false,
- message: "添加部门失败,服务器内部错误",
+ message: "添加组织机构失败,服务器内部错误",
});
}
});
@@ -93,37 +93,37 @@ function deptEndpoints(app) {
async (request, response) => {
try {
const deptId = parseInt(request.params.deptId);
- const dept = reqBody(request); // 获取请求体中的部门数据
+ const dept = reqBody(request); // 获取请求体中的组织机构数据
- // 检查部门名称是否唯一
+ // 检查组织机构名称是否唯一
const isUnique = await Dept.checkDeptNameUnique(dept);
console.log("isUnique:", isUnique);
if (!isUnique) {
return response.status(400).json({
success: false,
- message: `修改部门 '${dept.deptName}' 失败,部门名称已存在`,
+ message: `修改组织机构 '${dept.deptName}' 失败,组织机构名称已存在`,
});
}
- // 检查上级部门是否是自己
+ // 检查上级组织机构是否是自己
if (dept.parentId === deptId) {
return response.status(400).json({
success: false,
- message: `修改部门 '${dept.deptName}' 失败,上级部门不能是自己`,
+ message: `修改组织机构 '${dept.deptName}' 失败,上级组织机构不能是自己`,
});
}
- // 检查部门是否包含未停用的子部门
+ // 检查组织机构是否包含未停用的子组织机构
if (dept.status === 1) {
const normalChildrenCount = await Dept.selectNormalChildrenDeptById(deptId);
if (normalChildrenCount > 0) {
return response.status(400).json({
success: false,
- message: "该部门包含未停用的子部门!",
+ message: "该组织机构包含未停用的子组织机构!",
});
}
}
- // 更新部门数据
+ // 更新组织机构数据
const updatedDept = await Dept.update(deptId, dept);
// 返回成功响应
response.status(200).json({
@@ -132,50 +132,50 @@ function deptEndpoints(app) {
});
} catch (error) {
// 处理错误
- console.error("修改部门失败:", error);
+ console.error("修改组织机构失败:", error);
response.status(500).json({
success: false,
- message: "修改部门失败,服务器内部错误",
+ message: "修改组织机构失败,服务器内部错误",
});
}
});
- // 删除部门的接口
+ // 删除组织机构的接口
app.delete("/dept/:deptId",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
async (request, response) => {
try {
- const deptId = parseInt(request.params.deptId); // 获取部门 ID
+ const deptId = parseInt(request.params.deptId); // 获取组织机构 ID
- // 检查部门是否有子部门
+ // 检查组织机构是否有子组织机构
const hasChild = await Dept.hasChildByDeptId(deptId);
if (hasChild) {
return response.status(400).json({
success: false,
- message: "存在下级部门,不允许删除",
+ message: "存在下级组织机构,不允许删除",
});
}
- // 检查部门是否存在用户
+ // 检查组织机构是否存在用户
const hasUser = await Dept.checkDeptExistUser(deptId);
if (hasUser) {
return response.status(400).json({
success: false,
- message: "部门存在用户,不允许删除",
+ message: "组织机构存在用户,不允许删除",
});
}
- // // 检查部门数据权限
+ // // 检查组织机构数据权限
// const hasDataScope = await Dept.checkDeptDataScope(deptId);
// if (!hasDataScope) {
// return response.status(403).json({
// success: false,
- // message: "无权限删除该部门",
+ // message: "无权限删除该组织机构",
// });
// }
- // 删除部门
- const deletedDept = await Dept.deleteDeptById(deptId);
+ // 删除组织机构
+ const deletedDept = await Dept.softDelete(deptId);
// 返回成功响应
response.status(200).json({
@@ -184,10 +184,10 @@ function deptEndpoints(app) {
});
} catch (error) {
// 处理错误
- console.error("删除部门失败:", error);
+ console.error("删除组织机构失败:", error);
response.status(500).json({
success: false,
- message: "删除部门失败,服务器内部错误",
+ message: "删除组织机构失败,服务器内部错误",
});
}
});
diff --git a/server/endpoints/deptDocument.js b/server/endpoints/deptDocument.js
index 24a28a7..f07a3de 100644
--- a/server/endpoints/deptDocument.js
+++ b/server/endpoints/deptDocument.js
@@ -8,7 +8,7 @@ const {
function deptDocumentEndpoints(app) {
if (!app) return;
- // 获取部门文档列表
+ // 获取组织机构文档列表
app.get(
"/deptDocument/list",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin, ROLES.manager])],
@@ -23,7 +23,7 @@ function deptDocumentEndpoints(app) {
}
);
- // 添加部门文档
+ // 添加组织机构文档
app.post(
"/deptDocument/add",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin, ROLES.manager])],
@@ -47,7 +47,7 @@ function deptDocumentEndpoints(app) {
if (error) {
return response.status(500).json({
success: false,
- message: "添加部门文档失败",
+ message: "添加组织机构文档失败",
error: error,
});
}
@@ -58,16 +58,16 @@ function deptDocumentEndpoints(app) {
data: deptDocument,
});
} catch (error) {
- console.error("添加部门文档失败:", error);
+ console.error("添加组织机构文档失败:", error);
response.status(500).json({
success: false,
- message: "添加部门文档失败,服务器内部错误",
+ message: "添加组织机构文档失败,服务器内部错误",
});
}
}
);
- // 编辑部门文档
+ // 编辑组织机构文档
app.post(
"/deptDocument/edit",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin, ROLES.manager])],
@@ -92,7 +92,7 @@ function deptDocumentEndpoints(app) {
if (!success) {
return response.status(500).json({
success: false,
- message: "编辑部门文档失败",
+ message: "编辑组织机构文档失败",
error: error,
});
}
@@ -103,16 +103,16 @@ function deptDocumentEndpoints(app) {
data: deptDocument,
});
} catch (error) {
- console.error("编辑部门文档失败:", error);
+ console.error("编辑组织机构文档失败:", error);
response.status(500).json({
success: false,
- message: "编辑部门文档失败,服务器内部错误",
+ message: "编辑组织机构文档失败,服务器内部错误",
});
}
}
);
- // 删除部门文档
+ // 删除组织机构文档
app.delete(
"/deptDocument/:id",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin, ROLES.manager])],
@@ -134,7 +134,7 @@ function deptDocumentEndpoints(app) {
if (!success) {
return response.status(500).json({
success: false,
- message: "删除部门文档失败",
+ message: "删除组织机构文档失败",
});
}
@@ -144,10 +144,10 @@ function deptDocumentEndpoints(app) {
message: "文档删除成功",
});
} catch (error) {
- console.error("删除部门文档失败:", error);
+ console.error("删除组织机构文档失败:", error);
response.status(500).json({
success: false,
- message: "删除部门文档失败,服务器内部错误",
+ message: "删除组织机构文档失败,服务器内部错误",
});
}
}
diff --git a/server/endpoints/deptUsers.js b/server/endpoints/deptUsers.js
index 2c0408e..6895f8c 100644
--- a/server/endpoints/deptUsers.js
+++ b/server/endpoints/deptUsers.js
@@ -8,7 +8,7 @@ const {
function deptUsersEndpoints(app) {
if (!app) return;
- // 获取部门用户关联列表
+ // 获取组织机构用户关联列表
app.get(
"/deptUsers/list",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -23,7 +23,7 @@ function deptUsersEndpoints(app) {
}
);
- // 添加部门用户关联
+ // 添加组织机构用户关联
app.post(
"/deptUsers/add",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -31,12 +31,12 @@ function deptUsersEndpoints(app) {
try {
const deptUserData = request.body; // 获取请求体中的数据
- // 插入部门用户关联数据
+ // 插入组织机构用户关联数据
const { deptUser, error } = await DeptUsers.create(deptUserData);
if (error) {
return response.status(500).json({
success: false,
- message: "添加部门用户关联失败",
+ message: "添加组织机构用户关联失败",
error: error,
});
}
@@ -47,16 +47,16 @@ function deptUsersEndpoints(app) {
data: deptUser,
});
} catch (error) {
- console.error("添加部门用户关联失败:", error);
+ console.error("添加组织机构用户关联失败:", error);
response.status(500).json({
success: false,
- message: "添加部门用户关联失败,服务器内部错误",
+ message: "添加组织机构用户关联失败,服务器内部错误",
});
}
}
);
- // 编辑部门用户关联
+ // 编辑组织机构用户关联
app.post(
"/deptUsers/edit",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -69,11 +69,11 @@ function deptUsersEndpoints(app) {
if (!existingDeptUser) {
return response.status(404).json({
success: false,
- message: "部门用户关联不存在",
+ message: "组织机构用户关联不存在",
});
}
- // 更新部门用户关联
+ // 更新组织机构用户关联
const { success, error, deptUser } = await DeptUsers.update(
deptUserData.id,
deptUserData
@@ -81,7 +81,7 @@ function deptUsersEndpoints(app) {
if (!success) {
return response.status(500).json({
success: false,
- message: "编辑部门用户关联失败",
+ message: "编辑组织机构用户关联失败",
error: error,
});
}
@@ -92,16 +92,16 @@ function deptUsersEndpoints(app) {
data: deptUser,
});
} catch (error) {
- console.error("编辑部门用户关联失败:", error);
+ console.error("编辑组织机构用户关联失败:", error);
response.status(500).json({
success: false,
- message: "编辑部门用户关联失败,服务器内部错误",
+ message: "编辑组织机构用户关联失败,服务器内部错误",
});
}
}
);
- // 删除部门用户关联
+ // 删除组织机构用户关联
app.delete(
"/deptUsers/:id",
[validatedRequest, strictMultiUserRoleValid([ROLES.admin])],
@@ -114,29 +114,29 @@ function deptUsersEndpoints(app) {
if (!existingDeptUser) {
return response.status(404).json({
success: false,
- message: "部门用户关联不存在",
+ message: "组织机构用户关联不存在",
});
}
- // 删除部门用户关联
+ // 删除组织机构用户关联
const success = await DeptUsers.delete({ id });
if (!success) {
return response.status(500).json({
success: false,
- message: "删除部门用户关联失败",
+ message: "删除组织机构用户关联失败",
});
}
// 返回成功响应
response.status(200).json({
success: true,
- message: "部门用户关联删除成功",
+ message: "组织机构用户关联删除成功",
});
} catch (error) {
- console.error("删除部门用户关联失败:", error);
+ console.error("删除组织机构用户关联失败:", error);
response.status(500).json({
success: false,
- message: "删除部门用户关联失败,服务器内部错误",
+ message: "删除组织机构用户关联失败,服务器内部错误",
});
}
}
diff --git a/server/endpoints/workspaces.js b/server/endpoints/workspaces.js
index e5eda4f..16689dd 100644
--- a/server/endpoints/workspaces.js
+++ b/server/endpoints/workspaces.js
@@ -174,7 +174,7 @@ function workspaceEndpoints(app) {
const user = await userFromSession(request, response);
const deptUserRecord = await DeptUsers.get({ userId: user.id });
if (!deptUserRecord.deptUser) {
- return response.status(500).json({ success: false, error: "没有发现用户部门" });
+ return response.status(500).json({ success: false, error: "没有发现用户组织机构" });
}
const Collector = new CollectorApi();
const { originalname } = request.file;
diff --git a/server/models/dept.js b/server/models/dept.js
index 52e8d24..7924952 100644
--- a/server/models/dept.js
+++ b/server/models/dept.js
@@ -81,7 +81,7 @@ const Dept = {
return { dept: null, error: error.message };
}
},
- // 插入部门数据
+ // 插入组织机构数据
insertDept: async function (dept) {
try {
const insertedDept = await prisma.dept.create({
@@ -98,12 +98,12 @@ const Dept = {
});
return insertedDept;
} catch (error) {
- console.error("插入部门数据失败:", error);
+ console.error("插入组织机构数据失败:", error);
throw error;
}
},
update: async function (deptId, updates = {}) {
- console.log("更新部门数据:", updates);
+ console.log("更新组织机构数据:", updates);
try {
// 检查 deptId 是否存在
if (!deptId) throw new Error('没有提供用于查询的deptId');
@@ -111,9 +111,9 @@ const Dept = {
// 检查 updates 是否为空
if (Object.keys(updates).length === 0) throw new Error('没有提供更新字段');
- // 查询当前部门
+ // 查询当前组织机构
const currentDept = await prisma.dept.findUnique({ where: { deptId } });
- if (!currentDept) throw new Error('不存在该部门');
+ if (!currentDept) throw new Error('不存在该组织机构');
// 更新 lastUpdatedAt 字段
updates.lastUpdatedAt = new Date();
@@ -125,7 +125,7 @@ const Dept = {
updates.ancestors = parentDept ? `${parentDept.ancestors},${parentId}` : `${parentId}`;
}
- console.log("更新前部门数据:", updates);
+ console.log("更新前组织机构数据:", updates);
// 执行更新操作
const updatedDept = await prisma.dept.update({
@@ -133,7 +133,7 @@ const Dept = {
data: updates, // 更新的字段
});
- console.log("更新后部门数据:", updatedDept);
+ console.log("更新后组织机构数据:", updatedDept);
// 返回成功结果
return { success: true, error: null, dept: updatedDept };
@@ -162,6 +162,33 @@ const Dept = {
return false;
}
},
+ softDelete: async function (deptId) {
+ try {
+ // 检查 deptId 是否存在
+ if (!deptId) throw new Error('没有提供用于查询的deptId');
+
+ // 查询当前组织机构
+ const currentDept = await prisma.dept.findUnique({ where: { deptId } });
+ if (!currentDept) throw new Error('不存在该组织机构');
+
+ // 执行逻辑删除操作
+ const updatedDept = await prisma.dept.update({
+ where: { deptId }, // 使用 deptId 作为查询条件
+ data: {
+ delFlag: 1, // 标记为已删除
+ lastUpdatedAt: new Date(), // 更新最后修改时间
+ },
+ });
+
+ console.log("逻辑删除后的组织机构数据:", updatedDept);
+
+ // 返回成功结果
+ return { success: true, error: null, dept: updatedDept };
+ } catch (error) {
+ console.error(error.message);
+ return { success: false, error: error.message, dept: null };
+ }
+ },
where: async function (clause = {}, limit = null) {
try {
const depts = await prisma.dept.findMany({
@@ -181,24 +208,24 @@ const Dept = {
try {
const existingDept = await prisma.dept.findFirst({
where: {
- deptName: dept.deptName, // 根据部门名称查询
+ deptName: dept.deptName, // 根据组织机构名称查询
parentId: dept.parentId, // 排除父id
},
});
- // 如果查询到记录,说明部门名称已存在
+ // 如果查询到记录,说明组织机构名称已存在
console.log("existingDept:", existingDept);
return !existingDept;
} catch (error) {
- console.error('检查部门名称唯一性失败:', error);
+ console.error('检查组织机构名称唯一性失败:', error);
throw error;
}
},
- // 检查部门是否包含未停用的子部门
+ // 检查组织机构是否包含未停用的子组织机构
selectNormalChildrenDeptById: async function (deptId) {
try {
- // 查询所有祖先部门中包含当前部门的未停用部门
+ // 查询所有祖先组织机构中包含当前组织机构的未停用组织机构
const childrenDepts = await prisma.$queryRaw`
SELECT COUNT(*) as count
FROM sys_dept
@@ -207,53 +234,53 @@ const Dept = {
AND FIND_IN_SET(${deptId}, ancestors)
`;
- // 返回未停用的子部门数量
+ // 返回未停用的子组织机构数量
return childrenDepts[0].count;
} catch (error) {
- console.error("查询子部门失败:", error);
+ console.error("查询子组织机构失败:", error);
throw error;
}
},
- // 检查部门是否有子部门
+ // 检查组织机构是否有子组织机构
hasChildByDeptId: async function (deptId) {
try {
const children = await prisma.dept.findMany({
where: {
- parentId: deptId, // 查询当前部门的子部门
+ parentId: deptId, // 查询当前组织机构的子组织机构
delFlag: 0,
},
});
- // 如果有子部门,返回 true
+ // 如果有子组织机构,返回 true
return children.length > 0;
} catch (error) {
- console.error("检查子部门失败:", error);
+ console.error("检查子组织机构失败:", error);
throw error;
}
},
- // 检查部门是否存在用户
+ // 检查组织机构是否存在用户
checkDeptExistUser: async function (deptId) {
try {
- const users = await prisma.user.findMany({
+ const deptUsers = await prisma.dept_users.findMany({
where: {
- deptId: deptId, // 查询当前部门的用户
+ deptId: deptId, // 查询当前组织机构的用户
},
});
// 如果存在用户,返回 true
- return users.length > 0;
+ return deptUsers.length > 0;
} catch (error) {
- console.error("检查部门用户失败:", error);
+ console.error("检查组织机构用户失败:", error);
throw error;
}
},
/**
- * 获取部门树状结构
+ * 获取组织机构树状结构
* @returns {Promise
}
*/
getDeptTree:async function () {
try {
- // 查询所有部门
+ // 查询所有组织机构
const allDepts = await prisma.dept.findMany();
// 构建树状结构
@@ -262,19 +289,19 @@ const Dept = {
.filter((dept) => dept.parentId === parentId)
.map((dept) => ({
...dept,
- children: buildTree(dept.deptId), // 递归获取子部门
+ children: buildTree(dept.deptId), // 递归获取子组织机构
}));
};
return buildTree();
} catch (error) {
- console.error("获取部门树状结构失败:", error);
+ console.error("获取组织机构树状结构失败:", error);
throw error;
}
},
/**
- * 根据父部门 ID 获取子部门列表
- * @param {number} parentId - 父部门 ID
+ * 根据父组织机构 ID 获取子组织机构列表
+ * @param {number} parentId - 父组织机构 ID
* @returns {Promise}
*/
getChildrenByParentId:async function (parentId = null) {
@@ -284,7 +311,7 @@ const Dept = {
});
return children;
} catch (error) {
- console.error("获取子部门列表失败:", error);
+ console.error("获取子组织机构列表失败:", error);
throw error;
}
},
diff --git a/server/models/deptDocument.js b/server/models/deptDocument.js
index d16be56..0fbf534 100644
--- a/server/models/deptDocument.js
+++ b/server/models/deptDocument.js
@@ -61,8 +61,8 @@ const DeptDocument = {
},
/**
- * 创建部门文档
- * @param {Object} data - 部门文档数据
+ * 创建组织机构文档
+ * @param {Object} data - 组织机构文档数据
* @returns {Promise<{ deptDocument: DeptDocument | null, error: string | null }>}
*/
create: async function (data) {
@@ -94,7 +94,7 @@ const DeptDocument = {
},
/**
- * 更新部门文档
+ * 更新组织机构文档
* @param {number} id - 文档 ID
* @param {Object} updates - 更新的字段
* @returns {Promise<{ success: boolean, error: string | null, deptDocument: DeptDocument | null }>}
@@ -134,7 +134,7 @@ const DeptDocument = {
},
/**
- * 获取部门文档
+ * 获取组织机构文档
* @param {Object} clause - 查询条件
* @returns {Promise<{ deptDocument: DeptDocument | null }>}
*/
@@ -151,7 +151,7 @@ const DeptDocument = {
},
/**
- * 删除部门文档
+ * 删除组织机构文档
* @param {Object} clause - 删除条件
* @returns {Promise}
*/
@@ -168,7 +168,7 @@ const DeptDocument = {
},
/**
- * 查询部门文档列表
+ * 查询组织机构文档列表
* @param {Object} clause - 查询条件
* @param {number} limit - 限制数量
* @returns {Promise}
@@ -204,9 +204,9 @@ const DeptDocument = {
},
/**
- * 检查文档是否属于指定部门
+ * 检查文档是否属于指定组织机构
* @param {number} id - 文档 ID
- * @param {number} deptId - 部门 ID
+ * @param {number} deptId - 组织机构 ID
* @returns {Promise}
*/
checkDocumentBelongsToDept: async function (id, deptId) {
@@ -216,7 +216,7 @@ const DeptDocument = {
});
return !!document;
} catch (error) {
- console.error("检查文档所属部门失败:", error);
+ console.error("检查文档所属组织机构失败:", error);
throw error;
}
},
diff --git a/server/models/deptUsers.js b/server/models/deptUsers.js
index 48eeb38..e978212 100644
--- a/server/models/deptUsers.js
+++ b/server/models/deptUsers.js
@@ -38,8 +38,8 @@ const DeptUsers = {
},
/**
- * 创建部门用户关联
- * @param {Object} data - 部门用户数据
+ * 创建组织机构用户关联
+ * @param {Object} data - 组织机构用户数据
* @returns {Promise<{ deptUser: DeptUser | null, error: string | null }>}
*/
create: async function (data) {
@@ -71,7 +71,7 @@ const DeptUsers = {
},
/**
- * 更新部门用户关联
+ * 更新组织机构用户关联
* @param {number} id - 关联 ID
* @param {Object} updates - 更新的字段
* @returns {Promise<{ success: boolean, error: string | null, deptUser: DeptUser | null }>}
@@ -111,7 +111,7 @@ const DeptUsers = {
},
/**
- * 获取部门用户关联
+ * 获取组织机构用户关联
* @param {Object} clause - 查询条件
* @returns {Promise<{ deptUser: DeptUser | null }>}
*/
@@ -128,7 +128,7 @@ const DeptUsers = {
},
/**
- * 删除部门用户关联
+ * 删除组织机构用户关联
* @param {Object} clause - 删除条件
* @returns {Promise}
*/
@@ -145,7 +145,7 @@ const DeptUsers = {
},
/**
- * 查询部门用户关联列表
+ * 查询组织机构用户关联列表
* @param {Object} clause - 查询条件
* @param {number} limit - 限制数量
* @returns {Promise}