listNode removeFilter refresh时重新getTotal
This commit is contained in:
parent
16a4259462
commit
7ad3f1de82
|
|
@ -785,7 +785,7 @@ class ListNode<
|
|||
this.filters.splice(fIndex, 1);
|
||||
}
|
||||
if (refresh) {
|
||||
this.refresh(0, false);
|
||||
this.refresh(0, false, true);
|
||||
} else {
|
||||
this.publish();
|
||||
}
|
||||
|
|
@ -798,7 +798,7 @@ class ListNode<
|
|||
this.filters.splice(fIndex, 1);
|
||||
}
|
||||
if (refresh) {
|
||||
this.refresh(0, false);
|
||||
this.refresh(0, false, true);
|
||||
} else {
|
||||
this.publish();
|
||||
}
|
||||
|
|
@ -1160,7 +1160,7 @@ class ListNode<
|
|||
const filter = filters2 ? combineFilters<ED, T>(this.entity, this.schema, filters2) : undefined;
|
||||
|
||||
const { currentPage, pageSize } = this.pagination;
|
||||
|
||||
|
||||
// 只有当没有计算过total或者有新的filter才需要显示的查找total
|
||||
const needGetTotal = this.pagination.total === undefined || !!this.filters.find(ele => !ele.applied);
|
||||
return {
|
||||
|
|
@ -1208,7 +1208,7 @@ class ListNode<
|
|||
// this.publish();
|
||||
}
|
||||
|
||||
async refresh(pageNumber?: number, append?: boolean, resetTotal?: number) {
|
||||
async refresh(pageNumber?: number, append?: boolean, resetTotal?: boolean) {
|
||||
if (resetTotal) {
|
||||
// 清空之前查询计算的total值,目前只有父结点id改变会这样调用
|
||||
this.pagination.total = undefined;
|
||||
|
|
@ -2213,7 +2213,7 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
|
|||
}
|
||||
default: {
|
||||
const { e } = record as UpdateOpResult<ED, keyof ED>
|
||||
|
||||
|
||||
if (e === 'modi') {
|
||||
this.invalidateCachedModis();
|
||||
}
|
||||
|
|
@ -2960,10 +2960,10 @@ export class RunningTree<ED extends EntityDict & BaseEntityDict> extends Feature
|
|||
* @param dontPublish
|
||||
*/
|
||||
clean(path: string, lsn?: number, dontPublish?: true) {
|
||||
let node = this.findNode(path)!;
|
||||
let node = this.findNode(path)!;
|
||||
const { root } = analyzePath(path);
|
||||
this.invalidateCachedOperations(root);
|
||||
|
||||
|
||||
while (true) {
|
||||
const parent = node.getParent();
|
||||
if (parent && parent.checkIfClean(node)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue