mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 15:41:05 +00:00
compatible with old enums\ (#5221)
This commit is contained in:
@@ -385,7 +385,7 @@ const TableItem = ({
|
||||
onClick={() => {
|
||||
const formattedItem = {
|
||||
...item,
|
||||
list: item.enums || []
|
||||
list: item.enums?.map((item) => ({ label: item.value, value: item.value })) || []
|
||||
};
|
||||
reset(formattedItem);
|
||||
}}
|
||||
|
@@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
|
||||
}
|
||||
|
||||
if (inputType === InputTypeEnum.select) {
|
||||
return <MySelect {...commonProps} list={props.list || []} h={10} />;
|
||||
const list =
|
||||
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
|
||||
return <MySelect {...commonProps} list={list} h={10} />;
|
||||
}
|
||||
|
||||
if (inputType === InputTypeEnum.multipleSelect) {
|
||||
const { list = [] } = props;
|
||||
const list =
|
||||
props.list || props.enums?.map((item) => ({ label: item.value, value: item.value })) || [];
|
||||
return (
|
||||
<MultipleSelect<string>
|
||||
{...commonProps}
|
||||
|
@@ -40,6 +40,9 @@ type SpecificProps =
|
||||
// select & multipleSelect
|
||||
inputType: InputTypeEnum.select | InputTypeEnum.multipleSelect;
|
||||
list?: { label: string; value: string }[];
|
||||
|
||||
// old version
|
||||
enums?: { value: string }[];
|
||||
}
|
||||
| {
|
||||
// JSONEditor
|
||||
|
Reference in New Issue
Block a user