import { DSL } from './types' ; import { handleSpanGroup , handleLabelList , handleMergeItem } from './IdentifyLayout' ; import handleLayer from './handleLayer' ; import handleCascading from './handleCascading' ; import recombine from './recombine' ; import formatData from './formatData' ; import domFormat from './domFormat' ; import handleRow from './handleRow' ; import styleFix from './styleFix' ; /**
 * 处理单层图层结构
 */ export default ( dsl ) => { let { baseJson , cascadingJson } = handleCascading ( dsl [ 0 ] ) ; [ baseJson , cascadingJson ] = [ baseJson , cascadingJson ] . map ( dsl => { if ( dsl . length === 0 ) { return [ ] ; } dsl = recombine ( dsl ) ; dsl = handleRow ( dsl ) ; dsl = handleSpanGroup ( dsl ) ; dsl = handleLabelList ( dsl ) ; dsl = handleMergeItem ( dsl ) ; dsl = handleLayer ( dsl ) ; dsl = styleFix ( dsl ) ; return dsl ; } ) ; if ( Array . isArray ( cascadingJson ) && cascadingJson . length > 0 ) { cascadingJson = cascadingJson . map ( item => { item . isPosition = true ; return item ; } ) ; if ( ! baseJson [ 0 ] . children ) { baseJson [ 0 ] . children = [ ] ; } baseJson [ 0 ] . children = [ ... baseJson [ 0 ] . children , ... cascadingJson ] ; } return baseJson ; } ;