mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 08:56:47 +08:00
### What problem does this PR solve? Fix: Fixed the issue of retrieval operator text overlapping #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -8,9 +8,7 @@ import { FormSchemaType } from './schema';
|
||||
|
||||
function convertToObject(list: FormSchemaType['arguments'] = []) {
|
||||
return list.reduce<Record<string, string>>((pre, cur) => {
|
||||
if (cur.name && cur.type) {
|
||||
pre[cur.name] = cur.type;
|
||||
}
|
||||
pre[cur.name] = cur.type;
|
||||
|
||||
return pre;
|
||||
}, {});
|
||||
|
||||
@ -41,18 +41,21 @@ type ConditionCardsProps = {
|
||||
parentLength: number;
|
||||
} & IOperatorForm;
|
||||
|
||||
const OperatorIcon = function OperatorIcon({
|
||||
export const LogicalOperatorIcon = function OperatorIcon({
|
||||
icon,
|
||||
value,
|
||||
}: Omit<(typeof SwitchOperatorOptions)[0], 'label'>) {
|
||||
return (
|
||||
<IconFont
|
||||
name={icon}
|
||||
className={cn('size-4', {
|
||||
'rotate-180': value === '>',
|
||||
})}
|
||||
></IconFont>
|
||||
);
|
||||
if (typeof icon === 'string') {
|
||||
return (
|
||||
<IconFont
|
||||
name={icon}
|
||||
className={cn('size-4', {
|
||||
'rotate-180': value === '>',
|
||||
})}
|
||||
></IconFont>
|
||||
);
|
||||
}
|
||||
return icon;
|
||||
};
|
||||
|
||||
function useBuildSwitchOperatorOptions() {
|
||||
@ -61,7 +64,12 @@ function useBuildSwitchOperatorOptions() {
|
||||
const switchOperatorOptions = useMemo(() => {
|
||||
return SwitchOperatorOptions.map((x) => ({
|
||||
value: x.value,
|
||||
icon: <OperatorIcon icon={x.icon} value={x.value}></OperatorIcon>,
|
||||
icon: (
|
||||
<LogicalOperatorIcon
|
||||
icon={x.icon}
|
||||
value={x.value}
|
||||
></LogicalOperatorIcon>
|
||||
),
|
||||
label: t(`flow.switchOperatorOptions.${x.label}`),
|
||||
}));
|
||||
}, [t]);
|
||||
|
||||
Reference in New Issue
Block a user