single file

This commit is contained in:
StyleZhang 2024-09-20 17:20:28 +08:00
parent 4ed46e3fed
commit ab19fccf3d
2 changed files with 20 additions and 2 deletions

View File

@ -157,7 +157,21 @@ const FormItem: FC<Props> = ({
/>
)
}
{(type === InputVarType.singleFile || type === InputVarType.multiFiles) && (
{(type === InputVarType.singleFile) && (
<FileUploaderInAttachmentWrapper
onChange={(files) => {
if (files.length)
onChange(getProcessedFiles(files)[0])
}}
fileConfig={{
allowed_file_types: payload.allowed_file_types,
allowed_file_extensions: payload.allowed_file_extensions,
allowed_file_upload_methods: payload.allowed_file_upload_methods,
number_limits: 1,
}}
/>
)}
{(type === InputVarType.multiFiles) && (
<FileUploaderInAttachmentWrapper
onChange={files => onChange(getProcessedFiles(files))}
fileConfig={{

View File

@ -19,7 +19,11 @@ const UserInput = () => {
const variables = startNode?.data.variables || []
const handleValueChange = (variable: string, v: string) => {
workflowStore.getState().setInputs({
const {
inputs,
setInputs,
} = workflowStore.getState()
setInputs({
...inputs,
[variable]: v,
})