Treat unregistered monitor check title as placeholder
This commit is contained in:
@@ -1594,7 +1594,7 @@ function rootCauseText(item) {
|
||||
}
|
||||
|
||||
function findingTitle(item) {
|
||||
const dynamicTitle = safeUserText(item?.displayTitleZh || item?.errorTitleZh || item?.timeoutDisplay?.titleZh);
|
||||
const dynamicTitle = safeDisplayTitle(item?.displayTitleZh, item?.errorTitleZh, item?.timeoutDisplay?.titleZh);
|
||||
if (dynamicTitle) return dynamicTitle;
|
||||
const display = checkDisplay(item);
|
||||
if (display.title) return display.title;
|
||||
@@ -1763,12 +1763,20 @@ function safeDetailValue(value) {
|
||||
return text.length > 0 ? text : "-";
|
||||
}
|
||||
|
||||
function safeDisplayTitle(...values) {
|
||||
for (const value of values) {
|
||||
const title = safeUserText(value);
|
||||
if (title && title !== "未登记监测项") return title;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function checkDisplay(item) {
|
||||
const rawCode = rawCheckCode(item);
|
||||
const rawId = rawFindingId(item);
|
||||
const serviceCode = publicCheckCode(item?.checkCode || item?.check?.code);
|
||||
const detailEvidence = item?.detail?.sentinelEvidence && typeof item.detail.sentinelEvidence === "object" ? item.detail.sentinelEvidence : {};
|
||||
const dynamicTitle = safeUserText(item?.displayTitleZh || item?.errorTitleZh || item?.timeoutDisplay?.titleZh || detailEvidence.displayTitleZh);
|
||||
const dynamicTitle = safeDisplayTitle(item?.displayTitleZh, item?.errorTitleZh, item?.timeoutDisplay?.titleZh, detailEvidence.displayTitleZh);
|
||||
return {
|
||||
code: serviceCode || publicCheckCode(rawId || rawCode) || stableCheckCode(rawCode || rawId),
|
||||
title: dynamicTitle || safeUserText(item?.checkTitleZh || item?.check?.titleZh) || "未登记监测项",
|
||||
|
||||
Reference in New Issue
Block a user