selection中处理projection加上createAt
This commit is contained in:
parent
ba70615fd2
commit
ff6fbe3639
|
|
@ -29,9 +29,6 @@ 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;
|
||||
|
|
@ -153,7 +150,7 @@ function reinforceSelection(schema, entity, selection) {
|
|||
var projectionNodeDict = {};
|
||||
var checkProjectionNode = function (entity2, projectionNode) {
|
||||
var _a, _b, _c;
|
||||
var necessaryAttrs = ['id'];
|
||||
var necessaryAttrs = ['id', '$$createAt$$']; // 有的页面依赖于其它页面取数据,有时两个页面的filter的差异会导致有一个加createAt,有一个不加,此时可能产生前台取数据不完整的异常。先统一加上
|
||||
for (var attr in projectionNode) {
|
||||
if (attr === '#id') {
|
||||
(0, assert_1.default)(!projectionNodeDict[projectionNode[attr]], "projection\u4E2D\u7ED3\u70B9\u7684id\u6709\u91CD\u590D, ".concat(projectionNode[attr]));
|
||||
|
|
|
|||
|
|
@ -35,9 +35,6 @@ 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(
|
||||
|
|
@ -157,7 +154,7 @@ export function reinforceSelection<ED extends EntityDict>(schema: StorageSchema<
|
|||
const toBeAssignNode2: Record<string, string[]> = {}; // 用来记录在表达式中涉及到的结点
|
||||
const projectionNodeDict: Record<string, ED[keyof ED]['Selection']['data']> = {};
|
||||
const checkProjectionNode = (entity2: keyof ED, projectionNode: ED[keyof ED]['Selection']['data']) => {
|
||||
const necessaryAttrs: string[] = ['id'];
|
||||
const necessaryAttrs: string[] = ['id', '$$createAt$$']; // 有的页面依赖于其它页面取数据,有时两个页面的filter的差异会导致有一个加createAt,有一个不加,此时可能产生前台取数据不完整的异常。先统一加上
|
||||
for (const attr in projectionNode) {
|
||||
if (attr === '#id') {
|
||||
assert(!projectionNodeDict[projectionNode[attr]!], `projection中结点的id有重复, ${projectionNode[attr]}`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue