修复分页total不正确,通过features订阅refresh需要重置下total
This commit is contained in:
parent
fcab7b6c75
commit
6fe06a3a7d
|
|
@ -8,5 +8,5 @@ type TransformAspectDict<T extends AspectDict<ED, BCT>, ED extends BaseEntityDic
|
|||
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
||||
};
|
||||
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: import("../features/cache").Cache<ED>) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import { ED, OakAbsAttrDef } from '../../types/AbstractComponent';
|
|||
import { ReactComponentProps } from '../../types/Page';
|
||||
import { Breakpoint } from 'antd';
|
||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||
column?: number | Record<Breakpoint, number>;
|
||||
column?: number | Record<Breakpoint, number> | undefined;
|
||||
entity: T2;
|
||||
attributes: OakAbsAttrDef[];
|
||||
data: Partial<ED2[T2]['Schema']>;
|
||||
title?: string;
|
||||
bordered?: boolean;
|
||||
layout?: 'horizontal' | 'vertical';
|
||||
data: Partial<ED2[T2]["Schema"]>;
|
||||
title?: string | undefined;
|
||||
bordered?: boolean | undefined;
|
||||
layout?: "horizontal" | "vertical" | undefined;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { ReactComponentProps } from '../../types/Page';
|
|||
import { ECode } from '../../types/ErrorPage';
|
||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||
code: ECode;
|
||||
title?: string;
|
||||
desc?: string;
|
||||
title?: string | undefined;
|
||||
desc?: string | undefined;
|
||||
children?: React.ReactNode;
|
||||
icon?: React.ReactNode;
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -10,13 +10,18 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactCompo
|
|||
data: RowWithActions<ED2, T2>[];
|
||||
loading: boolean;
|
||||
tablePagination?: React.ReactNode | false;
|
||||
rowSelection?: TableProps<RowWithActions<ED2, T2>>['rowSelection'];
|
||||
hideHeader?: boolean;
|
||||
disableSerialNumber?: boolean;
|
||||
size?: 'large' | 'middle' | 'small';
|
||||
scroll?: TableProps<RowWithActions<ED2, T2>>['scroll'];
|
||||
rowSelection?: import("antd/es/table/interface").TableRowSelection<RowWithActions<ED2, T2>> | undefined;
|
||||
hideHeader?: boolean | undefined;
|
||||
disableSerialNumber?: boolean | undefined;
|
||||
size?: "small" | "large" | "middle" | undefined;
|
||||
scroll?: ({
|
||||
x?: string | number | true | undefined;
|
||||
y?: string | number | undefined;
|
||||
} & {
|
||||
scrollToFirstRowOnChange?: boolean | undefined;
|
||||
}) | undefined;
|
||||
empty?: React.ReactNode;
|
||||
opWidth?: number;
|
||||
ellipsis?: boolean;
|
||||
opWidth?: number | undefined;
|
||||
ellipsis?: boolean | undefined;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
/// <reference types="react" />
|
||||
import { ReactComponentProps } from '../../types/Page';
|
||||
import { ED } from '../../types/AbstractComponent';
|
||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
style?: import("react").CSSProperties | undefined;
|
||||
className?: string | undefined;
|
||||
title?: React.ReactNode;
|
||||
showBack?: boolean;
|
||||
onBack?: () => void;
|
||||
showBack?: boolean | undefined;
|
||||
onBack?: (() => void) | undefined;
|
||||
backIcon?: React.ReactNode;
|
||||
delta?: number;
|
||||
delta?: number | undefined;
|
||||
extra?: React.ReactNode;
|
||||
subTitle?: React.ReactNode;
|
||||
contentMargin?: boolean;
|
||||
contentStyle?: React.CSSProperties;
|
||||
contentClassName?: string;
|
||||
contentMargin?: boolean | undefined;
|
||||
contentStyle?: import("react").CSSProperties | undefined;
|
||||
contentClassName?: string | undefined;
|
||||
tags?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
showHeader?: boolean;
|
||||
showHeader?: boolean | undefined;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
/// <reference types="react" />
|
||||
import { ReactComponentProps } from '../../types/Page';
|
||||
import { ED } from '../../types/AbstractComponent';
|
||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
showHeader?: boolean;
|
||||
showBack?: boolean;
|
||||
onBack?: () => void;
|
||||
style?: import("react").CSSProperties | undefined;
|
||||
className?: string | undefined;
|
||||
showHeader?: boolean | undefined;
|
||||
showBack?: boolean | undefined;
|
||||
onBack?: (() => void) | undefined;
|
||||
backIcon?: React.ReactNode;
|
||||
delta?: number;
|
||||
delta?: number | undefined;
|
||||
title?: React.ReactNode;
|
||||
subTitle?: React.ReactNode;
|
||||
tags?: React.ReactNode;
|
||||
extra?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
content: React.ReactNode;
|
||||
contentStyle?: React.CSSProperties;
|
||||
contentClassName?: string;
|
||||
bodyStyle?: React.CSSProperties;
|
||||
bodyClassName?: string;
|
||||
contentStyle?: import("react").CSSProperties | undefined;
|
||||
contentClassName?: string | undefined;
|
||||
bodyStyle?: import("react").CSSProperties | undefined;
|
||||
bodyClassName?: string | undefined;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/// <reference types="react" />
|
||||
import { ReactComponentProps } from '../../types/Page';
|
||||
import { ED } from '../../types/AbstractComponent';
|
||||
declare const _default: <ED2 extends ED, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||
entity: T2;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
showQuickJumper?: boolean;
|
||||
size?: 'default' | 'small';
|
||||
showSizeChanger?: boolean;
|
||||
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
||||
style?: import("react").CSSProperties | undefined;
|
||||
className?: string | undefined;
|
||||
showQuickJumper?: boolean | undefined;
|
||||
size?: "small" | "default" | undefined;
|
||||
showSizeChanger?: boolean | undefined;
|
||||
showTotal?: ((total: number, range: [number, number]) => React.ReactNode) | undefined;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare const _default: <ED2 extends ED, T2 extends keyof ED2, T3 extends string
|
|||
helps: Record<string, string>;
|
||||
entity: T2;
|
||||
attributes: OakAbsAttrUpsertDef<ED2, T2, T3>[];
|
||||
data: ED2[T2]['Schema'];
|
||||
data: ED2[T2]["Schema"];
|
||||
layout: 'horizontal' | 'vertical';
|
||||
mode: 'default' | 'card';
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
|||
isExecuting(path: string): boolean;
|
||||
isListDescandentOrStale(path: string): boolean;
|
||||
private isInModiNextBranch;
|
||||
refresh(path: string, pageNumber?: number): Promise<void>;
|
||||
refresh(path: string, pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||
loadMore(path: string): Promise<void>;
|
||||
getPagination(path: string): Pagination;
|
||||
setId(path: string, id: string): void;
|
||||
|
|
|
|||
|
|
@ -2203,7 +2203,7 @@ export class RunningTree extends Feature {
|
|||
assert(false);
|
||||
return false;
|
||||
}
|
||||
async refresh(path, pageNumber) {
|
||||
async refresh(path, pageNumber, resetTotal) {
|
||||
if (this.isInModiNextBranch(path)) {
|
||||
this.publish(path);
|
||||
return;
|
||||
|
|
@ -2211,7 +2211,7 @@ export class RunningTree extends Feature {
|
|||
const node = this.findNode(path);
|
||||
if (!node?.isLoading()) {
|
||||
if (node instanceof ListNode) {
|
||||
await node.refresh(pageNumber, false);
|
||||
await node.refresh(pageNumber, false, resetTotal);
|
||||
}
|
||||
else if (node) {
|
||||
await node.refresh();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export declare function onPathSet<ED extends EntityDict & BaseEntityDict, T exte
|
|||
addFeatureSub: (name: string, callback: (args?: any) => void) => void;
|
||||
}, option: OakComponentOption<any, ED, T, Cxt, FrontCxt, any, any, any, {}, {}, {}>, isPage: boolean): Partial<OakComponentData<ED, T>>;
|
||||
export declare function reRender<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>>(this: ComponentFullThisType<ED, T>, option: OakComponentOption<any, ED, T, Cxt, FrontCxt, any, any, any, {}, {}, {}>, extra?: Record<string, any>): void;
|
||||
export declare function refresh<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, pageNumber?: number): Promise<void>;
|
||||
export declare function refresh<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||
export declare function loadMore<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>): Promise<void>;
|
||||
export declare function execute<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, action?: ED[T]['Action'], path?: string, messageProps?: boolean | MessageProps, //默认true
|
||||
opers?: Array<{
|
||||
|
|
|
|||
|
|
@ -542,9 +542,9 @@ export function reRender(option, extra) {
|
|||
this.setState(data);
|
||||
}
|
||||
}
|
||||
export async function refresh(pageNumber) {
|
||||
export async function refresh(pageNumber, resetTotal) {
|
||||
if (this.state.oakFullpath) {
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber);
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber, resetTotal);
|
||||
}
|
||||
}
|
||||
export async function loadMore() {
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ export function createComponent(option, features) {
|
|||
}
|
||||
default: {
|
||||
assert(behavior === 'refresh');
|
||||
await this.refresh();
|
||||
await this.refresh(undefined, true);
|
||||
lifetimes?.mature && lifetimes.mature.call(this);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,21 +49,21 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
|||
redirectTo<T2_1 extends keyof ED>(options: {
|
||||
url: string;
|
||||
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
||||
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||
addItem<T extends keyof ED>(data: Omit<ED[T]["CreateSingle"]["data"], "id"> & {
|
||||
id?: string | undefined;
|
||||
}, path?: string | undefined): string;
|
||||
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
||||
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||
id?: string | undefined;
|
||||
})[], path?: string | undefined): string[];
|
||||
removeItem(id: string, path?: string | undefined): void;
|
||||
removeItems(ids: string[], path?: string | undefined): void;
|
||||
updateItem<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItems<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItem<T_2 extends keyof ED>(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItems<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||
recoverItem(id: string, path?: string | undefined): void;
|
||||
recoverItems(ids: string[], path?: string | undefined): void;
|
||||
resetItem(id: string, path?: string | undefined): void;
|
||||
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
||||
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||
update<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||
create<T_5 extends keyof ED>(data: Omit<ED[T_5]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||
remove(path?: string | undefined): void;
|
||||
isCreation(path?: string | undefined): boolean;
|
||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
||||
|
|
@ -78,11 +78,11 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
|||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
||||
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
||||
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
||||
getOperations<T_6 extends keyof ED>(path?: string | undefined): {
|
||||
entity: keyof ED;
|
||||
operation: ED[keyof ED]["Operation"];
|
||||
}[] | undefined;
|
||||
refresh(pageNumber?: number | undefined): Promise<void>;
|
||||
refresh(pageNumber?: number | undefined, resetTotal?: boolean | undefined): Promise<void>;
|
||||
loadMore(): Promise<void>;
|
||||
setId(id: string, path?: string | undefined): void;
|
||||
unsetId(): void;
|
||||
|
|
|
|||
|
|
@ -209,8 +209,8 @@ class OakComponentBase extends React.PureComponent {
|
|||
: this.state.oakFullpath;
|
||||
return this.features.runningTree.getOperations(path2);
|
||||
}
|
||||
refresh(pageNumber) {
|
||||
return refresh.call(this, pageNumber);
|
||||
refresh(pageNumber, resetTotal) {
|
||||
return refresh.call(this, pageNumber, resetTotal);
|
||||
}
|
||||
loadMore() {
|
||||
return loadMore.call(this);
|
||||
|
|
@ -616,7 +616,7 @@ export function createComponent(option, features) {
|
|||
}
|
||||
default: {
|
||||
assert(behavior === 'refresh');
|
||||
this.refresh();
|
||||
this.refresh(undefined, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ type TransformAspectDict<T extends AspectDict<ED, BCT>, ED extends BaseEntityDic
|
|||
[K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise<unknown> ? (params: P, callback?: (result: R, opRecords?: OpRecord<ED>[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never;
|
||||
};
|
||||
export type AspectDictTrans<ED extends BaseEntityDict, AD extends AspectDict<ED, BCT>, BCT extends AsyncContext<ED>> = TransformAspectDict<AD & CommonAspectDict<ED>, ED, BCT>;
|
||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: BasicFeatures<ED>["cache"]) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||
export declare const createService: <ED extends BaseEntityDict, AD extends AspectDict<ED, any>>(cache: import("../features/cache").Cache<ED>) => TransformAspectDict<AD & CommonAspectDict<ED>, ED, any>;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ export declare class RunningTree<ED extends EntityDict & BaseEntityDict> extends
|
|||
isExecuting(path: string): boolean;
|
||||
isListDescandentOrStale(path: string): boolean;
|
||||
private isInModiNextBranch;
|
||||
refresh(path: string, pageNumber?: number): Promise<void>;
|
||||
refresh(path: string, pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||
loadMore(path: string): Promise<void>;
|
||||
getPagination(path: string): Pagination;
|
||||
setId(path: string, id: string): void;
|
||||
|
|
|
|||
|
|
@ -2206,7 +2206,7 @@ class RunningTree extends Feature_1.Feature {
|
|||
(0, assert_1.assert)(false);
|
||||
return false;
|
||||
}
|
||||
async refresh(path, pageNumber) {
|
||||
async refresh(path, pageNumber, resetTotal) {
|
||||
if (this.isInModiNextBranch(path)) {
|
||||
this.publish(path);
|
||||
return;
|
||||
|
|
@ -2214,7 +2214,7 @@ class RunningTree extends Feature_1.Feature {
|
|||
const node = this.findNode(path);
|
||||
if (!node?.isLoading()) {
|
||||
if (node instanceof ListNode) {
|
||||
await node.refresh(pageNumber, false);
|
||||
await node.refresh(pageNumber, false, resetTotal);
|
||||
}
|
||||
else if (node) {
|
||||
await node.refresh();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export declare function onPathSet<ED extends EntityDict & BaseEntityDict, T exte
|
|||
addFeatureSub: (name: string, callback: (args?: any) => void) => void;
|
||||
}, option: OakComponentOption<any, ED, T, Cxt, FrontCxt, any, any, any, {}, {}, {}>, isPage: boolean): Partial<OakComponentData<ED, T>>;
|
||||
export declare function reRender<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, FrontCxt extends SyncContext<ED>>(this: ComponentFullThisType<ED, T>, option: OakComponentOption<any, ED, T, Cxt, FrontCxt, any, any, any, {}, {}, {}>, extra?: Record<string, any>): void;
|
||||
export declare function refresh<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, pageNumber?: number): Promise<void>;
|
||||
export declare function refresh<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, pageNumber?: number, resetTotal?: boolean): Promise<void>;
|
||||
export declare function loadMore<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>): Promise<void>;
|
||||
export declare function execute<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(this: ComponentFullThisType<ED, T>, action?: ED[T]['Action'], path?: string, messageProps?: boolean | MessageProps, //默认true
|
||||
opers?: Array<{
|
||||
|
|
|
|||
|
|
@ -547,9 +547,9 @@ function reRender(option, extra) {
|
|||
}
|
||||
}
|
||||
exports.reRender = reRender;
|
||||
async function refresh(pageNumber) {
|
||||
async function refresh(pageNumber, resetTotal) {
|
||||
if (this.state.oakFullpath) {
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber);
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber, resetTotal);
|
||||
}
|
||||
}
|
||||
exports.refresh = refresh;
|
||||
|
|
|
|||
|
|
@ -769,7 +769,7 @@ function createComponent(option, features) {
|
|||
}
|
||||
default: {
|
||||
(0, assert_1.assert)(behavior === 'refresh');
|
||||
await this.refresh();
|
||||
await this.refresh(undefined, true);
|
||||
lifetimes?.mature && lifetimes.mature.call(this);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,21 +49,21 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
|||
redirectTo<T2_1 extends keyof ED>(options: {
|
||||
url: string;
|
||||
} & OakNavigateToParameters<ED, T2_1>, state?: Record<string, any> | undefined, disableNamespace?: boolean | undefined): Promise<void>;
|
||||
addItem<T_1 extends keyof ED>(data: Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||
addItem<T extends keyof ED>(data: Omit<ED[T]["CreateSingle"]["data"], "id"> & {
|
||||
id?: string | undefined;
|
||||
}, path?: string | undefined): string;
|
||||
addItems<T_2 extends keyof ED>(data: (Omit<ED[T_2]["CreateSingle"]["data"], "id"> & {
|
||||
addItems<T_1 extends keyof ED>(data: (Omit<ED[T_1]["CreateSingle"]["data"], "id"> & {
|
||||
id?: string | undefined;
|
||||
})[], path?: string | undefined): string[];
|
||||
removeItem(id: string, path?: string | undefined): void;
|
||||
removeItems(ids: string[], path?: string | undefined): void;
|
||||
updateItem<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItems<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItem<T_2 extends keyof ED>(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void;
|
||||
updateItems<T_3 extends keyof ED>(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void;
|
||||
recoverItem(id: string, path?: string | undefined): void;
|
||||
recoverItems(ids: string[], path?: string | undefined): void;
|
||||
resetItem(id: string, path?: string | undefined): void;
|
||||
update<T_5 extends keyof ED>(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void;
|
||||
create<T_6 extends keyof ED>(data: Omit<ED[T_6]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||
update<T_4 extends keyof ED>(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void;
|
||||
create<T_5 extends keyof ED>(data: Omit<ED[T_5]["CreateSingle"]["data"], "id">, path?: string | undefined): void;
|
||||
remove(path?: string | undefined): void;
|
||||
isCreation(path?: string | undefined): boolean;
|
||||
clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void;
|
||||
|
|
@ -78,11 +78,11 @@ export declare function createComponent<IsList extends boolean, ED extends Entit
|
|||
select<T2_2 extends keyof ED>(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial<import("oak-domain/lib/types").GeneralEntityShape>[];
|
||||
checkOperation<T2_3 extends keyof ED>(entity: T2_3, operation: Omit<ED[T2_3]["Operation"], "id">, checkerTypes?: CheckerType[] | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[T2_3]["Action"]];
|
||||
tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException<ED>; }[ED[keyof ED]["Action"]];
|
||||
getOperations<T_7 extends keyof ED>(path?: string | undefined): {
|
||||
getOperations<T_6 extends keyof ED>(path?: string | undefined): {
|
||||
entity: keyof ED;
|
||||
operation: ED[keyof ED]["Operation"];
|
||||
}[] | undefined;
|
||||
refresh(pageNumber?: number | undefined): Promise<void>;
|
||||
refresh(pageNumber?: number | undefined, resetTotal?: boolean | undefined): Promise<void>;
|
||||
loadMore(): Promise<void>;
|
||||
setId(id: string, path?: string | undefined): void;
|
||||
unsetId(): void;
|
||||
|
|
|
|||
|
|
@ -214,8 +214,8 @@ class OakComponentBase extends react_1.default.PureComponent {
|
|||
: this.state.oakFullpath;
|
||||
return this.features.runningTree.getOperations(path2);
|
||||
}
|
||||
refresh(pageNumber) {
|
||||
return page_common_1.refresh.call(this, pageNumber);
|
||||
refresh(pageNumber, resetTotal) {
|
||||
return page_common_1.refresh.call(this, pageNumber, resetTotal);
|
||||
}
|
||||
loadMore() {
|
||||
return page_common_1.loadMore.call(this);
|
||||
|
|
@ -621,7 +621,7 @@ function createComponent(option, features) {
|
|||
}
|
||||
default: {
|
||||
(0, assert_1.assert)(behavior === 'refresh');
|
||||
this.refresh();
|
||||
this.refresh(undefined, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2676,7 +2676,7 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
|
|||
return false;
|
||||
}
|
||||
|
||||
async refresh(path: string, pageNumber?: number) {
|
||||
async refresh(path: string, pageNumber?: number, resetTotal?: boolean) {
|
||||
if (this.isInModiNextBranch(path)) {
|
||||
this.publish(path);
|
||||
return;
|
||||
|
|
@ -2684,7 +2684,7 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
|
|||
const node = this.findNode(path);
|
||||
if (!node?.isLoading()) {
|
||||
if (node instanceof ListNode) {
|
||||
await node.refresh(pageNumber, false);
|
||||
await node.refresh(pageNumber, false, resetTotal);
|
||||
}
|
||||
else if (node) {
|
||||
await node.refresh();
|
||||
|
|
|
|||
|
|
@ -661,10 +661,11 @@ export async function refresh<
|
|||
T extends keyof ED
|
||||
>(
|
||||
this: ComponentFullThisType<ED, T>,
|
||||
pageNumber?: number
|
||||
pageNumber?: number,
|
||||
resetTotal?: boolean
|
||||
) {
|
||||
if (this.state.oakFullpath) {
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber);
|
||||
await this.features.runningTree.refresh(this.state.oakFullpath, pageNumber, resetTotal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ export function createComponent<
|
|||
}
|
||||
default: {
|
||||
assert(behavior === 'refresh');
|
||||
await this.refresh();
|
||||
await this.refresh(undefined, true);
|
||||
lifetimes?.mature && lifetimes.mature.call(this);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -392,8 +392,8 @@ abstract class OakComponentBase<
|
|||
return this.features.runningTree.getOperations(path2);
|
||||
}
|
||||
|
||||
refresh(pageNumber?: number) {
|
||||
return refresh.call(this as any, pageNumber);
|
||||
refresh(pageNumber?: number, resetTotal?: boolean) {
|
||||
return refresh.call(this as any, pageNumber, resetTotal);
|
||||
}
|
||||
|
||||
loadMore() {
|
||||
|
|
@ -946,7 +946,7 @@ export function createComponent<
|
|||
}
|
||||
default: {
|
||||
assert(behavior === 'refresh');
|
||||
this.refresh();
|
||||
this.refresh(undefined, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue