fix: 修复一处类型错误
This commit is contained in:
parent
a547f1d890
commit
0fc00a02b4
13
es/store.js
13
es/store.js
|
|
@ -147,13 +147,12 @@ export default class TreeStore extends CascadeStore {
|
|||
this.seq = {};
|
||||
}
|
||||
constructRow(node, context, option) {
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
|
@ -161,19 +160,21 @@ export default class TreeStore extends CascadeStore {
|
|||
}
|
||||
else if (!node.$current) {
|
||||
// 本事务创建的,若在cache中$$createAt$$和$$updateAt$$置为1
|
||||
return Object.assign({}, data, node.$next, context instanceof SyncContext && {
|
||||
return Object.assign({}, node.$current, 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,
|
||||
};
|
||||
}
|
||||
testFilterFns(node, nodeDict, exprResolveFns, fns) {
|
||||
const { self, otm, mto } = fns;
|
||||
|
|
|
|||
13
lib/store.js
13
lib/store.js
|
|
@ -149,13 +149,12 @@ class TreeStore extends CascadeStore_1.CascadeStore {
|
|||
this.seq = {};
|
||||
}
|
||||
constructRow(node, context, option) {
|
||||
let data = (0, lodash_1.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, {
|
||||
[Entity_1.DeleteAtAttribute]: 1,
|
||||
});
|
||||
}
|
||||
|
|
@ -163,19 +162,21 @@ class TreeStore extends CascadeStore_1.CascadeStore {
|
|||
}
|
||||
else if (!node.$current) {
|
||||
// 本事务创建的,若在cache中$$createAt$$和$$updateAt$$置为1
|
||||
return Object.assign({}, data, node.$next, context instanceof SyncRowStore_1.SyncContext && {
|
||||
return Object.assign({}, node.$current, node.$next, context instanceof SyncRowStore_1.SyncContext && {
|
||||
[Entity_1.CreateAtAttribute]: 1,
|
||||
[Entity_1.UpdateAtAttribute]: 1,
|
||||
});
|
||||
}
|
||||
else {
|
||||
// 本事务更新的,若在cache中$$updateAt$$置为1
|
||||
return Object.assign({}, data, node.$next, context instanceof SyncRowStore_1.SyncContext && {
|
||||
return Object.assign({}, node.$current, node.$next, context instanceof SyncRowStore_1.SyncContext && {
|
||||
[Entity_1.UpdateAtAttribute]: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
return {
|
||||
...node.$current,
|
||||
};
|
||||
}
|
||||
testFilterFns(node, nodeDict, exprResolveFns, fns) {
|
||||
const { self, otm, mto } = fns;
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
|
|||
}
|
||||
else if (!node.$current) {
|
||||
// 本事务创建的,若在cache中$$createAt$$和$$updateAt$$置为1
|
||||
return Object.assign({}, node.$next, context instanceof SyncContext && {
|
||||
return Object.assign({}, node.$current, node.$next, context instanceof SyncContext && {
|
||||
[CreateAtAttribute]: 1,
|
||||
[UpdateAtAttribute]: 1,
|
||||
});
|
||||
|
|
@ -242,7 +242,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
|
|||
// 本事务更新的,若在cache中$$updateAt$$置为1
|
||||
return Object.assign({}, node.$current, node.$next, context instanceof SyncContext && {
|
||||
[UpdateAtAttribute]: 1,
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue