import { LocationType } from '/@/enums/desktop'; import { DesktopInfoItem } from '/@/model/mobileDesign/designer'; /** * 构建app数据设计页代码 * @param model * @param _tableInfo * @returns */ export function buildAppDataCode(model: Array): string { const compMap: any[] = []; let importCode = ''; let configCode = ''; let code = ` `; return code; } function getLegend(config) { let left = 'left'; let top = 'bottom'; if (config.position == LocationType.LEFT_TOP) { left = config.orient == 'horizontal' ? 'left' : 'top'; top = config.orient == 'horizontal' ? 'top' : 'left'; } else if (config.position == LocationType.RIGHT_TOP) { left = config.orient == 'horizontal' ? 'right' : 'top'; top = config.orient == 'horizontal' ? 'top' : 'right'; } else if (config.position == LocationType.LEFT_BOTTOM) { left = config.orient == 'horizontal' ? 'left' : 'bottom'; top = config.orient == 'horizontal' ? 'bottom' : 'left'; } else if (config.position == LocationType.RIGHT_BOTTOM) { left = config.orient == 'horizontal' ? 'right' : 'bottom'; top = config.orient == 'horizontal' ? 'bottom' : 'right'; } else if (config.position == LocationType.TOP_CENTER) { left = 'center'; top = config.orient == 'horizontal' ? 'top' : 'left'; } else if (config.position == LocationType.BOTTOM_CENTER) { left = 'center'; top = config.orient == 'horizontal' ? 'bottom' : 'left'; } const legend = { show: config.show, position: top, float: left, margin: config.padding, legendShape: config.icon, fontColor: config.textStyle.color, }; return legend; }