From c82bf99fdbda581f42a4bfee974ac1aa816b7068 Mon Sep 17 00:00:00 2001 From: Xc Date: Tue, 2 Dec 2025 14:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86constructRow?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=97=A0=E6=9D=A1=E4=BB=B6cloneDeep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/store.ts b/src/store.ts index 3eb6a82..1e6cb4f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -219,13 +219,12 @@ export default class TreeStore extends C } private constructRow(node: RowNode, context: Cxt, option?: OP) { - let data = cloneDeep(node.$current); if (context.getCurrentTxnId() && node.$txnId === context.getCurrentTxnId()) { if (!node.$next) { // 如果要求返回delete数据,返回带$$deleteAt$$的行 // bug fixed,这里如果是自己create再删除,data也是null - if (data && option?.includedDeleted) { - return Object.assign({}, data, { + if (node.$current && option?.includedDeleted) { + return Object.assign({}, node.$current, { [DeleteAtAttribute]: 1, }); } @@ -233,19 +232,21 @@ export default class TreeStore extends C } else if (!node.$current) { // 本事务创建的,若在cache中$$createAt$$和$$updateAt$$置为1 - return Object.assign({}, data, node.$next, context instanceof SyncContext && { + return Object.assign({}, node.$next, context instanceof SyncContext && { [CreateAtAttribute]: 1, [UpdateAtAttribute]: 1, }); } else { // 本事务更新的,若在cache中$$updateAt$$置为1 - return Object.assign({}, data, node.$next, context instanceof SyncContext && { + return Object.assign({}, node.$current, node.$next, context instanceof SyncContext && { [UpdateAtAttribute]: 1, }); } } - return data; + return { + ...node.$current, + }; } private testFilterFns(