fix: workflow file upload refresh (#3088)
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { pluginSystemModuleTemplates } from '@fastgpt/global/core/workflow/template/constants';
|
import { pluginSystemModuleTemplates } from '@fastgpt/global/core/workflow/template/constants';
|
||||||
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
|
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
|
||||||
import { v1Workflow2V2 } from '@/web/core/workflow/adapt';
|
import { v1Workflow2V2 } from '@/web/core/workflow/adapt';
|
||||||
import WorkflowContextProvider, { WorkflowContext } from '../WorkflowComponents/context';
|
import { ReactFlowCustomProvider, WorkflowContext } from '../WorkflowComponents/context';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { AppContext, TabEnum } from '../context';
|
import { AppContext, TabEnum } from '../context';
|
||||||
import { useMount } from 'ahooks';
|
import { useMount } from 'ahooks';
|
||||||
@@ -13,7 +13,6 @@ import dynamic from 'next/dynamic';
|
|||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
|
||||||
import Flow from '../WorkflowComponents/Flow';
|
import Flow from '../WorkflowComponents/Flow';
|
||||||
import { ReactFlowProvider } from 'reactflow';
|
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
|
|
||||||
const Logs = dynamic(() => import('../Logs/index'));
|
const Logs = dynamic(() => import('../Logs/index'));
|
||||||
@@ -67,11 +66,9 @@ const WorkflowEdit = () => {
|
|||||||
|
|
||||||
const Render = () => {
|
const Render = () => {
|
||||||
return (
|
return (
|
||||||
<ReactFlowProvider>
|
<ReactFlowCustomProvider templates={pluginSystemModuleTemplates}>
|
||||||
<WorkflowContextProvider basicNodeTemplates={pluginSystemModuleTemplates}>
|
<WorkflowEdit />
|
||||||
<WorkflowEdit />
|
</ReactFlowCustomProvider>
|
||||||
</WorkflowContextProvider>
|
|
||||||
</ReactFlowProvider>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
|
|||||||
if (canUploadFiles) {
|
if (canUploadFiles) {
|
||||||
!repeatKey &&
|
!repeatKey &&
|
||||||
onChangeNode({
|
onChangeNode({
|
||||||
nodeId: pluginInputNode.id,
|
nodeId: pluginInputNode.nodeId,
|
||||||
type: 'addOutput',
|
type: 'addOutput',
|
||||||
value: {
|
value: {
|
||||||
...userFilesInput,
|
...userFilesInput,
|
||||||
@@ -159,7 +159,7 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
|
|||||||
} else {
|
} else {
|
||||||
repeatKey &&
|
repeatKey &&
|
||||||
onChangeNode({
|
onChangeNode({
|
||||||
nodeId: pluginInputNode.id,
|
nodeId: pluginInputNode.nodeId,
|
||||||
type: 'delOutput',
|
type: 'delOutput',
|
||||||
key: userFilesInput.key
|
key: userFilesInput.key
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -247,14 +247,14 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
|
|||||||
if (canUploadFiles) {
|
if (canUploadFiles) {
|
||||||
!repeatKey &&
|
!repeatKey &&
|
||||||
onChangeNode({
|
onChangeNode({
|
||||||
nodeId: workflowStartNode.id,
|
nodeId: workflowStartNode.nodeId,
|
||||||
type: 'addOutput',
|
type: 'addOutput',
|
||||||
value: userFilesInput
|
value: userFilesInput
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
repeatKey &&
|
repeatKey &&
|
||||||
onChangeNode({
|
onChangeNode({
|
||||||
nodeId: workflowStartNode.id,
|
nodeId: workflowStartNode.nodeId,
|
||||||
type: 'delOutput',
|
type: 'delOutput',
|
||||||
key: userFilesInput.key
|
key: userFilesInput.key
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user