diff --git a/packages/amis-editor/src/renderer/textarea-formula/FormulaPicker.tsx b/packages/amis-editor/src/renderer/textarea-formula/FormulaPicker.tsx index b1fc8ca24..a3d0167f7 100644 --- a/packages/amis-editor/src/renderer/textarea-formula/FormulaPicker.tsx +++ b/packages/amis-editor/src/renderer/textarea-formula/FormulaPicker.tsx @@ -1,9 +1,10 @@ import React, {useEffect} from 'react'; import {Modal, Button} from 'amis'; +import {FormControlProps} from 'amis-core'; import cx from 'classnames'; import FormulaEditor from 'amis-ui/lib/components/formula/Editor'; -export interface FormulaPickerProps { +export interface FormulaPickerProps extends FormControlProps { onConfirm: (data: string | undefined) => void; onClose: () => void; variables: any[]; @@ -43,6 +44,9 @@ const FormulaPicker: React.FC = props => { props.onConfirm && props.onConfirm(formula); }; + // 自身字段 + const selfName = props?.data?.name; + return ( = props => { value={formula} evalMode={evalMode} onChange={handleChange} + selfVariableName={selfName} /> diff --git a/packages/amis-ui/scss/components/form/_selection.scss b/packages/amis-ui/scss/components/form/_selection.scss index 98e4ae9a1..89b3406e8 100644 --- a/packages/amis-ui/scss/components/form/_selection.scss +++ b/packages/amis-ui/scss/components/form/_selection.scss @@ -217,6 +217,7 @@ &-item { position: relative; + margin-bottom: 2px; } &-item.is-expanded > &-sublist { display: block;