fix: preserve monitor check catalog titles

This commit is contained in:
Codex
2026-07-08 08:14:52 +02:00
parent c772a4a351
commit 51d909c567
2 changed files with 14 additions and 5 deletions
@@ -1767,7 +1767,7 @@ function safeDetailValue(value) {
function safeDisplayTitle(...values) {
for (const value of values) {
const title = safeUserText(value);
const title = safeTitleText(value);
if (title && title !== "未登记监测项") return title;
}
return "";
@@ -1820,6 +1820,12 @@ function safeUserText(value) {
return text;
}
function safeTitleText(value) {
const text = String(value || "").replace(/\s+/g, " ").trim();
if (text.length === 0 || text === "未登记监测项") return "";
return text;
}
function detailSummaryText(detail) {
return detailSummaryRows(detail).map((row) => `${row.label}: ${row.value}`).join("\n");
}