fix(trace): 科室视图抄送行遮蔽——新增 utils/flowTrace.ts(collapseCcRows 按 nodeId#round 折叠 CC 行记 ccCount、ccActorText 科室显 deptName‖短码/其余显"抄送对象"、不回落姓名;user/缺省档原引用直返);TraceTimeline/InstanceBody 三视图接折叠与 CC 分支(时间线由组件内折叠、节点/列表走 displayTrace 防二次折叠);EmbedInstance 头部补流程 nodeSummary。真机三视图走查并入全流程重走 P2-E
build / build (push) Successful in 1m57s
build / build (push) Successful in 1m57s
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* 轨迹口径工具(三视图 + 嵌入页共用,2026-10-12):
|
||||
* 抄送(CC)在库里与轨迹里是"逐接收人一条"(FlowEngine.notifyReceivers 逐人落 flw_cc)。
|
||||
* 人员视图下正需如此(能看出抄送给了谁);但科室视图不列姓名,N 个接收人若逐行渲染就是
|
||||
* N 行一模一样的文案,故 dept 档按「节点 + 轮次」折叠为一行并记人数——口径对齐
|
||||
* /oapi/flow/progress 的 ccSteps(本就按 nodeId 聚合)。
|
||||
*/
|
||||
|
||||
/** dept 档折叠抄送行:同 nodeId + 同轮次的 CC 行合并为一行(ccCount 记人数);其余行原样、顺序不变。 */
|
||||
export function collapseCcRows(trace: any[], mode?: string): any[] {
|
||||
if (mode !== "dept") return trace;
|
||||
const out: any[] = [];
|
||||
const at: Record<string, number> = {};
|
||||
for (const r of trace) {
|
||||
if (r.kind !== "CC") {
|
||||
out.push(r);
|
||||
continue;
|
||||
}
|
||||
const key = `${r.nodeId}#${r.round || 1}`;
|
||||
const i = at[key];
|
||||
if (i === undefined) {
|
||||
at[key] = out.length;
|
||||
out.push({ ...r, ccCount: 1 });
|
||||
} else {
|
||||
out[i].ccCount += 1;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** dept 档抄送行角色词:科室抄送显科室名(解析不出退短码)、指定人抄送显"抄送对象",多人加人数后缀。
|
||||
* ⚠️ 刻意不回落 assigneeName——本函数存在的意义就是不出现人名。 */
|
||||
export function ccActorText(row: any): string {
|
||||
const base = row.assigneeType === "DEPT_KEY"
|
||||
? (row.deptName || row.deptKey || "抄送对象")
|
||||
: "抄送对象";
|
||||
return (row.ccCount || 1) > 1 ? `${base} ${row.ccCount} 人` : base;
|
||||
}
|
||||
Reference in New Issue
Block a user