diff --git a/web/components/flow/node-renderer/codeEditor.tsx b/web/components/flow/node-renderer/codeEditor.tsx
index eed5ec256..3aeeb9b6b 100644
--- a/web/components/flow/node-renderer/codeEditor.tsx
+++ b/web/components/flow/node-renderer/codeEditor.tsx
@@ -2,9 +2,6 @@ import React, { useState, useMemo } from 'react';
import { Button, Modal } from 'antd';
import Editor from '@monaco-editor/react';
import { IFlowNodeParameter } from '@/types/flow';
-// import { MonacoEditor } from '../../chat/monaco-editor';
-// import { github, githubDark } from './ob-editor/theme';
-import { github, githubDark } from '../../chat/ob-editor/theme';
type Props = {
data: IFlowNodeParameter;
@@ -14,6 +11,7 @@ type Props = {
export const RenderCodeEditor = (params: Props) => {
const { data, defaultValue, onChange } = params;
+ const attr = convertKeysToCamelCase(data.ui?.attr || {});
const [isModalOpen, setIsModalOpen] = useState(false);
const showModal = () => {
@@ -37,8 +35,10 @@ export const RenderCodeEditor = (params: Props) => {
return '80%';
}, [data?.ui?.editor?.width]);
+
+
return (
-
+
@@ -47,7 +47,7 @@ export const RenderCodeEditor = (params: Props) => {
{...data?.ui?.attr}
width={data?.ui?.editor?.width || '100%'}
value={defaultValue}
- style={{padding:'10px'}}
+ style={{ padding: '10px' }}
height={data?.ui?.editor?.height || 200}
defaultLanguage={data?.ui?.language}
onChange={onChange}
@@ -59,39 +59,7 @@ export const RenderCodeEditor = (params: Props) => {
wordWrap: 'on',
}}
/>
-
- {/* {
- console.log(value);
- onChange(value)
- }}
- options={{
- theme: {github}, // 编辑器主题颜色
- folding: true, // 是否折叠
- foldingHighlight: true, // 折叠等高线
- foldingStrategy: 'indentation', // 折叠方式 auto | indentation
- showFoldingControls: 'always', // 是否一直显示折叠 always | mouseover
- disableLayerHinting: true, // 等宽优化
- emptySelectionClipboard: false, // 空选择剪切板
- selectionClipboard: false, // 选择剪切板
- automaticLayout: true, // 自动布局
- codeLens: false, // 代码镜头
- scrollBeyondLastLine: false, // 滚动完最后一行后再滚动一屏幕
- colorDecorators: true, // 颜色装饰器
- accessibilitySupport: 'auto', // 辅助功能支持 "auto" | "off" | "on"
- lineNumbers: 'on', // 行号 取值: "on" | "off" | "relative" | "interval" | function
- lineNumbersMinChars: 5, // 行号最小字符 number
- readOnly: false, //是否只读 取值 true | false
- }}
- /> */}
-
);
};
diff --git a/web/components/flow/node-renderer/textarea.tsx b/web/components/flow/node-renderer/textarea.tsx
index 5f8c55ac0..a2f0df4aa 100644
--- a/web/components/flow/node-renderer/textarea.tsx
+++ b/web/components/flow/node-renderer/textarea.tsx
@@ -13,10 +13,11 @@ type TextAreaProps = {
export const RenderTextArea = (params: TextAreaProps) => {
const { data, defaultValue, onChange } = params;
convertKeysToCamelCase(data?.ui?.attr?.autosize || {});
+ const attr = convertKeysToCamelCase(data.ui?.attr || {});
return (
-
);
};
diff --git a/web/components/flow/node-renderer/tree-select.tsx b/web/components/flow/node-renderer/tree-select.tsx
index 7acc3d73a..d2a4400d6 100644
--- a/web/components/flow/node-renderer/tree-select.tsx
+++ b/web/components/flow/node-renderer/tree-select.tsx
@@ -3,86 +3,30 @@ import { TreeSelect } from 'antd';
import type { TreeSelectProps } from 'antd';
import { IFlowNodeParameter } from '@/types/flow';
import { Label } from '@mui/icons-material';
+import { convertKeysToCamelCase } from '@/utils/flow';
type TextAreaProps = {
data: IFlowNodeParameter;
defaultValue: any;
onChange: (value: any) => void;
};
-const treeData = [
- {
- value: 'parent 1',
- title: 'parent 1',
- children: [
- {
- value: 'parent 1-0',
- title: 'parent 1-0',
- children: [
- {
- value: 'leaf1',
- title: 'leaf1',
- },
- {
- value: 'leaf2',
- title: 'leaf2',
- },
- {
- value: 'leaf3',
- title: 'leaf3',
- },
- {
- value: 'leaf4',
- title: 'leaf4',
- },
- {
- value: 'leaf5',
- title: 'leaf5',
- },
- {
- value: 'leaf6',
- title: 'leaf6',
- },
- ],
- },
- {
- value: 'parent 1-1',
- title: 'parent 1-1',
- children: [
- {
- value: 'leaf11',
- title:
leaf11,
- },
- ],
- },
- ],
- },
-];
export const RenderTreeSelect = (params: TextAreaProps) => {
const { data, defaultValue, onChange } = params;
- // console.log(data.options);
- // const [value, setValue] = useState
();
+ const attr = convertKeysToCamelCase(data.ui?.attr || {});
- // const onChange = (newValue: string) => {
- // setValue(newValue);
- // };
const [dropdownVisible, setDropdownVisible] = useState(false);
const handleDropdownVisibleChange = (visible: boolean | ((prevState: boolean) => boolean)) => {
setDropdownVisible(visible);
-
- // 你可以在这里执行更多的逻辑,比如发送请求、更新状态等
- console.log('Dropdown is now:', visible ? 'visible' : 'hidden');
- };
-
- const focus = () => {
- // console.log('focus==========');
};
+ console.log(data);
+
return (