mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 12:56:55 +08:00
### What problem does this PR solve? Feat: Reference the output variable of the upstream operator #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -117,13 +117,9 @@ export default function VariablePickerMenuPlugin({
|
||||
|
||||
const [queryString, setQueryString] = React.useState<string | null>('');
|
||||
|
||||
const buildGroupedOptions = useBuildComponentIdSelectOptions(
|
||||
node?.id,
|
||||
node?.parentId,
|
||||
);
|
||||
const options = useBuildComponentIdSelectOptions(node?.id, node?.parentId);
|
||||
|
||||
const buildNextOptions = useCallback(() => {
|
||||
const options = buildGroupedOptions();
|
||||
let filteredOptions = options;
|
||||
|
||||
if (queryString) {
|
||||
@ -150,11 +146,10 @@ export default function VariablePickerMenuPlugin({
|
||||
);
|
||||
|
||||
return nextOptions;
|
||||
}, [buildGroupedOptions, queryString]);
|
||||
}, [options, queryString]);
|
||||
|
||||
const findLabelByValue = useCallback(
|
||||
(value: string) => {
|
||||
const options = buildGroupedOptions();
|
||||
const children = options.reduce<Array<{ label: string; value: string }>>(
|
||||
(pre, cur) => {
|
||||
return pre.concat(cur.options);
|
||||
@ -164,7 +159,7 @@ export default function VariablePickerMenuPlugin({
|
||||
|
||||
return children.find((x) => x.value === value)?.label;
|
||||
},
|
||||
[buildGroupedOptions],
|
||||
[options],
|
||||
);
|
||||
|
||||
const onSelectOption = useCallback(
|
||||
|
||||
@ -4,9 +4,10 @@ import { DeleteOutlined } from '@ant-design/icons';
|
||||
import { Button, Collapse, Flex, Input, Select, Table, TableProps } from 'antd';
|
||||
import { trim } from 'lodash';
|
||||
import { useBuildComponentIdSelectOptions } from '../../hooks/use-get-begin-query';
|
||||
import { IInvokeVariable, RAGFlowNodeType } from '../../interface';
|
||||
import { IInvokeVariable } from '../../interface';
|
||||
import { useHandleOperateParameters } from './hooks';
|
||||
|
||||
import { RAGFlowNodeType } from '@/interfaces/database/flow';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
|
||||
Reference in New Issue
Block a user