Merge branch 'develop' into fix/stream_zy

This commit is contained in:
yingzhao
2026-04-21 20:30:12 +08:00
committed by GitHub
59 changed files with 1857 additions and 1613 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-24 17:57:08
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-14 16:33:33
* @Last Modified time: 2026-04-20 15:33:48
*/
/*
* Runtime Component
@@ -187,7 +187,7 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({
{['input', 'output'].map(key => (
<div key={key} className="rb:bg-[#EBEBEB] rb:rounded-lg">
<div className="rb:py-2 rb:px-3 rb:flex rb:justify-between rb:items-center rb:text-[12px]">
{isLoop ? t(`workflow.runtime.${key}_cycle_vars`) : t(`workflow.${key}`)}
{isLoop ? t(`workflow.runtime.${key}_cycle_vars`) : t(`workflow.${key}_result`)}
<Button
className="rb:py-0! rb:px-1! rb:text-[12px]!"
size="small"

View File

@@ -11,12 +11,14 @@ interface MappingListProps {
options: Suggestion[];
extra?: ReactNode;
valueKey?: string;
isNeedType?: boolean;
}
const MappingList: FC<MappingListProps> = ({ label, name, options, extra, valueKey = 'value' }) => {
const MappingList: FC<MappingListProps> = ({ label, name: listName, options, extra, valueKey = 'value', isNeedType = false }) => {
const { t } = useTranslation()
const form = Form.useFormInstance()
return (
<>
<Form.List name={name}>
<Form.List name={listName}>
{(fields, { add, remove }) => (
<>
<Flex align="center" justify="space-between" className="rb:mb-2!">
@@ -59,8 +61,13 @@ const MappingList: FC<MappingListProps> = ({ label, name, options, extra, valueK
options={options}
size="small"
className="rb:flex-1!"
onChange={isNeedType ? (_val, option) => {
const dataType = (option as Suggestion | undefined)?.dataType
form.setFieldValue([listName, name, 'type'], dataType)
} : undefined}
/>
</Form.Item>
{isNeedType && <Form.Item name={[name, 'type']} hidden />}
<div
className="rb:size-4 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/workflow/deleteBg.svg')] rb:hover:bg-[url('@/assets/images/workflow/deleteBg_hover.svg')]"
onClick={() => remove(name)}

View File

@@ -38,6 +38,7 @@ import RbCard from '@/components/RbCard/Card';
import ModelConfig from './ModelConfig'
import ModelSelect from '@/components/ModelSelect'
import ListOperator from './ListOperator'
import MappingList from "./MappingList";
/**
* Props for Properties component
@@ -807,6 +808,15 @@ const Properties: FC<PropertiesProps> = ({
</Form.Item>
)
}
if (config.type === 'mappingList') {
return <MappingList
key={key}
label={t(`workflow.config.${selectedNode?.data?.type}.${key}`)}
name={key}
options={variableList}
isNeedType={config.isNeedType as boolean}
/>
}
if (key === 'vision_input' && !values?.vision) {
return null
@@ -906,7 +916,6 @@ const Properties: FC<PropertiesProps> = ({
}
});
console.log('list', list)
return list
}
// Filter child nodes for iteration output
@@ -960,7 +969,7 @@ const Properties: FC<PropertiesProps> = ({
<div className="rb:text-[12px] rb:leading-4.5">
<Flex gap={8} vertical>
<Flex align="center" className="rb:font-medium rb:cursor-pointer" onClick={handleToggle}>
{t('workflow.config.output')}
{t('workflow.config.outputVariable')}
<div
className={clsx("rb:size-3 rb:bg-cover rb:bg-[url('@/assets/images/common/caret_right_outlined.svg')]", {
'rb:rotate-90': !outputCollapsed

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 15:06:18
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-16 17:52:30
* @Last Modified time: 2026-04-21 18:23:31
*/
import LoopNode from './components/Nodes/LoopNode';
import NormalNode from './components/Nodes/NormalNode';
@@ -72,6 +72,15 @@ export const nodeLibrary: NodeLibrary[] = [
}
}
},
{ type: "output", icon: 'rb:bg-[url("@/assets/images/workflow/output.svg")]',
config: {
outputs: {
type: 'mappingList',
required: true,
isNeedType: true
}
}
},
// { type: "answer", icon: answerIcon },
]
},