Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
4 changes: 2 additions & 2 deletions packages/amis-core/src/Scoped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export interface ScopedComponentType extends React.Component<RendererProps> {
) => void;
receive?: (values: RendererData, subPath?: string, replace?: boolean) => void;
reload?: (
subPath?: string,
query?: RendererData | null,
subpath?: string,
query?: any,
ctx?: RendererData,
silent?: boolean,
replace?: boolean,
Expand Down
6 changes: 5 additions & 1 deletion packages/amis-core/src/actions/CmptAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {getRendererByName} from '../factory';
export interface ICmptAction extends ListenerAction {
actionType: string;
args: {
resetPage?: boolean; // reload时,是否重置分页
path?: string; // setValue时,目标变量的path
value?: string | {[key: string]: string}; // setValue时,目标变量的值
index?: number; // setValue时,支持更新指定索引的数据,一般用于数组类型
Expand Down Expand Up @@ -88,7 +89,10 @@ export class CmptAction implements RendererAction {
event.data,
undefined,
dataMergeMode === 'override',
action.args
{
...action.args,
resetPage: action.args?.resetPage ?? action.resetPage
}
);

if (result && action.outputVar) {
Expand Down
7 changes: 4 additions & 3 deletions packages/amis/src/renderers/CRUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1863,12 +1863,13 @@ export default class CRUD extends React.Component<CRUDProps, any> {
reload(
subpath?: string,
query?: any,
ctx?: any,
silent?: boolean,
replace?: boolean,
resetPage?: boolean,
args?: any
) {
if (query) {
return this.receive(query, undefined, replace, resetPage, true);
return this.receive(query, undefined, replace, args?.resetPage, true);
} else {
return this.search(undefined, undefined, true, true);
}
Expand Down Expand Up @@ -2821,7 +2822,7 @@ export class CRUDRenderer extends CRUD {
);
}

return super.reload(subpath, query, replace, args?.resetPage ?? true);
return super.reload(subpath, query, ctx, silent, replace, args);
}

async receive(
Expand Down
Loading