From be8c481d6daa780f18dfc346b606f65834dbe990 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 7 Apr 2026 17:33:56 +0800 Subject: [PATCH] fix(web): tool node number support variable --- .../components/Editor/plugin/InitialValuePlugin.tsx | 2 +- .../Workflow/components/Properties/ToolConfig/index.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx b/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx index 9a3eaa94..ebccff50 100644 --- a/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx +++ b/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx @@ -52,7 +52,7 @@ const InitialValuePlugin: React.FC = ({ value, options const root = $getRoot(); root.clear(); - const parts = value.split(/(\{\{[^}]+\}\}|\n)/); + const parts = (value ?? '').split(/(\{\{[^}]+\}\}|\n)/); let paragraph = $createParagraphNode(); parts.forEach(part => { diff --git a/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx b/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx index 7857eb23..ba1e9a5f 100644 --- a/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx +++ b/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx @@ -1,6 +1,6 @@ import { type FC, useEffect, useState, useMemo } from "react"; import { useTranslation } from 'react-i18next' -import { Form, Select, InputNumber, Switch, Cascader, type CascaderProps, Tooltip } from 'antd' +import { Form, Select, Switch, Cascader, type CascaderProps, Tooltip } from 'antd' import type { Suggestion } from '../../Editor/plugin/AutocompletePlugin' import { getToolMethods, getToolDetail, getTools } from '@/api/tools' import type { ToolType, ToolItem } from '@/views/ToolManagement/types' @@ -171,14 +171,15 @@ const ToolConfig: FC<{ options: Suggestion[]; }> = ({ const filterChild = vo.children.filter(child => child.dataType === 'number') if (filterChild.length > 0) { - list.push({ ...vo, children: filterChild }) - } else { + list.push({ ...vo, disabled: vo.dataType !== 'number', children: filterChild }) + } else if (vo.dataType === 'number') { list.push({ ...vo, children: [] }) } - } else { + } else if (vo.dataType === 'number') { list.push({ ...vo }) } }) + console.log('options', options, list) return list }, [options])