mirror of
https://github.com/labring/FastGPT.git
synced 2026-02-28 01:02:28 +08:00
fix: workflow batch repeat run (#6186)
* stop design doc * remove invalid doc * perf: auto fit * fix: icon * perf: icon * perf: icon * perf: icon * perf: icon * perf: variable disabled input ui * fix: workflow batch run * fix: tsc
This commit is contained in:
@@ -35,6 +35,7 @@ const LabelAndFormRender = ({
|
||||
placeholder,
|
||||
inputType,
|
||||
showValueType,
|
||||
isUnChange,
|
||||
...props
|
||||
}: {
|
||||
label: string | React.ReactNode;
|
||||
@@ -45,6 +46,7 @@ const LabelAndFormRender = ({
|
||||
fieldName: string;
|
||||
|
||||
isDisabled?: boolean;
|
||||
isUnChange?: boolean;
|
||||
minLength?: number;
|
||||
} & SpecificProps &
|
||||
BoxProps) => {
|
||||
@@ -98,7 +100,7 @@ const LabelAndFormRender = ({
|
||||
inputType={inputType}
|
||||
isRichText={false}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
onChange={isUnChange ? undefined : onChange}
|
||||
placeholder={placeholder}
|
||||
isInvalid={!!error}
|
||||
{...props}
|
||||
|
||||
@@ -101,7 +101,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
{...commonProps}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
onChange({
|
||||
onChange?.({
|
||||
value: val,
|
||||
secret: ''
|
||||
});
|
||||
@@ -165,7 +165,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
return (
|
||||
<Switch
|
||||
isChecked={value}
|
||||
onChange={(e) => onChange(e.target.checked)}
|
||||
onChange={(e) => onChange?.(e.target.checked)}
|
||||
isDisabled={isDisabled}
|
||||
/>
|
||||
);
|
||||
@@ -186,7 +186,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
h={10}
|
||||
list={list}
|
||||
value={value}
|
||||
onSelect={onChange}
|
||||
onSelect={(e) => onChange?.(e)}
|
||||
isSelectAll={isSelectAll}
|
||||
itemWrap
|
||||
/>
|
||||
@@ -217,7 +217,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
return (
|
||||
<FileSelector
|
||||
value={files}
|
||||
onChange={onChange}
|
||||
onChange={(e) => onChange?.(e)}
|
||||
isDisabled={isDisabled}
|
||||
maxFiles={props.maxFiles}
|
||||
canSelectFile={props.canSelectFile}
|
||||
@@ -251,7 +251,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
list={list ?? []}
|
||||
value={selectedValues}
|
||||
onSelect={(selectedVals) => {
|
||||
onChange(
|
||||
onChange?.(
|
||||
selectedVals.map((val) => {
|
||||
const selectedItem = list?.find((item) => item.value === val);
|
||||
return {
|
||||
@@ -274,7 +274,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
return (
|
||||
<TimeInput
|
||||
value={val ? new Date(val) : undefined}
|
||||
onDateTimeChange={(date) => onChange(date ? date.toISOString() : undefined)}
|
||||
onDateTimeChange={(date) => onChange?.(date ? date.toISOString() : undefined)}
|
||||
timeGranularity={props.timeGranularity}
|
||||
minDate={timeRangeStart ? new Date(timeRangeStart) : undefined}
|
||||
maxDate={timeRangeEnd ? new Date(timeRangeEnd) : undefined}
|
||||
@@ -297,7 +297,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
onDateTimeChange={(date) => {
|
||||
const newArray = [...rangeArray];
|
||||
newArray[0] = date ? date.toISOString() : undefined;
|
||||
onChange(newArray);
|
||||
onChange?.(newArray);
|
||||
}}
|
||||
timeGranularity={props.timeGranularity}
|
||||
maxDate={
|
||||
@@ -315,7 +315,7 @@ const InputRender = (props: InputRenderProps) => {
|
||||
onDateTimeChange={(date) => {
|
||||
const newArray = [...rangeArray];
|
||||
newArray[1] = date ? date.toISOString() : undefined;
|
||||
onChange(newArray);
|
||||
onChange?.(newArray);
|
||||
}}
|
||||
timeGranularity={props.timeGranularity}
|
||||
minDate={
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { SelectedDatasetType } from '@fastgpt/global/core/workflow/type/io'
|
||||
type CommonRenderProps = {
|
||||
placeholder?: string;
|
||||
value: any;
|
||||
onChange: (value: any) => void;
|
||||
onChange?: (value: any) => void;
|
||||
|
||||
isDisabled?: boolean;
|
||||
isInvalid?: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useMemo, useState, useEffect } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { type UseFormReturn } from 'react-hook-form';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { Box, Button, Card, Flex } from '@chakra-ui/react';
|
||||
@@ -73,7 +73,7 @@ const VariableInputForm = ({
|
||||
internalVariableList.length > 0 ||
|
||||
externalVariableList.length > 0;
|
||||
|
||||
const isDisabled = chatType === ChatTypeEnum.log;
|
||||
const isUnChange = chatType === ChatTypeEnum.log;
|
||||
|
||||
return hasVariables ? (
|
||||
<Box py={3}>
|
||||
@@ -105,7 +105,7 @@ const VariableInputForm = ({
|
||||
return (
|
||||
<LabelAndFormRender
|
||||
{...item}
|
||||
isDisabled={isDisabled}
|
||||
isUnChange={isUnChange}
|
||||
key={item.key}
|
||||
placeholder={item.description}
|
||||
inputType={variableInputTypeToInputType(item.type, item.valueType)}
|
||||
@@ -148,7 +148,7 @@ const VariableInputForm = ({
|
||||
return (
|
||||
<LabelAndFormRender
|
||||
{...item}
|
||||
isDisabled={isDisabled}
|
||||
isUnChange={isUnChange}
|
||||
key={item.key}
|
||||
placeholder={item.description}
|
||||
inputType={variableInputTypeToInputType(item.type, item.valueType)}
|
||||
@@ -190,7 +190,7 @@ const VariableInputForm = ({
|
||||
return (
|
||||
<LabelAndFormRender
|
||||
{...item}
|
||||
isDisabled={isDisabled}
|
||||
isUnChange={isUnChange}
|
||||
key={item.key}
|
||||
placeholder={item.description}
|
||||
inputType={variableInputTypeToInputType(item.type)}
|
||||
|
||||
Reference in New Issue
Block a user