feat: workflow input node add selectMulti; MultipleSelect component (#4527)

* feat: workflow input node add selectMulti; MultipleSelect component add disabled state (#4440)

* perf: input form support multiple select

---------

Co-authored-by: mmagi <magizhang@qq.com>
This commit is contained in:
Archer
2025-04-14 14:39:35 +08:00
committed by GitHub
parent 16a22bc76a
commit 88ed019717
10 changed files with 128 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ import {
UserSelectInteractive,
UserSelectOptionItemType
} from '@fastgpt/global/core/workflow/template/system/interactive/type';
import MultipleSelect from '@fastgpt/web/components/common/MySelect/MultipleSelect';
const DescriptionBox = React.memo(function DescriptionBox({
description
@@ -173,6 +174,30 @@ export const FormInputComponent = React.memo(function FormInputComponent({
}}
/>
);
case FlowNodeInputTypeEnum.multipleSelect:
return (
<Controller
key={label}
control={control}
name={label}
rules={{ required: required }}
render={({ field: { ref, value } }) => {
if (!list) return <></>;
return (
<MultipleSelect<string>
width={'100%'}
bg={'white'}
py={2}
list={list}
value={value}
isDisabled={submitted}
onSelect={(e) => setValue(label, e)}
isSelectAll={value.length === list.length}
/>
);
}}
/>
);
default:
return null;
}