mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix: quote settings default value & zindex & i18n (#2931)
This commit is contained in:
@@ -37,7 +37,7 @@ const ButtonEdge = (props: EdgeProps) => {
|
||||
}, [nodeList, source, target]);
|
||||
|
||||
const defaultZIndex = useMemo(
|
||||
() => (nodeList.find((node) => node.nodeId === source && node.parentNodeId) ? 1001 : 0),
|
||||
() => (nodeList.find((node) => node.nodeId === source && node.parentNodeId) ? 2002 : 0),
|
||||
[nodeList, source]
|
||||
);
|
||||
|
||||
@@ -159,7 +159,7 @@ const ButtonEdge = (props: EdgeProps) => {
|
||||
bg={'white'}
|
||||
borderRadius={'17px'}
|
||||
cursor={'pointer'}
|
||||
zIndex={9999}
|
||||
zIndex={defaultZIndex + 1000}
|
||||
onClick={() => onDelConnect(id)}
|
||||
>
|
||||
<MyIcon name={'core/workflow/closeEdge'} w={'100%'}></MyIcon>
|
||||
@@ -173,8 +173,7 @@ const ButtonEdge = (props: EdgeProps) => {
|
||||
pointerEvents={'all'}
|
||||
w={highlightEdge ? '14px' : '10px'}
|
||||
h={highlightEdge ? '14px' : '10px'}
|
||||
// bg={'white'}
|
||||
zIndex={highlightEdge ? 1000 : defaultZIndex}
|
||||
zIndex={highlightEdge ? defaultZIndex + 1000 : defaultZIndex}
|
||||
>
|
||||
<MyIcon
|
||||
name={'core/workflow/edgeArrow'}
|
||||
|
@@ -160,7 +160,6 @@ const Workflow = () => {
|
||||
}
|
||||
: {})}
|
||||
onNodeDragStop={onNodeDragStop}
|
||||
// deleteKeyCode={[]}
|
||||
>
|
||||
<FlowController />
|
||||
<HelperLines horizontal={helperLineHorizontal} vertical={helperLineVertical} />
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import type { RenderInputProps } from '../type';
|
||||
import { Box, BoxProps, Button, Flex, ModalFooter, useDisclosure } from '@chakra-ui/react';
|
||||
import MyModal from '@fastgpt/web/components/common/MyModal';
|
||||
@@ -50,16 +50,23 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);
|
||||
const nodeList = useContextSelector(WorkflowContext, (v) => v.nodeList);
|
||||
|
||||
const { watch, setValue, handleSubmit } = useForm({
|
||||
defaultValues: {
|
||||
const defaultValues = useMemo(() => {
|
||||
return {
|
||||
quoteTemplate:
|
||||
inputs.find((input) => input.key === NodeInputKeyEnum.aiChatQuoteTemplate)?.value || '',
|
||||
quotePrompt:
|
||||
inputs.find((input) => input.key === NodeInputKeyEnum.aiChatQuotePrompt)?.value || '',
|
||||
quoteRole: (inputs.find((input) => input.key === NodeInputKeyEnum.aiChatQuoteRole)?.value ||
|
||||
'system') as AiChatQuoteRoleType
|
||||
}
|
||||
});
|
||||
};
|
||||
}, [inputs]);
|
||||
|
||||
const { watch, setValue, handleSubmit, reset } = useForm({ defaultValues });
|
||||
|
||||
useEffect(() => {
|
||||
reset(defaultValues);
|
||||
}, [defaultValues, reset]);
|
||||
|
||||
const aiChatQuoteTemplate = watch('quoteTemplate');
|
||||
const aiChatQuotePrompt = watch('quotePrompt');
|
||||
const aiChatQuoteRole = watch('quoteRole');
|
||||
|
@@ -123,6 +123,7 @@ export const getEditorVariables = ({
|
||||
const sourceNodeVariables = !sourceNodes
|
||||
? []
|
||||
: sourceNodes
|
||||
.reverse()
|
||||
.map((node) => {
|
||||
return node.outputs
|
||||
.filter((output) => !!output.label)
|
||||
|
Reference in New Issue
Block a user