Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve issue with grid reload parameter not working #4888

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"node": ">=20.10.0",
"pnpm": ">=9.12.0"
},
"packageManager": "pnpm@9.12.3",
"packageManager": "pnpm@9.13.0",
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
Expand Down
22 changes: 17 additions & 5 deletions packages/effects/plugins/src/vxe-table/extends.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Recordable } from '@vben/types';
import type { VxeGridProps, VxeUIExport } from 'vxe-table';

import type { VxeGridApi } from './api';
Expand All @@ -7,7 +8,7 @@ import { formatDate, formatDateTime, isFunction } from '@vben/utils';
export function extendProxyOptions(
api: VxeGridApi,
options: VxeGridProps,
getFormValues: () => Record<string, any>,
getFormValues: () => Recordable<any>,
) {
[
'query',
Expand All @@ -25,17 +26,28 @@ function extendProxyOption(
key: string,
api: VxeGridApi,
options: VxeGridProps,
getFormValues: () => Record<string, any>,
getFormValues: () => Recordable<any>,
) {
const { proxyConfig } = options;
const configFn = (proxyConfig?.ajax as any)?.[key];
const configFn = (proxyConfig?.ajax as Recordable<any>)?.[key];
if (!isFunction(configFn)) {
return options;
}

const wrapperFn = async (params: any, _formValues: any, ...args: any[]) => {
const wrapperFn = async (
params: Recordable<any>,
customValues: Recordable<any>,
...args: Recordable<any>[]
) => {
const formValues = getFormValues();
const data = await configFn(params, formValues, ...args);
const data = await configFn(
params,
{
...customValues,
...formValues,
},
...args,
);
return data;
};
api.setState({
Expand Down
Loading