mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix(amis-editor): 修复选择弹窗类型错误,弹窗path不正确导致页面初始化失败的问题 (#8746)
This commit is contained in:
parent
5fd41298db
commit
c71e19b53c
@ -227,8 +227,6 @@ export function makeWrapper(
|
||||
return Wrapper as any;
|
||||
}
|
||||
|
||||
// 将之前选择的弹窗和本次现有弹窗schema替换为$ref引用
|
||||
|
||||
/**
|
||||
* 将之前选择的弹窗和本次现有弹窗schema替换为$ref引用
|
||||
* @param schema
|
||||
@ -240,7 +238,7 @@ function replaceDialogtoRef(
|
||||
dialogId: string,
|
||||
dialogRefsName: string
|
||||
) {
|
||||
let replacedSchema = null;
|
||||
let replacedSchema = schema;
|
||||
const dialog = JSONGetById(schema, dialogId);
|
||||
if (dialog) {
|
||||
replacedSchema = JSONUpdate(schema, dialogId, {$ref: dialogRefsName}, true);
|
||||
@ -512,7 +510,7 @@ function SchemaFrom({
|
||||
// 添加弹窗事件后自动选中弹窗
|
||||
if (store.activeDialogPath) {
|
||||
let activeId = store.getSchemaByPath(
|
||||
store.activeDialogPath.split('/')
|
||||
store.activeDialogPath.split('/').filter(item => item !== '')
|
||||
)?.$$id;
|
||||
activeId && store.setPreviewDialogId(activeId);
|
||||
store.setActiveDialogPath('');
|
||||
|
@ -3300,7 +3300,7 @@ export const getEventControlConfig = (
|
||||
// 选择现有弹窗后为了使之前的弹窗和现有弹窗$$id唯一,这里重新生成一下
|
||||
let newDialogId = guid();
|
||||
action.actionType = dialogType;
|
||||
action.dialog = {
|
||||
action[dialogType] = {
|
||||
$$id: newDialogId,
|
||||
type: dialogType
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user