mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 22:09:44 +00:00
fix:Description error
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
|||||||
RenderTreeSelect,
|
RenderTreeSelect,
|
||||||
RenderTimePicker,
|
RenderTimePicker,
|
||||||
RenderTextArea,
|
RenderTextArea,
|
||||||
RenderUpdata,
|
RenderUpload,
|
||||||
RenderCodeEditor,
|
RenderCodeEditor,
|
||||||
} from './node-renderer';
|
} from './node-renderer';
|
||||||
import MonacoEditor from '@/components/chat/monaco-editor'
|
import MonacoEditor from '@/components/chat/monaco-editor'
|
||||||
@@ -144,7 +144,7 @@ const NodeParamHandler: React.FC<NodeParamHandlerProps> = ({ node, data, label,
|
|||||||
case 'tree_select':
|
case 'tree_select':
|
||||||
return <RenderTreeSelect {...props} />;
|
return <RenderTreeSelect {...props} />;
|
||||||
case 'upload':
|
case 'upload':
|
||||||
return <RenderUpdata {...props} />;
|
return <RenderUpload {...props} />;
|
||||||
case 'code_editor':
|
case 'code_editor':
|
||||||
return <RenderCodeEditor {...props} />;
|
return <RenderCodeEditor {...props} />;
|
||||||
default:
|
default:
|
||||||
|
@@ -9,4 +9,4 @@ export * from './slider';
|
|||||||
export * from './time-picker';
|
export * from './time-picker';
|
||||||
export * from './tree-select';
|
export * from './tree-select';
|
||||||
export * from './codeEditor';
|
export * from './codeEditor';
|
||||||
export * from './updata';
|
export * from './upload';
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { TreeSelect } from 'antd';
|
import { TreeSelect } from 'antd';
|
||||||
import type { TreeSelectProps } from 'antd';
|
|
||||||
import { IFlowNodeParameter } from '@/types/flow';
|
import { IFlowNodeParameter } from '@/types/flow';
|
||||||
import { Label } from '@mui/icons-material';
|
|
||||||
import { convertKeysToCamelCase } from '@/utils/flow';
|
import { convertKeysToCamelCase } from '@/utils/flow';
|
||||||
|
|
||||||
type TextAreaProps = {
|
type TextAreaProps = {
|
||||||
@@ -14,14 +12,6 @@ export const RenderTreeSelect = (params: TextAreaProps) => {
|
|||||||
const { data, defaultValue, onChange } = params;
|
const { data, defaultValue, onChange } = params;
|
||||||
const attr = convertKeysToCamelCase(data.ui?.attr || {});
|
const attr = convertKeysToCamelCase(data.ui?.attr || {});
|
||||||
|
|
||||||
const [dropdownVisible, setDropdownVisible] = useState(false);
|
|
||||||
|
|
||||||
const handleDropdownVisibleChange = (visible: boolean | ((prevState: boolean) => boolean)) => {
|
|
||||||
setDropdownVisible(visible);
|
|
||||||
};
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-2 text-sm">
|
<div className="p-2 text-sm">
|
||||||
<TreeSelect
|
<TreeSelect
|
||||||
@@ -32,22 +22,7 @@ export const RenderTreeSelect = (params: TextAreaProps) => {
|
|||||||
treeDefaultExpandAll
|
treeDefaultExpandAll
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
treeData={data.options}
|
treeData={data.options}
|
||||||
onDropdownVisibleChange={handleDropdownVisibleChange}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
// TODO: Implement the TreeSelect component
|
|
||||||
// <TreeSelect
|
|
||||||
// showSearch
|
|
||||||
// style={{ width: '100%' }}
|
|
||||||
// value={value}
|
|
||||||
// dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
||||||
// placeholder="Please select"
|
|
||||||
// allowClear
|
|
||||||
// treeDefaultExpandAll
|
|
||||||
// onChange={onChange}
|
|
||||||
// treeData={treeData}
|
|
||||||
// getPopupContainer={() => document.body}
|
|
||||||
// />
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
import type { UploadProps } from 'antd';
|
import type { UploadProps } from 'antd';
|
||||||
import { Button, message, Upload } from 'antd';
|
import { Button, message, Upload } from 'antd';
|
||||||
|
import { convertKeysToCamelCase } from '@/utils/flow';
|
||||||
|
|
||||||
const props: UploadProps = {
|
const props: UploadProps = {
|
||||||
name: 'file',
|
name: 'file',
|
||||||
@@ -21,12 +22,19 @@ const props: UploadProps = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RenderUpdata: React.FC = () => (
|
export const RenderUpload: React.FC = (params) => (
|
||||||
<div style={{textAlign:'center'}} className="p-2 text-sm">
|
const { data, defaultValue, onChange } = params;
|
||||||
<Upload {...props}>
|
|
||||||
<Button icon={<UploadOutlined />}>上传数据</Button>
|
const attr = convertKeysToCamelCase(data.ui?.attr || {});
|
||||||
</Upload>
|
|
||||||
</div>
|
return (
|
||||||
|
<div style={{ textAlign: 'center' }} className="p-2 text-sm">
|
||||||
|
<Upload {...attr} {...props}>
|
||||||
|
<Button icon={<UploadOutlined />}>上传数据</Button>
|
||||||
|
</Upload>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
Reference in New Issue
Block a user