修改了constructRow中的无条件cloneDeep

This commit is contained in:
Xu Chang 2025-12-02 14:22:57 +08:00
parent 5b5621216f
commit c82bf99fdb
1 changed files with 7 additions and 6 deletions

View File

@ -219,13 +219,12 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
}
private constructRow<Cxt extends Context, OP extends TreeStoreSelectOption>(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<ED extends EntityDict & BaseEntityDict> 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(