修复伦理与启动管理的显示问题
This commit is contained in:
Vendored
+2
-2
@@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CTMS</title>
|
||||
<script type="module" crossorigin src="/assets/index-BJ37HHdy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DNzNq5qy.css">
|
||||
<script type="module" crossorigin src="/assets/index-B28dIBQG.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Dvp__k11.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -101,6 +101,23 @@ import { exportAuditCsv } from "../../audit/export/auditExportService";
|
||||
import { logAudit } from "../../audit";
|
||||
import { displayDateTime } from "../../utils/display";
|
||||
|
||||
const buildLogKey = (log: any) => {
|
||||
if (log.id) return `id:${log.id}`;
|
||||
return `${log.action || log.eventType || "event"}-${log.entity_id || log.entityId || ""}-${log.created_at || log.timestamp || ""}`;
|
||||
};
|
||||
|
||||
const dedupeLogs = (list: any[]) => {
|
||||
const seen = new Set<string>();
|
||||
const result: any[] = [];
|
||||
list.forEach((log) => {
|
||||
const key = buildLogKey(log);
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
result.push(log);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
const study = useStudyStore();
|
||||
const auth = useAuthStore();
|
||||
const router = useRouter();
|
||||
@@ -163,7 +180,7 @@ const loadLogs = async () => {
|
||||
const { data } = await fetchAuditLogs(study.currentStudy.id, params);
|
||||
const items = Array.isArray(data) ? data : (data as any).items || [];
|
||||
const local = loadLocalLogs();
|
||||
const merged = [...items, ...local];
|
||||
const merged = dedupeLogs([...items, ...local]);
|
||||
rawLogs.value = merged;
|
||||
total.value = (data as any).total || merged.length;
|
||||
enrichLogs();
|
||||
@@ -233,7 +250,7 @@ const fetchAllForExport = async () => {
|
||||
const { data } = await fetchAuditLogs(study.currentStudy.id, params);
|
||||
const items = Array.isArray(data) ? data : (data as any).items || [];
|
||||
const local = loadLocalLogs();
|
||||
const merged = [...items, ...local];
|
||||
const merged = dedupeLogs([...items, ...local]);
|
||||
const userMap = users.value.reduce<Record<string, string>>((acc, cur) => {
|
||||
acc[cur.id] = cur.username;
|
||||
return acc;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-descriptions-item label="项目名称">{{ project.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申办方">{{ project.sponsor || "—" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">{{ statusLabel(project.status) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ project.created_at || "—" }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ displayDateTime(project.created_at) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-skeleton v-else :rows="4" animated />
|
||||
</el-card>
|
||||
@@ -48,6 +48,7 @@ import { fetchStudyDetail } from "../../api/studies";
|
||||
import type { Study } from "../../types/api";
|
||||
import AttachmentList from "../../components/attachments/AttachmentList.vue";
|
||||
import { useStudyStore } from "../../store/study";
|
||||
import { displayDateTime } from "../../utils/display";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user