feat(oa): 评论@人员优先展示同部门用户

OA 评论选人列表改为请求 users/options 时按当前登录用户部门优先排序,Web 与移动 OA 共用后端稳定排序,便于先选到同部门同事。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-11-19 14:24:21 +08:00
1 parent 7751cc0f4a
commit f9aa16ef31
6 files changed
+71 -7

No files matched your search

+6 -3
View File
@@ -22,9 +22,12 @@ export function fetchGetRoleList() {
})
}
/** 流程设计器:用户下拉选项(label=昵称,value=用户ID) */
export function fetchUserOptions(params?: { roleName?: string }) {
return request.get<Array<{ label: string; value: string }>>({
/** 用户下拉选项(label=昵称,value=用户ID;可选 deptId / prioritizeCallerDept) */
export function fetchUserOptions(params?: {
roleName?: string
prioritizeCallerDept?: boolean
}) {
return request.get<Array<{ label: string; value: string; deptId?: string }>>({
url: '/web/admin/users/options',
params
})
@@ -255,7 +255,8 @@
if (userCachePromise) return userCachePromise
userCachePromise = (async () => {
try {
const res = await fetchUserOptions()
// 同部门优先:由后端按当前登录用户部门排序
const res = await fetchUserOptions({ prioritizeCallerDept: true })
const list = Array.isArray(res) ? res : []
const next: MentionUser[] = []
const seen = new Set<string>()