调用cascadeStore的接口改为operateAsync/selectAsync

This commit is contained in:
Xu Chang 2023-07-22 18:32:35 +08:00
parent 4b64b154fa
commit f30a391186
2 changed files with 8 additions and 8 deletions

View File

@ -1129,13 +1129,13 @@ var TreeStore = /** @class */ (function (_super) {
};
TreeStore.prototype.operateSync = function (entity, operation, context, option) {
(0, assert_1.assert)(context.getCurrentTxnId());
return this.cascadeUpdate(entity, operation, context, option);
return _super.prototype.operateSync.call(this, entity, operation, context, option);
};
TreeStore.prototype.operateAsync = function (entity, operation, context, option) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
(0, assert_1.assert)(context.getCurrentTxnId());
return [2 /*return*/, this.cascadeUpdateAsync(entity, operation, context, option)];
return [2 /*return*/, _super.prototype.operateAsync.call(this, entity, operation, context, option)];
});
});
};
@ -1542,7 +1542,7 @@ var TreeStore = /** @class */ (function (_super) {
TreeStore.prototype.selectSync = function (entity, selection, context, option) {
var _this = this;
(0, assert_1.assert)(context.getCurrentTxnId());
var result = this.cascadeSelect(entity, selection, context, option);
var result = _super.prototype.selectSync.call(this, entity, selection, context, option);
// 在这里再计算所有的表达式
result.forEach(function (ele) { return _this.formExprInResult(entity, selection.data, ele, {}, context); });
return result;
@ -1555,7 +1555,7 @@ var TreeStore = /** @class */ (function (_super) {
switch (_a.label) {
case 0:
(0, assert_1.assert)(context.getCurrentTxnId());
return [4 /*yield*/, this.cascadeSelectAsync(entity, selection, context, option)];
return [4 /*yield*/, _super.prototype.selectAsync.call(this, entity, selection, context, option)];
case 1:
result = _a.sent();
// 在这里再计算所有的表达式

View File

@ -1195,12 +1195,12 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
protected operateSync<T extends keyof ED, OP extends TreeStoreOperateOption, Cxt extends SyncContext<ED>>(entity: T, operation: ED[T]['Operation'], context: Cxt, option: OP): OperationResult<ED> {
assert(context.getCurrentTxnId());
return this.cascadeUpdate(entity, operation, context, option);
return super.operateSync(entity, operation, context, option);
}
protected async operateAsync<T extends keyof ED, OP extends TreeStoreOperateOption, Cxt extends AsyncContext<ED>>(entity: T, operation: ED[T]['Operation'], context: Cxt, option: OP) {
assert(context.getCurrentTxnId());
return this.cascadeUpdateAsync(entity, operation, context, option);
return super.operateAsync(entity, operation, context, option);
}
/**
@ -1594,7 +1594,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
context: Cxt,
option: OP): Partial<ED[T]['Schema']>[] {
assert(context.getCurrentTxnId());
const result = this.cascadeSelect(entity, selection, context, option);
const result = super.selectSync(entity, selection, context, option);
// 在这里再计算所有的表达式
result.forEach(
(ele) => this.formExprInResult(entity, selection.data, ele, {}, context)
@ -1608,7 +1608,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
context: Cxt,
option: OP) {
assert(context.getCurrentTxnId());
const result = await this.cascadeSelectAsync(entity, selection, context, option);
const result = await super.selectAsync(entity, selection, context, option);
// 在这里再计算所有的表达式
result.forEach(
(ele) => this.formExprInResult(entity, selection.data, ele, {}, context)