mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
Fix workflow detail (#3382)
* fix: loop node init * fix: workflow detail * fix: point table * add null check
This commit is contained in:
@@ -193,6 +193,18 @@ export const MultipleRowArraySelect = ({
|
||||
ref: ref,
|
||||
handler: onClose
|
||||
});
|
||||
const onChange = useCallback(
|
||||
(val: any[][]) => {
|
||||
// Filter invalid value
|
||||
const validList = val.filter((item) => {
|
||||
const listItem = list.find((v) => v.value === item[0]);
|
||||
if (!listItem) return false;
|
||||
return listItem.children?.some((v) => v.value === item[1]);
|
||||
});
|
||||
onSelect(validList);
|
||||
},
|
||||
[onSelect]
|
||||
);
|
||||
|
||||
const RenderList = useCallback(
|
||||
({ index, list }: { index: number; list: MultipleSelectProps['list'] }) => {
|
||||
@@ -213,9 +225,9 @@ export const MultipleRowArraySelect = ({
|
||||
const newValue = [parentValue, item.value];
|
||||
|
||||
if (newValues.some((v) => v[0] === parentValue && v[1] === item.value)) {
|
||||
onSelect(newValues.filter((v) => !(v[0] === parentValue && v[1] === item.value)));
|
||||
onChange(newValues.filter((v) => !(v[0] === parentValue && v[1] === item.value)));
|
||||
} else {
|
||||
onSelect([...newValues, newValue]);
|
||||
onChange([...newValues, newValue]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user