fix(form): fix baseColProps not work

This commit is contained in:
vben 2020-11-18 00:06:44 +08:00
parent cd35d3e0d1
commit c8ef82b2c1
4 changed files with 15 additions and 4 deletions

View File

@ -17,6 +17,8 @@
- 修复表单 inputNumber 校验错误
- 修复表单默认值设置错误
- 修复菜单折叠按钮隐藏时占位问题
- 修复表单 baseColProps 不生效
## 2.0.0-rc.10 (2020-11-13)

View File

@ -91,7 +91,11 @@ export default defineComponent({
function getShow() {
const { show, ifShow } = props.schema;
const { showAdvancedButton } = props.formProps;
const itemIsAdvanced = showAdvancedButton ? !!props.schema.isAdvanced : true;
const itemIsAdvanced = showAdvancedButton
? isBoolean(props.schema.isAdvanced)
? props.schema.isAdvanced
: true
: true;
let isShow = true;
let isIfShow = true;

View File

@ -132,6 +132,8 @@ export default function ({
function updateAdvanced() {
let itemColSum = 0;
let realItemColSum = 0;
const { baseColProps = {} } = unref(getProps);
for (const schema of unref(getSchema)) {
const { show, colProps } = schema;
let isShow = true;
@ -152,8 +154,11 @@ export default function ({
});
}
if (isShow && colProps) {
const { itemColSum: sum, isAdvanced } = getAdvanced(colProps, itemColSum);
if (isShow && (colProps || baseColProps)) {
const { itemColSum: sum, isAdvanced } = getAdvanced(
{ ...baseColProps, ...colProps },
itemColSum
);
itemColSum = sum || 0;
if (isAdvanced) {

View File

@ -8,9 +8,9 @@
}"
>
<BasicForm
:submitOnReset="true"
v-bind="getFormProps"
v-if="getBindValues.useSearchForm"
:submitOnReset="true"
:submitButtonOptions="{ loading }"
:tableAction="tableAction"
@register="registerForm"