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("active", app.study?.ct_number === study.ct_number);
card.classList.toggle("complete", status === "complete"); card.classList.toggle("complete", status === "complete");
const name = study.source_patient_name || study.patient_name_dicom || "无姓名"; 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)) .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(""); .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() const exportControls = isAdmin()
? ` ? `
<span class="study-export-btn" role="button" tabindex="0" title="选择序列导出" aria-label="选择序列导出"> <span class="study-export-btn" role="button" tabindex="0" title="选择序列导出" aria-label="选择序列导出">
@@ -459,16 +471,18 @@ function renderStudies() {
</span> </span>
` `
: ""; : "";
card.title = cardTitle;
card.setAttribute("aria-label", cardTitle);
card.innerHTML = ` card.innerHTML = `
<div class="study-card-status-stack"> <div class="study-card-status-stack">
<i class="study-status-badge status-${status}" title="点击切换为${nextStatusLabel}">${studyStatusLabel(status)}</i> <i class="study-status-badge status-${status}" title="点击切换为${nextStatusLabel}">${studyStatusLabel(status)}</i>
<div class="study-part-tags">${partTags}</div> <div class="study-part-tags">${partTags}</div>
</div> </div>
<strong>${escapeHtml(study.ct_number)}</strong> <strong title="${escapeHtml(study.ct_number)}">${escapeHtml(study.ct_number)}</strong>
<span class="study-patient">${escapeHtml(name)} · ${escapeHtml(study.patient_id || "无ID")}</span> <span class="study-patient" title="${escapeHtml(`${name} · ${study.patient_id || "无ID"}`)}">${escapeHtml(name)} · ${escapeHtml(study.patient_id || "无ID")}</span>
<div class="study-meta"> <div class="study-meta">
<span>${escapeHtml(fmtDate(study.study_date))} ${escapeHtml(fmtTime(study.study_time))}</span> <span title="${escapeHtml(studyDateTime)}">${escapeHtml(studyDateTime)}</span>
<span>${Number(study.dicom_file_count || 0)} 张 · ${Number(study.annotated_series || 0)} 个序列已标注,${Number(study.unannotated_series || 0)} 个序列未标注</span> <span title="${escapeHtml(annotationSummary)}">${escapeHtml(annotationSummary)}</span>
</div> </div>
${exportControls} ${exportControls}
`; `;

View File

@@ -1001,13 +1001,18 @@ button:disabled {
} }
.phase-options { .phase-options {
display: grid; display: flex;
grid-template-columns: repeat(4, minmax(100px, 1fr));
gap: 8px; gap: 8px;
overflow-x: auto;
padding-bottom: 2px;
} }
.chest-window-options { .phase-options label {
grid-template-columns: repeat(3, minmax(110px, 1fr)); flex: 0 0 126px;
}
.chest-window-options label {
flex-basis: 132px;
} }
.annotation-actions { .annotation-actions {