返回数据时,createAt等属性必须要返回

This commit is contained in:
Xu Chang 2023-07-24 15:14:29 +08:00
parent f30a391186
commit 9305db45b4
2 changed files with 36 additions and 13 deletions

View File

@ -1211,7 +1211,7 @@ var TreeStore = /** @class */ (function (_super) {
}
};
TreeStore.prototype.formResult = function (entity, rows, selection, context, option) {
var e_11, _a, _b;
var e_11, _a, _b, _c, _d;
var _this = this;
var data = selection.data, sorter = selection.sorter, indexFrom = selection.indexFrom, count = selection.count;
var findAvailableExprName = function (current) {
@ -1268,7 +1268,7 @@ var TreeStore = /** @class */ (function (_super) {
var row = rows_1_1.value;
var result = {};
var _loop_3 = function (attr) {
var _c, _d;
var _e, _f;
var rel = this_3.judgeRelation(entity, attr);
if (rel === 1) {
if (row[attr] === undefined) {
@ -1276,15 +1276,15 @@ var TreeStore = /** @class */ (function (_super) {
return "break";
}
else if (typeof projection[attr] === 'number') {
Object.assign(result, (_c = {},
_c[attr] = row[attr],
_c));
Object.assign(result, (_e = {},
_e[attr] = row[attr],
_e));
}
else {
// object数据的深层次select
Object.assign(result, (_d = {},
_d[attr] = {},
_d));
Object.assign(result, (_f = {},
_f[attr] = {},
_f));
var assignIner_1 = function (dest, proj, source) {
if (proj instanceof Array) {
(0, assert_1.assert)(dest instanceof Array);
@ -1321,11 +1321,22 @@ var TreeStore = /** @class */ (function (_super) {
if (state_1 === "break")
break;
}
if (row.$$deleteAt$$) {
// 这三个属性在前台cache中可能表达特殊语义的需要返回
if (row[Entity_1.DeleteAtAttribute]) {
Object.assign(result, (_b = {},
_b[Entity_1.DeleteAtAttribute] = row.$$deleteAt$$,
_b[Entity_1.DeleteAtAttribute] = row[Entity_1.DeleteAtAttribute],
_b));
}
if (row[Entity_1.UpdateAtAttribute]) {
Object.assign(result, (_c = {},
_c[Entity_1.UpdateAtAttribute] = row[Entity_1.UpdateAtAttribute],
_c));
}
if (row[Entity_1.CreateAtAttribute]) {
Object.assign(result, (_d = {},
_d[Entity_1.CreateAtAttribute] = row[Entity_1.CreateAtAttribute],
_d));
}
rows2.push(result);
}
}

View File

@ -1394,10 +1394,22 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
}
}
}
if (row.$$deleteAt$$) {
// 这三个属性在前台cache中可能表达特殊语义的需要返回
if (row[DeleteAtAttribute]) {
Object.assign(result, {
[DeleteAtAttribute]: row.$$deleteAt$$,
})
[DeleteAtAttribute]: row[DeleteAtAttribute],
});
}
if (row[UpdateAtAttribute]) {
Object.assign(result, {
[UpdateAtAttribute]: row[UpdateAtAttribute],
});
}
if (row[CreateAtAttribute]) {
Object.assign(result, {
[CreateAtAttribute]: row[CreateAtAttribute],
});
}
rows2.push(result);
}