Skip to content

Commit

Permalink
fix: vxeGrid init without search form (#5342)
Browse files Browse the repository at this point in the history
* 修复vxeGrid在未使用表单的情况下,自动加载数据失效的问题。

* 暂时将vxeGrid版本锁定在4.10.0,新版本尺寸计算尚有问题
  • Loading branch information
mynetfan authored Jan 10, 2025
1 parent e10cbe2 commit 7606b86
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/@core/ui-kit/form-ui/src/form-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class FormApi {

async getValues() {
const form = await this.getForm();
return this.handleRangeTimeValue(form.values);
return form.values ? this.handleRangeTimeValue(form.values) : {};
}

async isFieldValid(fieldName: string) {
Expand Down
5 changes: 4 additions & 1 deletion packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ async function init() {
const autoLoad = defaultGridOptions.proxyConfig?.autoLoad;
const enableProxyConfig = options.value.proxyConfig?.enabled;
if (enableProxyConfig && autoLoad) {
props.api.grid.commitProxy?.('_init', (await formApi.getValues()) ?? {});
props.api.grid.commitProxy?.(
'_init',
formOptions.value ? ((await formApi.getValues()) ?? {}) : {},
);
// props.api.reload(formApi.form?.values ?? {});
}
Expand Down
23 changes: 7 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ catalog:
vue-router: ^4.5.0
vue-tsc: 2.1.10
vxe-pc-ui: ^4.3.67
vxe-table: ^4.10.5
vxe-table: 4.10.0
watermark-js-plus: ^1.5.7
zod: ^3.24.1
zod-defaults: ^0.1.3

0 comments on commit 7606b86

Please sign in to comment.