Skip to content

Commit

Permalink
Merge pull request baidu#10477 from 2betop/chore-condition-builder
Browse files Browse the repository at this point in the history
chore: condition-builder 非预设类型渲染时也转成走自定义类型渲染逻辑
  • Loading branch information
hsm-lv authored Jun 19, 2024
2 parents 97244e3 + ccbe8ae commit f910ae9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/amis-ui/src/components/condition-builder/Value.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {SelectWithRemoteOptions as Select} from '../Select';
import Switch from '../Switch';
import {FormulaPicker, FormulaPickerProps} from '../formula/Picker';
import type {OperatorType} from 'amis-core';
import omit from 'lodash/omit';

export interface ValueProps extends ThemeProps, LocaleProps {
value: any;
Expand Down Expand Up @@ -198,6 +199,20 @@ export class Value extends React.Component<ValueProps> {
onChange,
inputSettings: field
});
} else {
// 不支持的也转给自定义组件处理
input = this.renderCustomValue({
value: value ?? (field as any).defaultValue,
onChange,
inputSettings: {
value: omit(field, [
'label',
'operators',
'defaultOp',
'defaultValue'
])
}
});
}

return <div className={cx('CBValue')}>{input}</div>;
Expand Down

0 comments on commit f910ae9

Please sign in to comment.