@@ -33,6 +33,7 @@ import {
3333import { DownOutlined } from "@ant-design/icons" ;
3434import { ItemType } from "antd/es/menu/hooks/useItems" ;
3535import ColorPicker , { configChangeParams } from "components/ColorPicker" ;
36+ import { ModuleLayoutComp } from "@lowcoder-ee/comps/comps/moduleContainerComp/moduleLayoutComp" ;
3637
3738
3839export type DisabledCollisionStatus = "true" | "false" ; // "true" means collision is not enabled - Layering works, "false" means collision is enabled - Layering does not work
@@ -209,17 +210,31 @@ export const LeftLayersContent = (props: LeftLayersContentProps) => {
209210
210211 const dsl = editorState . rootComp . toJsonValue ( ) ;
211212 let layout : any = { } ;
212- parentNode . children . forEach ( ( data , index ) => {
213- layout [ data . key ] = {
214- ...dsl . ui . layout [ data . key ] ,
215- pos : index ,
216- } ;
217- } )
218-
219- editorState . rootComp . children . ui . dispatchChangeValueAction ( {
220- ...dsl . ui ,
221- layout,
222- } )
213+ if ( dsl . ui . compType === 'module' ) {
214+ parentNode . children . forEach ( ( data , index ) => {
215+ layout [ data . key ] = {
216+ ...dsl . ui . comp . container . layout [ data . key ] ,
217+ pos : index ,
218+ } ;
219+ } )
220+ const moduleLayoutComp = editorState . rootComp . children . ui . getModuleLayoutComp ( ) ;
221+ moduleLayoutComp ?. children . container . dispatchChangeValueAction ( {
222+ ...dsl . ui . comp . container ,
223+ layout,
224+ } )
225+ } else {
226+ parentNode . children . forEach ( ( data , index ) => {
227+ layout [ data . key ] = {
228+ ...dsl . ui . layout [ data . key ] ,
229+ pos : index ,
230+ } ;
231+ } )
232+
233+ editorState . rootComp . children . ui . dispatchChangeValueAction ( {
234+ ...dsl . ui ,
235+ layout,
236+ } )
237+ }
223238 return newTreeData ;
224239 } ) ;
225240 }
0 commit comments