mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #8910 from wibetter/fix-formula
fix(amis-editor): 修复公式编辑器self标记功能不生效问题
This commit is contained in:
commit
8b529bdc0f
@ -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<FormulaPickerProps> = props => {
|
||||
props.onConfirm && props.onConfirm(formula);
|
||||
};
|
||||
|
||||
// 自身字段
|
||||
const selfName = props?.data?.name;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
className={cx('FormulaPicker-Modal')}
|
||||
@ -60,6 +64,7 @@ const FormulaPicker: React.FC<FormulaPickerProps> = props => {
|
||||
value={formula}
|
||||
evalMode={evalMode}
|
||||
onChange={handleChange}
|
||||
selfVariableName={selfName}
|
||||
/>
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
|
@ -217,6 +217,7 @@
|
||||
|
||||
&-item {
|
||||
position: relative;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
&-item.is-expanded > &-sublist {
|
||||
display: block;
|
||||
|
Loading…
Reference in New Issue
Block a user