mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 15:11:13 +00:00
fix: var selector (#5593)
* fix: var selector * doc * doc time * doc time * doc time * doc time * doc time * doc time * doc time
This commit is contained in:
@@ -177,7 +177,7 @@ const MultipleRowSelector = ({
|
||||
renderList.find((item) => item.value === (modelData?.provider || 'Other')) ??
|
||||
renderList[renderList.length - 1];
|
||||
|
||||
provider.children.push({
|
||||
provider?.children.push({
|
||||
label: modelData.name,
|
||||
value: modelData.model
|
||||
});
|
||||
|
@@ -147,7 +147,7 @@ const EditForm = ({
|
||||
},
|
||||
[appForm.aiSettings.systemPrompt, setAppForm]
|
||||
);
|
||||
console.log(appForm.chatConfig.fileSelectConfig);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box>
|
||||
|
@@ -111,19 +111,20 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
(item) => item.renderType === updateItem.renderType
|
||||
);
|
||||
|
||||
const onUpdateNewValue = (newValue: any) => {
|
||||
if (isValidReferenceValueFormat(newValue)) {
|
||||
onUpdateList(
|
||||
updateList.map((update, i) =>
|
||||
i === index ? { ...update, value: newValue as ReferenceItemValueType } : update
|
||||
)
|
||||
);
|
||||
} else {
|
||||
const onUpdateNewValue = (newValue?: ReferenceValueType | string) => {
|
||||
if (typeof newValue === 'string') {
|
||||
onUpdateList(
|
||||
updateList.map((update, i) =>
|
||||
i === index ? { ...update, value: ['', newValue] } : update
|
||||
)
|
||||
);
|
||||
} else if (
|
||||
Array.isArray(newValue) &&
|
||||
(isValidReferenceValueFormat(newValue) || newValue.every(isValidReferenceValueFormat))
|
||||
) {
|
||||
onUpdateList(
|
||||
updateList.map((update, i) => (i === index ? { ...update, value: newValue } : update))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -258,6 +258,10 @@ const MultipleReferenceSelector = ({
|
||||
});
|
||||
}, [getSelectValue, value]);
|
||||
|
||||
const invalidList = useMemo(() => {
|
||||
return formatList.filter((item) => item.nodeName && item.outputName);
|
||||
}, [formatList]);
|
||||
|
||||
useEffect(() => {
|
||||
// Adapt array type from old version
|
||||
if (Array.isArray(value) && typeof value[0] === 'string') {
|
||||
@@ -266,10 +270,6 @@ const MultipleReferenceSelector = ({
|
||||
}
|
||||
}, [formatList, onSelect, value]);
|
||||
|
||||
const invalidList = useMemo(() => {
|
||||
return formatList.filter((item) => item.nodeName && item.outputName);
|
||||
}, [formatList]);
|
||||
|
||||
const ArraySelector = useMemo(() => {
|
||||
return (
|
||||
<MultipleRowArraySelect
|
||||
@@ -282,7 +282,7 @@ const MultipleReferenceSelector = ({
|
||||
fontSize={'sm'}
|
||||
_hover={{
|
||||
'.delete': {
|
||||
display: 'block'
|
||||
visibility: 'visible'
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -310,7 +310,7 @@ const MultipleReferenceSelector = ({
|
||||
</Flex>
|
||||
<MyIcon
|
||||
className="delete"
|
||||
display={'none'}
|
||||
visibility={'hidden'}
|
||||
name={'common/closeLight'}
|
||||
w={'1rem'}
|
||||
ml={1}
|
||||
@@ -336,7 +336,9 @@ const MultipleReferenceSelector = ({
|
||||
}
|
||||
value={value as any}
|
||||
list={list}
|
||||
onSelect={onSelect as any}
|
||||
onSelect={(e) => {
|
||||
onSelect(e as any);
|
||||
}}
|
||||
popDirection={popDirection}
|
||||
/>
|
||||
);
|
||||
|
Reference in New Issue
Block a user