@@ -33,6 +33,7 @@ import {
33
33
import { DownOutlined } from "@ant-design/icons" ;
34
34
import { ItemType } from "antd/es/menu/hooks/useItems" ;
35
35
import ColorPicker , { configChangeParams } from "components/ColorPicker" ;
36
+ import { ModuleLayoutComp } from "@lowcoder-ee/comps/comps/moduleContainerComp/moduleLayoutComp" ;
36
37
37
38
38
39
export 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) => {
209
210
210
211
const dsl = editorState . rootComp . toJsonValue ( ) ;
211
212
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
+ }
223
238
return newTreeData ;
224
239
} ) ;
225
240
}
0 commit comments