build
This commit is contained in:
parent
7ab9b725bd
commit
1f44bab4b5
|
|
@ -1283,16 +1283,15 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
if (updateAttrCount === 0) {
|
||||
return {};
|
||||
}
|
||||
// 尝试和当前targetEntity的最后一条create/update进行合并,优化modi的条数
|
||||
const upsertModis = await this.selectAbjointRowAsync('modi', {
|
||||
data: {
|
||||
id: 1,
|
||||
data: 1,
|
||||
action: 1,
|
||||
},
|
||||
filter: {
|
||||
targetEntity: entity,
|
||||
action: {
|
||||
$in: ['create', 'update'],
|
||||
},
|
||||
entity: option.modiParentEntity,
|
||||
entityId: option.modiParentId,
|
||||
iState: 'active',
|
||||
|
|
@ -1314,17 +1313,19 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
count: 1,
|
||||
}, context, option);
|
||||
if (upsertModis.length > 0) {
|
||||
const { data: originData, id: originId } = upsertModis[0];
|
||||
modiUpsert = {
|
||||
id: 'dummy',
|
||||
action: 'update',
|
||||
data: {
|
||||
data: Object.assign({}, originData, data),
|
||||
},
|
||||
filter: {
|
||||
id: originId,
|
||||
}
|
||||
};
|
||||
const { data: originData, id: originId, action } = upsertModis[0];
|
||||
if (['create', 'update'].includes(action)) {
|
||||
modiUpsert = {
|
||||
id: 'dummy',
|
||||
action: 'update',
|
||||
data: {
|
||||
data: Object.assign({}, originData, data),
|
||||
},
|
||||
filter: {
|
||||
id: originId,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!modiUpsert) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue