diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index 5df9c05fe6..2ee5722d48 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -40,6 +40,7 @@ export type ISelectProps = { overlayClassName?: string optionWrapClassName?: string optionClassName?: string + hideChecked?: boolean renderOption?: ({ item, selected, @@ -177,6 +178,7 @@ const SimpleSelect: FC = ({ placeholder, optionWrapClassName, optionClassName, + hideChecked, renderOption, }) => { const { t } = useTranslation() @@ -257,7 +259,7 @@ const SimpleSelect: FC = ({ ? renderOption({ item, selected }) : (<> {item.name} - {selected && ( + {selected && !hideChecked && ( { const newCondition = produce(condition, (draft) => { draft.key = key + if (key === 'size') + draft.varType = VarType.number + else + draft.varType = VarType.string + draft.comparison_operator = getOperators(undefined, { key })[0] }) + onUpdateSubVariableCondition?.(caseId, conditionId, condition.id, newCondition) }, [caseId, condition, conditionId, onUpdateSubVariableCondition]) @@ -179,6 +185,7 @@ const ConditionItem = ({ :
{t('common.placeholder.select')}
)} + hideChecked /> ) : ( @@ -195,7 +202,7 @@ const ConditionItem = ({ varType={condition.varType} value={condition.comparison_operator} onSelect={handleUpdateConditionOperator} - file={file} + file={isSubVariableKey ? { key: condition.key! } : file} /> {