fix(web): tool node number support variable

This commit is contained in:
zhaoying
2026-04-07 17:33:56 +08:00
parent 5d439346a1
commit be8c481d6d
2 changed files with 6 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
const root = $getRoot();
root.clear();
const parts = value.split(/(\{\{[^}]+\}\}|\n)/);
const parts = (value ?? '').split(/(\{\{[^}]+\}\}|\n)/);
let paragraph = $createParagraphNode();
parts.forEach(part => {

View File

@@ -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])