diff --git a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx index eea3c583e5..51d2ba8353 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx @@ -3,11 +3,12 @@ import { useMemo, } from 'react' import { useTranslation } from 'react-i18next' -import type { ComparisonOperator } from '../types' +import { ComparisonOperator } from '../types' import { comparisonOperatorNotRequireValue, isComparisonOperatorNeedTranslate, } from '../utils' +import { FILE_TYPE_OPTIONS, TRANSFER_METHOD } from '../default' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import { Env } from '@/app/components/base/icons/src/vender/line/others' import cn from '@/utils/classnames' @@ -41,6 +42,23 @@ const ConditionValue = ({ }) }, [notHasValue, value]) + const isSelect = operator === ComparisonOperator.in || operator === ComparisonOperator.notIn + const selectName = useMemo(() => { + if (isSelect) { + const name = [...FILE_TYPE_OPTIONS, ...TRANSFER_METHOD].filter(item => item.value === value)[0] + return name + ? t(`workflow.nodes.ifElse.optionName.${name.i18nKey}`).replace(/{{#([^#]*)#}}/g, (a, b) => { + const arr: string[] = b.split('.') + if (isSystemVar(arr)) + return `{{${b}}}` + + return `{{${arr.slice(1).join('.')}}}` + }) + : '' + } + return '' + }, [isSelect, t, value]) + return (