mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
Concat textinput to input type (#2963)
* perf: toast position * concat textinput to input
This commit is contained in:
@@ -36,7 +36,7 @@ export const defaultVariable: VariableItemType = {
|
||||
id: nanoid(),
|
||||
key: '',
|
||||
label: '',
|
||||
type: VariableInputEnum.textInput,
|
||||
type: VariableInputEnum.input,
|
||||
description: '',
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
@@ -73,10 +73,7 @@ const VariableEdit = ({
|
||||
const inputTypeList = useMemo(
|
||||
() =>
|
||||
Object.values(variableMap)
|
||||
.filter(
|
||||
(item) =>
|
||||
item.value !== VariableInputEnum.input && item.value !== VariableInputEnum.textarea
|
||||
)
|
||||
.filter((item) => item.value !== VariableInputEnum.textarea)
|
||||
.map((item) => ({
|
||||
icon: item.icon,
|
||||
label: t(item.label as any),
|
||||
|
@@ -60,12 +60,13 @@ export const VariableInputItem = ({
|
||||
{item.description && <QuestionTip ml={1} label={item.description} />}
|
||||
</Box>
|
||||
{item.type === VariableInputEnum.input && (
|
||||
<Input
|
||||
maxLength={item.maxLength || 4000}
|
||||
<PromptEditor
|
||||
value={item.defaultValue}
|
||||
onChange={(e) => setValue(item.key, e)}
|
||||
bg={'myGray.50'}
|
||||
{...register(item.key, {
|
||||
required: item.required
|
||||
})}
|
||||
minH={40}
|
||||
maxH={150}
|
||||
showOpenModal={false}
|
||||
/>
|
||||
)}
|
||||
{item.type === VariableInputEnum.textarea && (
|
||||
@@ -78,16 +79,7 @@ export const VariableInputItem = ({
|
||||
maxLength={item.maxLength || 4000}
|
||||
/>
|
||||
)}
|
||||
{item.type === VariableInputEnum.textInput && (
|
||||
<PromptEditor
|
||||
value={item.defaultValue}
|
||||
onChange={(e) => setValue(item.key, e)}
|
||||
bg={'myGray.50'}
|
||||
minH={50}
|
||||
maxH={150}
|
||||
showOpenModal={false}
|
||||
/>
|
||||
)}
|
||||
|
||||
{item.type === VariableInputEnum.select && (
|
||||
<Controller
|
||||
key={item.key}
|
||||
|
@@ -221,13 +221,12 @@ const RenderUserFormInteractive = React.memo(function RenderFormInput({
|
||||
{input.description && <QuestionTip ml={1} label={input.description} />}
|
||||
</Flex>
|
||||
{input.type === FlowNodeInputTypeEnum.input && (
|
||||
<Input
|
||||
bg={'white'}
|
||||
maxLength={input.maxLength}
|
||||
isDisabled={interactive.params.submitted}
|
||||
{...register(input.label, {
|
||||
required: input.required
|
||||
})}
|
||||
<PromptEditor
|
||||
value={input.value}
|
||||
onChange={(e) => setValue(input.label, e)}
|
||||
minH={40}
|
||||
maxH={100}
|
||||
showOpenModal={false}
|
||||
/>
|
||||
)}
|
||||
{input.type === FlowNodeInputTypeEnum.textarea && (
|
||||
@@ -241,15 +240,6 @@ const RenderUserFormInteractive = React.memo(function RenderFormInput({
|
||||
maxLength={input.maxLength || 4000}
|
||||
/>
|
||||
)}
|
||||
{input.type === FlowNodeInputTypeEnum.textInput && (
|
||||
<PromptEditor
|
||||
value={input.value}
|
||||
onChange={(e) => setValue(input.label, e)}
|
||||
minH={40}
|
||||
maxH={100}
|
||||
showOpenModal={false}
|
||||
/>
|
||||
)}
|
||||
{input.type === FlowNodeInputTypeEnum.numberInput && (
|
||||
<NumberInput
|
||||
step={1}
|
||||
|
Reference in New Issue
Block a user