reinforceSelection中默认加上createAt的投影

This commit is contained in:
Xu Chang 2023-02-08 20:53:27 +08:00
parent c23b724e4d
commit 5e803ab128
2 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,9 @@ function getOperationRewriters() {
*/
function reinforceSelection(schema, entity, selection) {
var filter = selection.filter, data = selection.data, sorter = selection.sorter;
Object.assign(data, {
'$$createAt$$': 1,
}); // 有的页面依赖于其它页面取数据有时两个页面的filter的差异会导致有一个加createAt有一个不加此时可能产生前台取数据不完整的异常。先统一加上
var checkNode = function (projectionNode, attrs) {
attrs.forEach(function (attr) {
var _a;

View File

@ -35,6 +35,9 @@ function getOperationRewriters<ED extends EntityDict>() {
*/
export function reinforceSelection<ED extends EntityDict>(schema: StorageSchema<ED>, entity: keyof ED, selection: ED[keyof ED]['Selection']) {
const { filter, data, sorter } = selection;
Object.assign(data, {
'$$createAt$$': 1,
}); // 有的页面依赖于其它页面取数据有时两个页面的filter的差异会导致有一个加createAt有一个不加此时可能产生前台取数据不完整的异常。先统一加上
const checkNode = (projectionNode: ED[keyof ED]['Selection']['data'], attrs: string[]) => {
attrs.forEach(