fix: 修复动作面板中弹窗信息显示不全的问题 (#10063)

This commit is contained in:
liaoxuezhi 2024-04-18 17:10:11 +08:00 committed by GitHub
parent f359bdf327
commit 12a999f4ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import {ClassNamesFn} from 'amis-core';
import {observer} from 'mobx-react';
import React from 'react';
import {EditorStoreType} from '../../store/editor';
import {modalsToDefinitions, translateSchema} from '../../util';
import {JSONGetById, modalsToDefinitions, translateSchema} from '../../util';
import {Button, Icon, ListMenu, PopOverContainer, confirm} from 'amis';
export interface DialogListProps {
@ -48,7 +48,12 @@ export default observer(function DialogList({
type: 'dialog',
...(modal as any),
definitions: modalsToDefinitions(
store.modals.filter((m: any) => m.$$id !== modalId)
store.modals.filter(
(m: any) =>
// 不要把自己下发,不允许弹窗自己再弹出自己
// 不要下发自己内容里面内嵌的弹窗,否则会导致子弹窗里面的弹窗列表重复
m.$$id !== modalId && !JSONGetById(modal, m.$$id)
)
)
},
onChange: ({definitions, ...modal}: any, diff: any) => {

View File

@ -327,7 +327,12 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
type: 'dialog',
...modal,
definitions: modalsToDefinitions(
store.modals.filter((m: any) => m.$$id !== modalId)
store.modals.filter(
(m: any) =>
// 不要把自己下发,不允许弹窗自己再弹出自己
// 不要下发自己内容里面内嵌的弹窗,否则会导致子弹窗里面的弹窗列表重复
m.$$id !== modalId && !JSONGetById(modal, m.$$id)
)
)
},
onChange: ({definitions, ...modal}: any, diff: any) => {