mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复修复内嵌弹窗中内嵌弹窗失效的问题 (#10100)
This commit is contained in:
parent
23754fc2a4
commit
4a65a97990
@ -253,6 +253,8 @@
|
||||
> span {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
a.ae-DialogList-iconBtn {
|
||||
|
@ -1543,18 +1543,23 @@ export function mergeDefinitions(
|
||||
} else if (parent) {
|
||||
// 没用到,可能修改了弹窗的内容为引用其他弹窗,同样需要更新,但是不会提取为 definitions
|
||||
const modalType = def.type === 'drawer' ? 'drawer' : 'dialog';
|
||||
schema = JSONUpdate(schema, parent.$$id, {
|
||||
...parent,
|
||||
__actionModals: undefined,
|
||||
args: undefined,
|
||||
dialog: undefined,
|
||||
drawer: undefined,
|
||||
actionType: def.actionType ?? modalType,
|
||||
[modalType]: JSONPipeIn({
|
||||
...def,
|
||||
$$originId: undefined
|
||||
})
|
||||
});
|
||||
const origin = parent[modalType] || {};
|
||||
|
||||
// 这样处理是为了不要修改原来的 $$id
|
||||
const changes = diff(origin, def, (path, key) => key === '$$id');
|
||||
if (changes) {
|
||||
const newModal = patchDiff(origin, changes);
|
||||
delete newModal.$$originId;
|
||||
schema = JSONUpdate(schema, parent.$$id, {
|
||||
...parent,
|
||||
__actionModals: undefined,
|
||||
args: undefined,
|
||||
dialog: undefined,
|
||||
drawer: undefined,
|
||||
actionType: def.actionType ?? modalType,
|
||||
[modalType]: newModal
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (refs.includes(key)) {
|
||||
schema.definitions[key] = JSONPipeIn(def);
|
||||
|
@ -7,8 +7,10 @@ import {
|
||||
JSONPipeOut,
|
||||
JSONUpdate,
|
||||
addModal,
|
||||
diff,
|
||||
getVariables,
|
||||
modalsToDefinitions
|
||||
modalsToDefinitions,
|
||||
patchDiff
|
||||
} from 'amis-editor-core';
|
||||
import React from 'react';
|
||||
import {observer} from 'mobx-react';
|
||||
@ -118,19 +120,29 @@ function DialogActionPanel({
|
||||
def.$$originId = originId;
|
||||
} else if (isRefered === false) {
|
||||
const modalType = def.type === 'drawer' ? 'drawer' : 'dialog';
|
||||
schema = JSONUpdate(schema, parent.$$id, {
|
||||
...parent,
|
||||
__actionModals: undefined,
|
||||
args: undefined,
|
||||
dialog: undefined,
|
||||
drawer: undefined,
|
||||
actionType: def.actionType ?? modalType,
|
||||
[modalType]: JSONPipeIn({
|
||||
...modal,
|
||||
$$originId: undefined,
|
||||
$$ref: undefined
|
||||
})
|
||||
});
|
||||
|
||||
// 这样处理是为了不要修改原来的 $$id
|
||||
const origin = parent[modalType] || {};
|
||||
const changes = diff(
|
||||
origin,
|
||||
modal,
|
||||
(path, key) => key === '$$id'
|
||||
);
|
||||
if (changes) {
|
||||
const newModal = patchDiff(origin, changes);
|
||||
delete newModal.$$originId;
|
||||
delete newModal.$$ref;
|
||||
schema = JSONUpdate(schema, parent.$$id, {
|
||||
...parent,
|
||||
__actionModals: undefined,
|
||||
args: undefined,
|
||||
dialog: undefined,
|
||||
drawer: undefined,
|
||||
actionType: def.actionType ?? modalType,
|
||||
[modalType]: newModal
|
||||
});
|
||||
}
|
||||
|
||||
// 不要写下面的 defintions 了
|
||||
return;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user