From 16717a086786759288f8e34514e9eeddbb5193f4 Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 3 Oct 2026 14:06:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(flow-editor):=20=E5=A4=9A=E5=87=BA?= =?UTF-8?q?=E5=8F=A3=E5=AE=A1=E6=89=B9=E5=AE=9E=E6=97=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=88=E9=9D=9E=E7=A9=BA=E5=94=AF=E4=B8=80/=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=B8=8A=E9=99=90/=E6=B3=B3=E9=81=93=E9=80=92?= =?UTF-8?q?=E5=BD=92=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flow/admin/def-editor/validate.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/views/flow/admin/def-editor/validate.ts b/src/views/flow/admin/def-editor/validate.ts index 99f6dba..a50e52e 100644 --- a/src/views/flow/admin/def-editor/validate.ts +++ b/src/views/flow/admin/def-editor/validate.ts @@ -55,6 +55,26 @@ export function validateModel(model: EditorModel, depts: DeptOption[], routers: } else if (!a.userIds.length) { push(item.uid, "error", path, "指定用户不能为空"); } + if (item.outlets && item.outlets.length >= 2) { + if (item.outlets.length > MAX_BRANCHES) { + push(item.uid, "error", path, `出口数最多 ${MAX_BRANCHES} 个`); + } + item.outlets.forEach((o, i) => { + if (!o.trim()) { + push(item.uid, "error", path, `第 ${i + 1} 个出口的按钮文案不能为空`); + } else if (item.outlets!.indexOf(o) !== i) { + push(item.uid, "error", path, `出口文案重复:「${o}」(按钮文案必须唯一)`); + } + }); + (item.branches || []).forEach((branch, i) => { + const p = `${path}·出口「${item.outlets![i] || i + 1}」`; + if (!branch.length) { + push(item.uid, "error", p, "出口泳道为空,请添加节点"); + return; + } + rec(branch, p); + }); + } return; }