('input[type="radio"]');
+ expect(Array.from(radios).every((radio) => !radio.checked)).toBe(true);
+ expect(host.querySelector('[role="alert"]')?.textContent).toContain('配置无效');
+
+ await unmount(app);
+ });
+});
diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte
index c73185b5..1d25d466 100644
--- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte
+++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte
@@ -15,6 +15,13 @@
import {getCurrentNodeId} from '#components/utils/NodeUtils';
import type {TinyflowNodeData} from '#types';
import {useTinyflowNodeSizeObserver} from '../utils/nodeSizeObserver';
+ import {useTinyflowStore} from '#store/stores.svelte';
+ import NodeJoinModeSetting from './NodeJoinModeSetting.svelte';
+ import {
+ analyzeJoinMode,
+ getJoinModeBadge,
+ type JoinMode,
+ } from '../utils/joinMode';
const {
data,
@@ -52,13 +59,22 @@
const activeKeys = $derived.by(() => data.expand ? ['key'] : []);
const { updateNodeData, getNode } = useSvelteFlow();
+ const store = useTinyflowStore();
const updateNodeInternals = useUpdateNodeInternals();
+ const joinModeAnalysis = $derived.by(() => analyzeJoinMode(
+ store.getNodes(),
+ store.getEdges(),
+ id,
+ ));
+ const joinModeBadge = $derived(getJoinModeBadge(data.joinMode));
+
const items = $derived.by(() => {
return [{
key: 'key',
icon,
title: data.title as string,
+ badge: joinModeBadge,
titleHelp,
description: data.description as string,
content: children
@@ -87,6 +103,17 @@
const MIN_LOOP_COUNT = 1;
const MAX_LOOP_COUNT = 300;
let loopCountHint = $state('');
+ let advancedConditionOpen = $state(false);
+
+ const updateJoinMode = (joinMode: JoinMode) => {
+ updateNodeData(id, {joinMode});
+ };
+
+ $effect(() => {
+ if (String(data.condition || '').trim()) {
+ advancedConditionOpen = true;
+ }
+ });
const normalizeLoopCount = (value: unknown) => {
const parsed = Number(value);
@@ -210,16 +237,35 @@
}} value={data.description} />
+ {#if joinModeAnalysis.incomingCount > 1}
+
+ {/if}
+
{#if allowSettingOfCondition}
-
- 执行条件:
-
+
+ 高级执行条件
+
+
+
{/if}