Tighten study card and phase layout

This commit is contained in:
Codex
2026-05-27 14:46:08 +08:00
parent 2a858be166
commit 8212d3b819
2 changed files with 29 additions and 10 deletions

View File

@@ -446,10 +446,22 @@ function renderStudies() {
card.classList.toggle("active", app.study?.ct_number === study.ct_number);
card.classList.toggle("complete", status === "complete");
const name = study.source_patient_name || study.patient_name_dicom || "无姓名";
const partTags = asList(study.body_parts)
const bodyPartLabels = asList(study.body_parts)
.filter((part) => BODY_PARTS.includes(part))
.map((part) => `<em>${escapeHtml(partLabel(part))}</em>`)
.map((part) => partLabel(part));
const partTags = bodyPartLabels
.map((label) => `<em title="${escapeHtml(label)}">${escapeHtml(label)}</em>`)
.join("");
const studyDateTime = `${fmtDate(study.study_date)} ${fmtTime(study.study_time)}`.trim() || "未记录时间";
const annotationSummary = `${Number(study.annotated_series || 0)} 个序列已标注,${Number(study.unannotated_series || 0)} 个序列未标注`;
const cardTitle = [
`检查号:${study.ct_number}`,
`患者:${name} · ${study.patient_id || "无ID"}`,
`时间:${studyDateTime}`,
`DICOM${Number(study.dicom_file_count || 0)}`,
annotationSummary,
`部位:${bodyPartLabels.join("、") || "无"}`,
].join("\n");
const exportControls = isAdmin()
? `
<span class="study-export-btn" role="button" tabindex="0" title="选择序列导出" aria-label="选择序列导出">
@@ -459,16 +471,18 @@ function renderStudies() {
</span>
`
: "";
card.title = cardTitle;
card.setAttribute("aria-label", cardTitle);
card.innerHTML = `
<div class="study-card-status-stack">
<i class="study-status-badge status-${status}" title="点击切换为${nextStatusLabel}">${studyStatusLabel(status)}</i>
<div class="study-part-tags">${partTags}</div>
</div>
<strong>${escapeHtml(study.ct_number)}</strong>
<span class="study-patient">${escapeHtml(name)} · ${escapeHtml(study.patient_id || "无ID")}</span>
<strong title="${escapeHtml(study.ct_number)}">${escapeHtml(study.ct_number)}</strong>
<span class="study-patient" title="${escapeHtml(`${name} · ${study.patient_id || "无ID"}`)}">${escapeHtml(name)} · ${escapeHtml(study.patient_id || "无ID")}</span>
<div class="study-meta">
<span>${escapeHtml(fmtDate(study.study_date))} ${escapeHtml(fmtTime(study.study_time))}</span>
<span>${Number(study.dicom_file_count || 0)} 张 · ${Number(study.annotated_series || 0)} 个序列已标注,${Number(study.unannotated_series || 0)} 个序列未标注</span>
<span title="${escapeHtml(studyDateTime)}">${escapeHtml(studyDateTime)}</span>
<span title="${escapeHtml(annotationSummary)}">${escapeHtml(annotationSummary)}</span>
</div>
${exportControls}
`;