口径卡分母为 0 时算不出来就是空值,和「缺少输入」分开说;指标清单按格式渲染。助手节点手册讲口径卡的那段写明分母可能为 0 时写「… if 分母 else None」、不要写 else 0,附示例;画布校验加一条提醒 metrics.zero_for_undefined(按语法树认:条件表达式一边有除法、另一边是常量 0,两边对调、套在 round 里、嵌套的都认)。输入都齐、计算式自己交回空值的指标多记 undefined: true(状态仍是 missing_input,按状态认的地方和老运行不受影响),清单、写作目录、引用解析不了的原因、运行对比、证据面板都说「算不出来(这组输入下计算式没有值,比如分母为 0)」;推演把它当不带值的字段。指标清单({{ nodes.卡.text }})改用卡上渲染好的 rendered:比率 0.0007 显示成 0.07%、金额带千分位,和报告里 [[m:]] 一致;有值却显示不出来的照实说,不拼原值

This commit is contained in:
ThearchyHelios
2026-10-20 10:04:53 +08:00
parent 8ce578042c
commit 301bbd55f3
12 changed files with 291 additions and 8 deletions
+8 -1
View File
@@ -1361,6 +1361,8 @@ function MetricPart({ step, entry, inputs, runId, runClass, seal, pending, faile
// 口径卡里 rendered 为「—」有两种:value 为 null 是缺输入,不为 null 是有值但按格式显示不出来
const dash = rendered === NONE || entry?.rendered === NONE
const missing = entry?.status === 'missing_input' || (value == null && (dash || !resolved))
// 没有值的两种:缺输入,和输入都齐、计算式自己算不出来(分母为 0,口径卡记了 undefined)
const undefinedValue = missing && (step?.undefined === true || entry?.undefined === true)
const unshowable = !missing && dash && value != null
// 拿截断的查询结果整组算出来的:值是真的算出来的,但只算到了取回的那部分,出具已按缺口降档
const incomplete = step?.incomplete === true || entry?.incomplete === true
@@ -1416,7 +1418,12 @@ function MetricPart({ step, entry, inputs, runId, runClass, seal, pending, faile
)}
{dualCheck && <DualCheckLine check={dualCheck} formal={runClass === 'formal'} />}
<Integrity step={step} seal={seal} />
{missing && <p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-missing="">{EVIDENCE_TEXT.missingValue}</p>}
{missing && (
<p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-missing=""
{...(undefinedValue ? { 'data-ev-undefined': '' } : {})}>
{undefinedValue ? EVIDENCE_TEXT.undefinedValue : EVIDENCE_TEXT.missingValue}
</p>
)}
{incomplete && (
<p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-incomplete-reason="">{incompleteReason}</p>
)}