fix(BasicForm): 修复FormSchema中使用ifShow隐藏字段时,默认表单查询重置按钮位置偏移量计算问题 (#3830)

This commit is contained in:
zzy-jonay 2024-05-10 17:51:50 +08:00 committed by GitHub
parent 5a2d74249e
commit 478802b426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,24 +120,18 @@ export default function ({
const { baseColProps = {} } = unref(getProps);
for (const schema of unref(getSchema)) {
const { show, colProps } = schema;
const { show, ifShow, colProps } = schema;
const renderCallbackParams = {
schema: schema,
model: formModel,
field: schema.field,
values: { ...unref(defaultValueRef), ...formModel },
};
let isShow = true;
if (isBoolean(show)) {
isShow = show;
}
if (isFunction(show)) {
isShow = show({
schema: schema,
model: formModel,
field: schema.field,
values: {
...unref(defaultValueRef),
...formModel,
},
});
}
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)) {
const { itemColSum: sum, isAdvanced } = getAdvanced(