mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix(amis): input-sub-form优先使用input-sub-form
This commit is contained in:
parent
10ddff8199
commit
eff7f8afb9
@ -13,7 +13,6 @@ import find from 'lodash/find';
|
||||
import type {RendererConfig} from 'amis-core';
|
||||
import type {MenuDivider, MenuItem} from 'amis-ui/lib/components/ContextMenu';
|
||||
import type {BaseSchema, SchemaCollection} from 'amis';
|
||||
import {DSFieldGroup} from './builder/DSBuilder';
|
||||
|
||||
/**
|
||||
* 区域的定义,容器渲染器都需要定义区域信息。
|
||||
|
@ -145,7 +145,7 @@ export default class SubFormControl extends React.PureComponent<
|
||||
addButtonClassName: '',
|
||||
itemClassName: '',
|
||||
labelField: 'label',
|
||||
btnLabel: 'SubForm.button',
|
||||
defaultLabel: 'SubForm.button',
|
||||
placeholder: 'placeholder.empty'
|
||||
};
|
||||
|
||||
@ -397,6 +397,7 @@ export default class SubFormControl extends React.PureComponent<
|
||||
disabled,
|
||||
maxLength,
|
||||
labelField,
|
||||
defaultLabel,
|
||||
value,
|
||||
btnLabel,
|
||||
render,
|
||||
@ -434,10 +435,7 @@ export default class SubFormControl extends React.PureComponent<
|
||||
) : null}
|
||||
|
||||
<span className={cx('SubForm-valueLabel')}>
|
||||
{(item &&
|
||||
labelField &&
|
||||
item[labelField] &&
|
||||
stripTag(item[labelField])) ||
|
||||
{btnLabel &&
|
||||
render(
|
||||
'label',
|
||||
{
|
||||
@ -448,6 +446,12 @@ export default class SubFormControl extends React.PureComponent<
|
||||
data: createObject(data, item)
|
||||
}
|
||||
)}
|
||||
{!btnLabel &&
|
||||
((item &&
|
||||
labelField &&
|
||||
item[labelField] &&
|
||||
stripTag(item[labelField])) ||
|
||||
defaultLabel)}
|
||||
</span>
|
||||
<a
|
||||
data-index={key}
|
||||
@ -514,6 +518,7 @@ export default class SubFormControl extends React.PureComponent<
|
||||
disabled,
|
||||
value,
|
||||
labelField,
|
||||
defaultLabel,
|
||||
btnLabel,
|
||||
render,
|
||||
data,
|
||||
@ -535,10 +540,7 @@ export default class SubFormControl extends React.PureComponent<
|
||||
data-position="bottom"
|
||||
>
|
||||
<span className={cx('SubForm-valueLabel')}>
|
||||
{(value &&
|
||||
labelField &&
|
||||
value[labelField] &&
|
||||
stripTag(value[labelField])) ||
|
||||
{btnLabel &&
|
||||
render(
|
||||
'label',
|
||||
{
|
||||
@ -549,6 +551,12 @@ export default class SubFormControl extends React.PureComponent<
|
||||
data: createObject(data, value)
|
||||
}
|
||||
)}
|
||||
{!btnLabel &&
|
||||
((value &&
|
||||
labelField &&
|
||||
value[labelField] &&
|
||||
stripTag(value[labelField])) ||
|
||||
defaultLabel)}
|
||||
</span>
|
||||
<a className={cx('SubForm-valueEdit')}>
|
||||
<Icon icon="pencil" className="icon" />
|
||||
|
Loading…
Reference in New Issue
Block a user