mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Revert "fix: 修复 patch 逻辑新拖入节点可能不会执行的问题 (#8793)"
This reverts commit 4dec74d3e4
.
This commit is contained in:
parent
7d28608d0d
commit
80ce8dac9c
@ -1751,14 +1751,11 @@ export class EditorManager {
|
||||
});
|
||||
|
||||
patching = false;
|
||||
patchingInvalid = false;
|
||||
patchSchema(force = false) {
|
||||
if (this.patching) {
|
||||
this.patchingInvalid = true;
|
||||
return;
|
||||
}
|
||||
this.patching = true;
|
||||
this.patchingInvalid = false;
|
||||
let patchList = (list: Array<EditorNodeType>) => {
|
||||
// 深度优先
|
||||
list.forEach((node: EditorNodeType) => {
|
||||
@ -1774,7 +1771,6 @@ export class EditorManager {
|
||||
|
||||
patchList(this.store.root.children);
|
||||
this.patching = false;
|
||||
this.patchingInvalid && this.patchSchema(force);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -642,8 +642,8 @@ export const MainStore = types
|
||||
return list.some(node => {
|
||||
if (!node.patched && !node.isRegion) {
|
||||
return true;
|
||||
} else if (node.uniqueChildren.length) {
|
||||
return hasUnPatched(node.uniqueChildren);
|
||||
} else if (node.children.length) {
|
||||
return hasUnPatched(node.children);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -141,8 +141,7 @@ export function JSONPipeIn(
|
||||
/** 脚手架构建的Schema提前构建好了组件 ID,此时无需生成 ID,避免破坏事件动作 */
|
||||
if (
|
||||
(!obj.__origin || obj.__origin !== 'scaffold') &&
|
||||
typeof obj.id === 'string' &&
|
||||
obj.id.startsWith('u:')
|
||||
(typeof obj.id !== 'string' || !obj.id || obj.id.startsWith('u:'))
|
||||
) {
|
||||
const newId = generateNodeId();
|
||||
obj.id && (idMap[obj.id] = newId);
|
||||
|
Loading…
Reference in New Issue
Block a user