fix: workflow file upload refresh (#3088)

This commit is contained in:
Archer
2024-11-07 15:04:46 +08:00
committed by archer
parent f1fb85ead0
commit 4d6f736be3
3 changed files with 8 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { pluginSystemModuleTemplates } from '@fastgpt/global/core/workflow/template/constants';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
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 { AppContext, TabEnum } from '../context';
import { useMount } from 'ahooks';
@@ -13,7 +13,6 @@ import dynamic from 'next/dynamic';
import { cloneDeep } from 'lodash';
import Flow from '../WorkflowComponents/Flow';
import { ReactFlowProvider } from 'reactflow';
import { useTranslation } from 'next-i18next';
const Logs = dynamic(() => import('../Logs/index'));
@@ -67,11 +66,9 @@ const WorkflowEdit = () => {
const Render = () => {
return (
<ReactFlowProvider>
<WorkflowContextProvider basicNodeTemplates={pluginSystemModuleTemplates}>
<WorkflowEdit />
</WorkflowContextProvider>
</ReactFlowProvider>
<ReactFlowCustomProvider templates={pluginSystemModuleTemplates}>
<WorkflowEdit />
</ReactFlowCustomProvider>
);
};

View File

@@ -149,7 +149,7 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
if (canUploadFiles) {
!repeatKey &&
onChangeNode({
nodeId: pluginInputNode.id,
nodeId: pluginInputNode.nodeId,
type: 'addOutput',
value: {
...userFilesInput,
@@ -159,7 +159,7 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
} else {
repeatKey &&
onChangeNode({
nodeId: pluginInputNode.id,
nodeId: pluginInputNode.nodeId,
type: 'delOutput',
key: userFilesInput.key
});

View File

@@ -247,14 +247,14 @@ function FileSelectConfig({ chatConfig: { fileSelectConfig }, setAppDetail }: Co
if (canUploadFiles) {
!repeatKey &&
onChangeNode({
nodeId: workflowStartNode.id,
nodeId: workflowStartNode.nodeId,
type: 'addOutput',
value: userFilesInput
});
} else {
repeatKey &&
onChangeNode({
nodeId: workflowStartNode.id,
nodeId: workflowStartNode.nodeId,
type: 'delOutput',
key: userFilesInput.key
});