From ec810afd1408a1c0b1732ca2f10cc074c75b7598 Mon Sep 17 00:00:00 2001 From: chenxing Date: Mon, 12 Oct 2026 20:45:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(trace):=20=E7=A7=91=E5=AE=A4=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=8A=84=E9=80=81=E8=A1=8C=E9=81=AE=E8=94=BD=E2=80=94?= =?UTF-8?q?=E2=80=94=E6=96=B0=E5=A2=9E=20utils/flowTrace.ts=EF=BC=88collap?= =?UTF-8?q?seCcRows=20=E6=8C=89=20nodeId#round=20=E6=8A=98=E5=8F=A0=20CC?= =?UTF-8?q?=20=E8=A1=8C=E8=AE=B0=20ccCount=E3=80=81ccActorText=20=E7=A7=91?= =?UTF-8?q?=E5=AE=A4=E6=98=BE=20deptName=E2=80=96=E7=9F=AD=E7=A0=81/?= =?UTF-8?q?=E5=85=B6=E4=BD=99=E6=98=BE"=E6=8A=84=E9=80=81=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1"=E3=80=81=E4=B8=8D=E5=9B=9E=E8=90=BD=E5=A7=93?= =?UTF-8?q?=E5=90=8D=EF=BC=9Buser/=E7=BC=BA=E7=9C=81=E6=A1=A3=E5=8E=9F?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=9B=B4=E8=BF=94=EF=BC=89=EF=BC=9BTraceTime?= =?UTF-8?q?line/InstanceBody=20=E4=B8=89=E8=A7=86=E5=9B=BE=E6=8E=A5?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E4=B8=8E=20CC=20=E5=88=86=E6=94=AF=EF=BC=88?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BA=BF=E7=94=B1=E7=BB=84=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E3=80=81=E8=8A=82=E7=82=B9/=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=B5=B0=20displayTrace=20=E9=98=B2=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=EF=BC=89=EF=BC=9BEmbedInstance=20=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E8=A1=A5=E6=B5=81=E7=A8=8B=20nodeSummary=E3=80=82?= =?UTF-8?q?=E7=9C=9F=E6=9C=BA=E4=B8=89=E8=A7=86=E5=9B=BE=E8=B5=B0=E6=9F=A5?= =?UTF-8?q?=E5=B9=B6=E5=85=A5=E5=85=A8=E6=B5=81=E7=A8=8B=E9=87=8D=E8=B5=B0?= =?UTF-8?q?=20P2-E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/flowTrace.ts | 38 +++++++++++++++++++++ src/views/flow/EmbedInstance.vue | 12 +++++-- src/views/flow/components/InstanceBody.vue | 18 +++++++--- src/views/flow/components/TraceTimeline.vue | 12 +++++-- 4 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 src/utils/flowTrace.ts diff --git a/src/utils/flowTrace.ts b/src/utils/flowTrace.ts new file mode 100644 index 0000000..5011475 --- /dev/null +++ b/src/utils/flowTrace.ts @@ -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 = {}; + 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; +} diff --git a/src/views/flow/EmbedInstance.vue b/src/views/flow/EmbedInstance.vue index cc3c12c..0a28d48 100644 --- a/src/views/flow/EmbedInstance.vue +++ b/src/views/flow/EmbedInstance.vue @@ -60,8 +60,13 @@ onMounted(async () => {