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(