Commit c8ef82b2c11c9938f0f7a7f6a1a10010b82979dc

Authored by vben
1 parent cd35d3e0

fix(form): fix baseColProps not work

CHANGELOG.zh_CN.md
@@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
17 17
18 - 修复表单 inputNumber 校验错误 18 - 修复表单 inputNumber 校验错误
19 - 修复表单默认值设置错误 19 - 修复表单默认值设置错误
  20 +- 修复菜单折叠按钮隐藏时占位问题
  21 +- 修复表单 baseColProps 不生效
20 22
21 ## 2.0.0-rc.10 (2020-11-13) 23 ## 2.0.0-rc.10 (2020-11-13)
22 24
src/components/Form/src/FormItem.tsx
@@ -91,7 +91,11 @@ export default defineComponent({ @@ -91,7 +91,11 @@ export default defineComponent({
91 function getShow() { 91 function getShow() {
92 const { show, ifShow } = props.schema; 92 const { show, ifShow } = props.schema;
93 const { showAdvancedButton } = props.formProps; 93 const { showAdvancedButton } = props.formProps;
94 - const itemIsAdvanced = showAdvancedButton ? !!props.schema.isAdvanced : true; 94 + const itemIsAdvanced = showAdvancedButton
  95 + ? isBoolean(props.schema.isAdvanced)
  96 + ? props.schema.isAdvanced
  97 + : true
  98 + : true;
95 let isShow = true; 99 let isShow = true;
96 let isIfShow = true; 100 let isIfShow = true;
97 101
src/components/Form/src/hooks/useAdvanced.ts
@@ -132,6 +132,8 @@ export default function ({ @@ -132,6 +132,8 @@ export default function ({
132 function updateAdvanced() { 132 function updateAdvanced() {
133 let itemColSum = 0; 133 let itemColSum = 0;
134 let realItemColSum = 0; 134 let realItemColSum = 0;
  135 + const { baseColProps = {} } = unref(getProps);
  136 +
135 for (const schema of unref(getSchema)) { 137 for (const schema of unref(getSchema)) {
136 const { show, colProps } = schema; 138 const { show, colProps } = schema;
137 let isShow = true; 139 let isShow = true;
@@ -152,8 +154,11 @@ export default function ({ @@ -152,8 +154,11 @@ export default function ({
152 }); 154 });
153 } 155 }
154 156
155 - if (isShow && colProps) {  
156 - const { itemColSum: sum, isAdvanced } = getAdvanced(colProps, itemColSum); 157 + if (isShow && (colProps || baseColProps)) {
  158 + const { itemColSum: sum, isAdvanced } = getAdvanced(
  159 + { ...baseColProps, ...colProps },
  160 + itemColSum
  161 + );
157 162
158 itemColSum = sum || 0; 163 itemColSum = sum || 0;
159 if (isAdvanced) { 164 if (isAdvanced) {
src/components/Table/src/BasicTable.vue
@@ -8,9 +8,9 @@ @@ -8,9 +8,9 @@
8 }" 8 }"
9 > 9 >
10 <BasicForm 10 <BasicForm
  11 + :submitOnReset="true"
11 v-bind="getFormProps" 12 v-bind="getFormProps"
12 v-if="getBindValues.useSearchForm" 13 v-if="getBindValues.useSearchForm"
13 - :submitOnReset="true"  
14 :submitButtonOptions="{ loading }" 14 :submitButtonOptions="{ loading }"
15 :tableAction="tableAction" 15 :tableAction="tableAction"
16 @register="registerForm" 16 @register="registerForm"