Merge branch 'baidu:master' into master

This commit is contained in:
刘丹 2022-05-30 19:38:36 +08:00 committed by GitHub
commit ff82224a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View File

@ -367,6 +367,8 @@
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
background-color: #fff;
height: var(--Form-input-height);
&-input {
flex: 1;
@ -424,6 +426,7 @@
.#{$ns}FormulaPicker-input {
display: inline-block;
width: 100%;
height: 100%;
background: none;
padding: 0;
border: 0;
@ -436,7 +439,7 @@
}
.#{$ns}FormulaPicker-toggler {
.icon-function {
transform: scale(1.6);
transform: scale(1.8);
}
.icon-ellipsis-v {
transform: rotate(90deg);

View File

@ -268,13 +268,13 @@ export class FormulaPicker extends React.Component<
classnames: cx,
translate: __,
disabled,
allowInput,
allowInput = true,
className,
onChange,
size,
borderMode,
placeholder,
mode,
mode = 'input-button',
btnLabel,
level,
btnSize,

View File

@ -11,6 +11,10 @@ import {
} from '../../components/WithRemoteConfig';
import {Schema} from '../../types';
import {autobind} from '../../utils/helper';
import {
isPureVariable,
resolveVariableAndFilter
} from '../../utils/tpl-builtin';
/**
*
@ -72,11 +76,23 @@ export default class ConditionBuilderControl extends React.PureComponent<Conditi
render() {
const {className, classnames: cx, ...rest} = this.props;
// 处理一下formula类型值的变量列表
let formula = this.props.formula ? {...this.props.formula} : undefined;
if (formula && formula.variables && isPureVariable(formula.variables)) {
// 如果 variables 是 ${xxx} 这种形式,将其处理成实际的值
formula.variables = resolveVariableAndFilter(
formula.variables,
this.props.data,
'| raw'
);
}
return (
<div className={cx(`ConditionBuilderControl`, className)}>
<ConditionBuilderWithRemoteOptions
renderEtrValue={this.renderEtrValue}
{...rest}
formula={formula}
/>
</div>
);