fix(web): tool node number support variable
This commit is contained in:
@@ -52,7 +52,7 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
|
|||||||
const root = $getRoot();
|
const root = $getRoot();
|
||||||
root.clear();
|
root.clear();
|
||||||
|
|
||||||
const parts = value.split(/(\{\{[^}]+\}\}|\n)/);
|
const parts = (value ?? '').split(/(\{\{[^}]+\}\}|\n)/);
|
||||||
let paragraph = $createParagraphNode();
|
let paragraph = $createParagraphNode();
|
||||||
|
|
||||||
parts.forEach(part => {
|
parts.forEach(part => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type FC, useEffect, useState, useMemo } from "react";
|
import { type FC, useEffect, useState, useMemo } from "react";
|
||||||
import { useTranslation } from 'react-i18next'
|
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 type { Suggestion } from '../../Editor/plugin/AutocompletePlugin'
|
||||||
import { getToolMethods, getToolDetail, getTools } from '@/api/tools'
|
import { getToolMethods, getToolDetail, getTools } from '@/api/tools'
|
||||||
import type { ToolType, ToolItem } from '@/views/ToolManagement/types'
|
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')
|
const filterChild = vo.children.filter(child => child.dataType === 'number')
|
||||||
|
|
||||||
if (filterChild.length > 0) {
|
if (filterChild.length > 0) {
|
||||||
list.push({ ...vo, children: filterChild })
|
list.push({ ...vo, disabled: vo.dataType !== 'number', children: filterChild })
|
||||||
} else {
|
} else if (vo.dataType === 'number') {
|
||||||
list.push({ ...vo, children: [] })
|
list.push({ ...vo, children: [] })
|
||||||
}
|
}
|
||||||
} else {
|
} else if (vo.dataType === 'number') {
|
||||||
list.push({ ...vo })
|
list.push({ ...vo })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log('options', options, list)
|
||||||
return list
|
return list
|
||||||
}, [options])
|
}, [options])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user