fix(BasicForm): 修复FormSchema中使用ifShow隐藏字段时,默认表单查询重置按钮位置偏移量计算问题 (#3830)
This commit is contained in:
parent
5a2d74249e
commit
478802b426
|
|
@ -120,24 +120,18 @@ export default function ({
|
||||||
const { baseColProps = {} } = unref(getProps);
|
const { baseColProps = {} } = unref(getProps);
|
||||||
|
|
||||||
for (const schema of unref(getSchema)) {
|
for (const schema of unref(getSchema)) {
|
||||||
const { show, colProps } = schema;
|
const { show, ifShow, colProps } = schema;
|
||||||
let isShow = true;
|
const renderCallbackParams = {
|
||||||
|
|
||||||
if (isBoolean(show)) {
|
|
||||||
isShow = show;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isFunction(show)) {
|
|
||||||
isShow = show({
|
|
||||||
schema: schema,
|
schema: schema,
|
||||||
model: formModel,
|
model: formModel,
|
||||||
field: schema.field,
|
field: schema.field,
|
||||||
values: {
|
values: { ...unref(defaultValueRef), ...formModel },
|
||||||
...unref(defaultValueRef),
|
};
|
||||||
...formModel,
|
let isShow = true;
|
||||||
},
|
isShow && isBoolean(ifShow) && (isShow = ifShow);
|
||||||
});
|
isShow && isFunction(ifShow) && (isShow = ifShow(renderCallbackParams));
|
||||||
}
|
isShow && isBoolean(show) && (isShow = show);
|
||||||
|
isShow && isFunction(show) && (isShow = show(renderCallbackParams));
|
||||||
|
|
||||||
if (isShow && (colProps || baseColProps)) {
|
if (isShow && (colProps || baseColProps)) {
|
||||||
const { itemColSum: sum, isAdvanced } = getAdvanced(
|
const { itemColSum: sum, isAdvanced } = getAdvanced(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue