mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-02 18:28:40 +08:00
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);
|
||||
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user