mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:28:37 +08:00
Merge branch 'baidu:master' into master
This commit is contained in:
commit
ff82224a90
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user