fix: 修复弹窗编辑通过弹窗编辑进去的子弹窗编辑,修改后无法保存上的问题

This commit is contained in:
2betop 2024-07-12 17:49:53 +08:00 committed by lmaomaoz
parent ca77883584
commit 8166f29f9e

View File

@ -497,19 +497,30 @@ function DialogActionPanel({
arr = members.concat();
}
const {$$originId, ...modal} = definitions[key];
const {$$originId, ...definition} = definitions[key];
// 当前弹窗不需要合并
if (
$$originId === modal.$$id ||
(definition.$$ref && definition.$$ref === modal.$$ref)
) {
return;
}
const idx = arr.findIndex(item =>
$$originId
? (item.modal.$$originId || item.modal.$$id) === $$originId
: item.modal.$$ref === key
);
const label = `${
modal.editorSetting?.displayName || modal.title || '未命名弹窗'
definition.editorSetting?.displayName ||
definition.title ||
'未命名弹窗'
}`;
const tip =
(modal as any).actionType === 'confirmDialog'
(definition as any).actionType === 'confirmDialog'
? '确认框'
: modal.type === 'drawer'
: definition.type === 'drawer'
? '抽屉弹窗'
: '弹窗';
@ -518,7 +529,7 @@ function DialogActionPanel({
...arr[idx],
label: label,
tip: tip,
modal: {...modal, $$ref: key, $$originId},
modal: {...definition, $$ref: key, $$originId},
isModified: true,
isRefered: refs.includes(key)
});
@ -529,9 +540,9 @@ function DialogActionPanel({
arr.push({
label,
tip,
value: modal.$$id,
value: definition.$$id,
modal: JSONPipeIn({
...modal,
...definition,
$$ref: key
}),
isModified: true