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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user