审计日志并入系统管理、规范项目成员获取逻辑

This commit is contained in:
Cheng Zhou
2025-12-26 14:57:57 +08:00
parent 7c9befc3c9
commit 71db309e12
17 changed files with 94 additions and 116 deletions
@@ -51,7 +51,7 @@ import { formatFileSize } from "./attachmentUtils";
import { useAuthStore } from "../../store/auth";
import { useStudyStore } from "../../store/study";
import { listMembers } from "../../api/members";
import { displayDateTime, displayUser } from "../../utils/display";
import { displayDateTime, displayUser, getMemberDisplayName, getUserDisplayName } from "../../utils/display";
const props = defineProps<{
studyId: string;
@@ -90,12 +90,12 @@ const loadMembers = async () => {
const uploaderLabel = (row: any) => {
const memberMap = members.value.reduce<Record<string, string>>((acc, cur) => {
const username = cur?.user?.display_name || cur?.user?.username || cur?.username;
if (cur?.user_id) acc[cur.user_id] = username || cur.user_id;
const username = getMemberDisplayName(cur);
if (cur?.user_id && username) acc[cur.user_id] = username;
return acc;
}, {});
if (row?.uploaded_by && typeof row.uploaded_by === "object") {
return row.uploaded_by.display_name || row.uploaded_by.username || row.uploaded_by.id || "—";
return getUserDisplayName(row.uploaded_by) || row.uploaded_by.id || "—";
}
return displayUser(row.uploaded_by_id || row.uploaded_by, { members: memberMap });
};