From e057e3bd8bfec98e8778528c7f4ba613c56c04c3 Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 3 Oct 2026 13:59:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(flow-editor):=20ApprovalNode=20=E5=A2=9E?= =?UTF-8?q?=E5=A4=9A=E5=87=BA=E5=8F=A3=20outlets/branches=EF=BC=8C?= =?UTF-8?q?=E9=81=8D=E5=8E=86=E9=93=BE=E8=B7=AF=E6=89=93=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flow/admin/def-editor/model.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/views/flow/admin/def-editor/model.ts b/src/views/flow/admin/def-editor/model.ts index c61ae5b..4faa476 100644 --- a/src/views/flow/admin/def-editor/model.ts +++ b/src/views/flow/admin/def-editor/model.ts @@ -28,6 +28,10 @@ export interface ApprovalNode { countersign: Countersign; /** 办理时限(小时):null=不限,生成 JSON 时省略 */ deadlineHours: number | null; + /** 多出口(≥2 才有多出口语义):出口按钮文案,办理人按下哪个按钮走哪条泳道;单出口不写字段 */ + outlets?: string[]; + /** 各出口泳道(与 outlets 一一对应);分支尾隐式汇合到后继节点(同条件分支,无 JOIN) */ + branches?: EditorItem[][]; } /** 抄送节点(2026-09-23):瞬时知会,不产生待办;receivers 复用审批人结构(DEPT_KEY/USERS) */ @@ -192,9 +196,12 @@ export interface ContainerRef { items: EditorItem[]; } -/** 容器型节点(并行/条件分支)的分支数组取用(resolveContainer/removeItem 等共用口径) */ +/** 容器型节点(并行/条件分支/多出口审批)的分支数组取用(resolveContainer/removeItem 等共用口径) */ export function branchesOf(item: EditorItem | null): EditorItem[][] | null { - if (item && (item.kind === "parallel" || item.kind === "condition")) return item.branches; + if (item && (item.kind === "parallel" || item.kind === "condition" + || (item.kind === "approval" && item.branches && item.branches.length))) { + return item.branches; + } return null; } @@ -336,6 +343,8 @@ export interface EditorCtx { /** 添加分支(并行/条件分支容器通用;条件分支同步补一个占位出口名) */ addBranch: (containerUid: string) => void; removeBranch: (containerUid: string, index: number) => void; + /** 退出多出口(多出口审批泳道头部按钮):仅保留出口①泳道内容 */ + exitOutlets: (uid: string) => void; } export const EDITOR_CTX: InjectionKey = Symbol("flowDefEditorCtx");