mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
This reverts commit 9180df9dcd
.
This commit is contained in:
parent
9d0f5dc006
commit
ca832e951f
@ -1879,7 +1879,6 @@ export class EditorManager {
|
||||
this.patching = true;
|
||||
this.patchingInvalid = false;
|
||||
const batch: Array<{id: string; value: any}> = [];
|
||||
const ids = new Map();
|
||||
let patchList = (list: Array<EditorNodeType>) => {
|
||||
// 深度优先
|
||||
list.forEach((node: EditorNodeType) => {
|
||||
@ -1888,14 +1887,9 @@ export class EditorManager {
|
||||
}
|
||||
|
||||
if (isAlive(node) && !node.isRegion) {
|
||||
const schema = node.schema;
|
||||
node.patch(
|
||||
this.store,
|
||||
force,
|
||||
(id, value) => batch.unshift({id, value}),
|
||||
ids
|
||||
node.patch(this.store, force, (id, value) =>
|
||||
batch.unshift({id, value})
|
||||
);
|
||||
ids.set(schema.id, true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -698,8 +698,7 @@ export const EditorNode = types
|
||||
patch(
|
||||
store: any,
|
||||
force = false,
|
||||
setPatchInfo?: (id: string, value: any) => void,
|
||||
ids?: Map<string, boolean>
|
||||
setPatchInfo?: (id: string, value: any) => void
|
||||
) {
|
||||
// 避免重复 patch
|
||||
if (self.patched && !force) {
|
||||
@ -721,11 +720,6 @@ export const EditorNode = types
|
||||
patched = {...patched, id: 'u:' + guid()};
|
||||
}
|
||||
|
||||
// id重复了,重新生成一个
|
||||
if (ids?.has(patched.id)) {
|
||||
patched = {...patched, id: 'u:' + guid()};
|
||||
}
|
||||
|
||||
if (
|
||||
(Array.isArray(info.regions) && info.regions.length) ||
|
||||
Array.isArray(info.patchContainers)
|
||||
|
Loading…
Reference in New Issue
Block a user