fix: flow type

This commit is contained in:
archer
2023-07-28 15:41:50 +08:00
parent fb8635a951
commit a77e3880f4
4 changed files with 11 additions and 7 deletions

View File

@@ -17,8 +17,8 @@ const ContextModal = ({
isOpen={true}
onClose={onClose}
title={`完整对话记录(${context.length}条)`}
minW={['90vw', '600px']}
h={['90vh', '80vh']}
minW={['90vw', '600px']}
isCentered
>
<ModalBody pt={0} whiteSpace={'pre-wrap'} textAlign={'justify'} fontSize={'sm'}>

View File

@@ -76,7 +76,6 @@ const QuoteModal = ({
</>
}
>
<ModalCloseButton />
<ModalBody pt={0} whiteSpace={'pre-wrap'} textAlign={'justify'} fontSize={'sm'}>
{rawSearch.map((item) => (
<Box

View File

@@ -7,7 +7,6 @@ import Divider from '../modules/Divider';
import Container from '../modules/Container';
import RenderInput from '../render/RenderInput';
import type { ClassifyQuestionAgentItemType } from '@/types/app';
import { Handle, Position } from 'reactflow';
import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 4);
import MyIcon from '@/components/Icon';

View File

@@ -16,7 +16,8 @@ import {
edgeOptions,
connectionLineStyle,
FlowModuleTypeEnum,
FlowInputItemTypeEnum
FlowInputItemTypeEnum,
FlowValueTypeEnum
} from '@/constants/flow';
import { appModule2FlowNode, appModule2FlowEdge } from '@/utils/adapt';
import {
@@ -231,9 +232,14 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
);
const onConnect = useCallback(
({ connect }: { connect: Connection }) => {
const sourceType = nodes
.find((node) => node.id === connect.source)
?.data?.outputs.find((output) => output.key === connect.sourceHandle)?.valueType;
const source = nodes.find((node) => node.id === connect.source)?.data;
const sourceType = (() => {
if (source?.flowType === FlowModuleTypeEnum.classifyQuestion) {
return FlowValueTypeEnum.boolean;
}
return source?.outputs.find((output) => output.key === connect.sourceHandle)?.valueType;
})();
const targetType = nodes
.find((node) => node.id === connect.target)
?.data?.inputs.find((input) => input.key === connect.targetHandle)?.valueType;