Merge pull request #8910 from wibetter/fix-formula

fix(amis-editor): 修复公式编辑器self标记功能不生效问题
This commit is contained in:
刘丹 2023-11-27 17:47:52 +08:00 committed by GitHub
commit 8b529bdc0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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>

View File

@ -217,6 +217,7 @@
&-item {
position: relative;
margin-bottom: 2px;
}
&-item.is-expanded > &-sublist {
display: block;