Fix report sample count and decision distribution for scoped runs
This commit is contained in:
1 parent
7d15f3834d
commit
1fb61f794e
1 file changed
+10
-4
@@ -177,8 +177,8 @@ function fillInline(text: string, data: ReportData, ctx: FillContext): string {
|
||||
/综合失准共 \d+ 单(\d+(?:\.\d+)?%)/g,
|
||||
`综合失准共 ${wrong} 单(${(100 - Number(formulaPct)).toFixed(2)}%)`
|
||||
);
|
||||
result = result.replace(/\*\*\d+ 单\*\*的深度稽核中/g, `**${total} 单**的深度稽核中`);
|
||||
result = result.replace(/\d+ 单的深度稽核中/g, `${total} 单的深度稽核中`);
|
||||
result = result.replace(/\*\*\d+ 单\*\*的深度(稽核|复核)中/g, `**${total} 单**的深度$1中`);
|
||||
result = result.replace(/\d+ 单的深度(稽核|复核)中/g, `${total} 单的深度$1中`);
|
||||
// 公式代入值:\frac{N}{M} = X% 结构化匹配
|
||||
result = result.replace(
|
||||
/= \\frac\{\d+\}\{\d+\} = \d+(?:\.\d+)?\\?%/g,
|
||||
@@ -190,7 +190,10 @@ function fillInline(text: string, data: ReportData, ctx: FillContext): string {
|
||||
);
|
||||
result = result.replace(/N = 240/g, `N = ${total}`);
|
||||
// 样本总量:真实单量 + 决策分布(无人工明细时只报总样本)
|
||||
const dist = distributionOf(data.blocks);
|
||||
const scopedBlocksForDist = data.notes.mismatchCategoriesAvailable
|
||||
? data.blocks.filter((b) => b.agreement !== "unknown")
|
||||
: data.blocks;
|
||||
const dist = distributionOf(scopedBlocksForDist);
|
||||
result = result.replace(
|
||||
/\*\*\d+ 张\*\*([^)]*)/,
|
||||
`**${total} 张**${dist ? `(${dist})` : ""}`
|
||||
@@ -425,7 +428,10 @@ function replacementRows(
|
||||
// §1.1 数据来源与范围
|
||||
if (columns.includes("项目") && columns.includes("内容") && heading.includes("数据来源")) {
|
||||
if (!perf) return null;
|
||||
const dist = distributionOf(data.blocks) ?? "";
|
||||
const scopedBlocksForDist = data.notes.mismatchCategoriesAvailable
|
||||
? data.blocks.filter((b) => b.agreement !== "unknown")
|
||||
: data.blocks;
|
||||
const dist = distributionOf(scopedBlocksForDist) ?? "";
|
||||
const scopeNote = data.notes.mismatchCategoriesAvailable && data.blocks.length > (perf.approvalCount ?? 0)
|
||||
? `(全月跑批 ${data.blocks.length} 张,其中已完成人工审批闭环 **${perf.approvalCount} 张**:${dist})`
|
||||
: (dist ? `(${dist})` : "");
|
||||
|
||||
Reference in new issue
Block a user