diff --git a/nop-core/src/main/java/io/nop/core/model/table/tree/TreeCell.java b/nop-core/src/main/java/io/nop/core/model/table/tree/TreeCell.java index fae1cd0a3..de498c6c5 100644 --- a/nop-core/src/main/java/io/nop/core/model/table/tree/TreeCell.java +++ b/nop-core/src/main/java/io/nop/core/model/table/tree/TreeCell.java @@ -45,6 +45,11 @@ public class TreeCell extends AbstractFreezable implements ITreeStructure, ICell private int rowIndex = -1; private int colIndex = -1; + /** + * 如果不为0,则表示允许自动延展。flex表示自动延展时的占比 + */ + private int flex; + /** * 树节点所处的层次,顶层的treeLevel为0,子层加1 */ @@ -69,6 +74,14 @@ public String getFormula() { return null; } + public int getFlex() { + return flex; + } + + public void setFlex(int flex) { + this.flex = flex; + } + public String getComment() { return comment; } @@ -109,6 +122,7 @@ public TreeCell cloneInstance() { ret.colIndex = colIndex; ret.leafIndex = leafIndex; ret.treeLevel = treeLevel; + ret.flex = flex; return ret; } @@ -137,6 +151,18 @@ public void setLeafIndex(int leafIndex) { this.leafIndex = leafIndex; } + public TreeCell getFirstChild() { + if (children == null || children.isEmpty()) + return null; + return children.get(0); + } + + public TreeCell getLastChild() { + if (children == null || children.isEmpty()) + return null; + return children.get(children.size() - 1); + } + public void addChild(TreeCell cell) { Guard.checkArgument(cell.getParent() == null); if (this.children == null) { @@ -185,6 +211,16 @@ public int getRowSpan() { return mergeDown + 1; } + public void setColSpan(int colSpan) { + Guard.positiveInt(colSpan, "colSpan"); + this.mergeAcross = colSpan - 1; + } + + public void setRowSpan(int rowSpan) { + Guard.positiveInt(rowSpan, "rowSpan"); + this.mergeDown = rowSpan - 1; + } + public Object getValue() { return value; } diff --git a/nop-core/src/main/java/io/nop/core/model/table/tree/TreeTableLayout.java b/nop-core/src/main/java/io/nop/core/model/table/tree/TreeTableLayout.java index fffb305ff..402d0daea 100644 --- a/nop-core/src/main/java/io/nop/core/model/table/tree/TreeTableLayout.java +++ b/nop-core/src/main/java/io/nop/core/model/table/tree/TreeTableLayout.java @@ -10,7 +10,6 @@ import io.nop.api.core.exceptions.NopException; import io.nop.core.model.table.IRow; import io.nop.core.model.table.ITable; -import io.nop.core.model.tree.TreeVisitors; import java.util.List; @@ -49,11 +48,16 @@ public TreeCell calcLayout(List cells, boolean bVer) { public void assignToTable(List cells, ITable table) { for (TreeCell cell : cells) { - for (TreeCell c : TreeVisitors.depthFirstIterator(cell, true)) { - if (c.isVirtual()) - continue; - table.setCell(c.getRowIndex(), c.getColIndex(), cell); + if (cell.isVirtual()) { + if (cell.getChildren() != null) + assignToTable(cell.getChildren(), table); + continue; } + + + table.setCell(cell.getRowIndex(), cell.getColIndex(), cell); + if (cell.getChildren() != null) + assignToTable(cell.getChildren(), table); } } @@ -95,7 +99,7 @@ void calcBbox(TreeCell cell) { case right_ver: case left_ver: { int w = maxBboxWidth(children); - int h = sumBboxWidth(children); + int h = sumBboxHeight(children); cell.setMergeDown(Math.max(cell.getMergeDown(), h - 1)); cell.setBboxWidth(cell.getColSpan() + w); cell.setBboxHeight(cell.getRowSpan()); @@ -113,7 +117,7 @@ void calcBbox(TreeCell cell) { case bottom_ver: case top_ver: { int w = maxBboxWidth(children); - int h = sumBboxWidth(children); + int h = sumBboxHeight(children); cell.setMergeAcross(Math.max(cell.getMergeAcross(), w - 1)); cell.setBboxWidth(cell.getColSpan()); cell.setBboxHeight(cell.getRowSpan() + h); @@ -122,17 +126,17 @@ void calcBbox(TreeCell cell) { case hor: { int w = sumBboxWidth(children); int h = maxBboxHeight(children); - cell.setMergeAcross(0); - cell.setMergeDown(0); + cell.setColSpan(w); + cell.setRowSpan(h); cell.setBboxWidth(w); cell.setBboxHeight(h); break; } case ver: { int w = maxBboxWidth(children); - int h = sumBboxWidth(children); - cell.setMergeAcross(0); - cell.setMergeDown(0); + int h = sumBboxHeight(children); + cell.setColSpan(w); + cell.setRowSpan(h); cell.setBboxWidth(w); cell.setBboxHeight(h); break; @@ -191,46 +195,54 @@ void adjustBbox(TreeCell cell, int w, int h) { int bboxWidth = cell.getBboxWidth(); int bboxHeight = cell.getBboxHeight(); + int sumFlex = childrenFlex(cell); cell.setBboxWidth(w); cell.setBboxHeight(h); - switch (cell.getChildPos()) { + TreeCellChildPosition pos = cell.getChildPos(); + if (pos == null) + pos = TreeCellChildPosition.ver; + + switch (pos) { case right_hor: case left_hor: { - // 如果边框宽度增加了,则延展最后一个child - lastChild(children).incWidth(w - bboxWidth); - adjustChildrenHor(children, h); cell.setMergeDown(h - 1); + distributeWidth(children, sumFlex, w - bboxWidth); + adjustChildrenHor(children, h); break; } case right_ver: case left_ver: { - lastChild(children).incHeight(h - bboxHeight); - adjustChildrenVer(children, w - cell.getColSpan()); cell.setMergeDown(h - 1); + distributeHeight(children, sumFlex, h - bboxHeight); + adjustChildrenVer(children, w - cell.getColSpan()); break; } case bottom_hor: case top_hor: { - lastChild(children).incWidth(w - bboxWidth); - adjustChildrenHor(children, h - cell.getRowSpan()); cell.setMergeAcross(w - 1); + distributeWidth(children, sumFlex, w - bboxWidth); + adjustChildrenHor(children, h - cell.getRowSpan()); break; } case bottom_ver: case top_ver: { cell.setMergeAcross(w - 1); - lastChild(children).incHeight(h - bboxHeight); + distributeHeight(children, sumFlex, h - bboxHeight); adjustChildrenVer(children, w); break; } case hor: - lastChild(children).incWidth(w - bboxWidth); + cell.setMergeDown(h - 1); + cell.setMergeAcross(w - 1); + distributeWidth(children, sumFlex, w - bboxWidth); adjustChildrenHor(children, h); break; case ver: - lastChild(children).incHeight(h - bboxHeight); + cell.setMergeDown(h - 1); + cell.setMergeAcross(w - 1); + distributeHeight(children, sumFlex, h - bboxHeight); adjustChildrenVer(children, w); break; default: @@ -238,6 +250,52 @@ void adjustBbox(TreeCell cell, int w, int h) { } } + void distributeWidth(List children, int sumFlex, int deltaWidth) { + if (sumFlex == 0 || deltaWidth <= 0) + return; + + for (TreeCell child : children) { + int flex = child.getFlex(); + if (flex > 0) { + if (flex == sumFlex) { + child.incWidth(deltaWidth); + } else { + int dw = deltaWidth * flex / sumFlex; + child.incWidth(dw); + deltaWidth -= dw; + sumFlex -= flex; + } + } + } + } + + void distributeHeight(List children, int sumFlex, int deltaHeight) { + if (sumFlex == 0 || deltaHeight <= 0) + return; + + for (TreeCell child : children) { + int flex = child.getFlex(); + if (flex > 0) { + if (flex == sumFlex) { + child.incHeight(deltaHeight); + } else { + int dh = deltaHeight * flex / sumFlex; + child.incHeight(dh); + deltaHeight -= dh; + sumFlex -= flex; + } + } + } + } + + int childrenFlex(TreeCell cell) { + int total = 0; + for (TreeCell child : cell.getChildren()) { + total += child.getFlex(); + } + return total; + } + TreeCell lastChild(List children) { return children.get(children.size() - 1); } diff --git a/nop-dyn/nop-dyn-service/src/test/java/io/nop/dyn/service/codegen/TestDynCodeGenRelation2.java b/nop-dyn/nop-dyn-service/src/test/java/io/nop/dyn/service/codegen/TestDynCodeGenRelation2.java index f4fceddeb..04c7d9b8f 100644 --- a/nop-dyn/nop-dyn-service/src/test/java/io/nop/dyn/service/codegen/TestDynCodeGenRelation2.java +++ b/nop-dyn/nop-dyn-service/src/test/java/io/nop/dyn/service/codegen/TestDynCodeGenRelation2.java @@ -83,25 +83,25 @@ public void testOneToManyRelation() { // List items = BeanTool.castBeanToType(response.getData(), List.class); // assertEquals(1, items.size()); - // {deptName=2222, deptUsers=[{userId=7ab81}, {id=dasda2}]} - - Map mapData = new HashMap<>(); - mapData.put("roleKey", "test1"); - mapData.put("roleName", "test1"); - Map deptUserData = new HashMap<>(); - deptUserData.put("id", "1"); - mapData.put("roleUsers", List.of(deptUserData)); - - ApiRequest request = ApiRequest.build(Map.of("data", mapData)); - request.setSelection(FieldSelectionBean.fromProp("roleUsers")); - IGraphQLExecutionContext context = graphQLEngine.newRpcContext(GraphQLOperationType.mutation, - "RoleEntity__save", request); - Object result = FutureHelper.syncGet(graphQLEngine.executeRpcAsync(context)); - System.out.println(result); + // {deptName=2222, deptUsers=[{id=7ab81}, {id=dasda2}]} + + Map mapData = new HashMap<>(); + mapData.put("roleKey", "test1"); + mapData.put("roleName", "test1"); + Map deptUserData = new HashMap<>(); + deptUserData.put("id", "1"); + mapData.put("roleUsers", List.of(deptUserData)); + + ApiRequest request = ApiRequest.build(Map.of("data", mapData)); + request.setSelection(FieldSelectionBean.fromProp("roleUsers.userName")); + IGraphQLExecutionContext context = + graphQLEngine.newRpcContext(GraphQLOperationType.mutation,"RoleEntity__save", request); + ApiResponse response = FutureHelper.syncGet(graphQLEngine.executeRpcAsync(context)); + assertEquals(true, response.isOk()); + List roleUsers = (List)BeanTool.getProperty(response.getData(), "roleUsers"); + assertEquals(1, roleUsers.size()); } - @EnableSnapshot - @Test public void testManyToManyRelation() { testGen(OrmRelationType.m2m); @@ -206,7 +206,7 @@ private void addRelation(OrmRelationType relationType, String relationName, Stri relationMeta.setLeftPropName(leftPropName); relationMeta.setRightPropName(rightPropName); relationMeta.setStatus(1); - relationMeta.setTagsText("pub"); + relationMeta.setTagsText("pub,insertable"); // relationMeta.setMiddleTableName(middleTableName); leftEntity.getRelationMetasForEntity().add(relationMeta); } diff --git a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/XlsxConstants.java b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/XlsxConstants.java index 0d3c92042..49d98abfe 100644 --- a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/XlsxConstants.java +++ b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/XlsxConstants.java @@ -14,7 +14,7 @@ public interface XlsxConstants { String SHEET_DATA = "Data"; - String EXT_PROP_XPT_SINGLE_ROW = "xpt:singleRow"; + String EXT_PROP_XPT_SINGLE_COL_LAYOUT = "xpt:singleColLayout"; String EXT_PROP_XPT_LABEL_COL_SIZE = "xpt:labelColSize"; String EXT_PROP_XPT_VALUE_COL_SIZE = "xpt:valueColSize"; diff --git a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/TreeObjectLayout.java b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportBeanLayout.java similarity index 70% rename from nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/TreeObjectLayout.java rename to nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportBeanLayout.java index 7c67e40a0..4df319073 100644 --- a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/TreeObjectLayout.java +++ b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportBeanLayout.java @@ -5,6 +5,7 @@ import io.nop.core.model.table.tree.TreeCell; import io.nop.core.model.table.tree.TreeCellChildPosition; import io.nop.core.model.table.tree.TreeTableLayout; +import io.nop.core.reflect.hook.IExtensibleObject; import io.nop.excel.imp.model.ImportFieldModel; import io.nop.excel.imp.model.ImportSheetModel; import io.nop.ooxml.xlsx.XlsxConstants; @@ -13,7 +14,7 @@ import java.util.ArrayList; import java.util.List; -public class TreeObjectLayout { +public class ImportBeanLayout { public static final String STYLE_ID_ROW = "row"; public static final String STYLE_ID_LIST = "list"; public static final String STYLE_ID_SEQ = "seq"; @@ -24,23 +25,25 @@ public class TreeObjectLayout { public static final String STYLE_ID_COL = "col"; public static final String STYLE_ID_FIELD = "field"; public static final String STYLE_ID_AUTO_SEQ = "auto-seq"; + public static final String STYLE_ID_SEQ_VALUE = "seq-value"; + public static final String STYLE_ID_SEPARATOR = "separator"; private final List cells = new ArrayList<>(); public TreeCell init(ImportSheetModel sheetModel) { if (sheetModel.isList()) { - TreeCell cell = buildListCell(sheetModel.getFields(), sheetModel.isNoSeqCol()); + TreeCell cell = buildListCell(sheetModel.getFields(), sheetModel.isNoSeqCol(), isSingleColLayout(sheetModel)); cells.add(cell); } else { - addFields(sheetModel.getFields()); + addFields(sheetModel.getFields(), isSingleColLayout(sheetModel)); } return TreeTableLayout.instance().calcLayout(cells, true); } - private void addFields(List fields) { + private void addFields(List fields, boolean singleColLayout) { for (ImportFieldModel field : fields) { - addField(field); + addField(field, singleColLayout); } } @@ -48,8 +51,15 @@ public List getCells() { return cells; } - private void addField(ImportFieldModel mainField) { + private void addField(ImportFieldModel mainField, boolean singleColLayout) { if (mainField.isList()) { + if (!cells.isEmpty()) { + TreeCell cell = new TreeCell(null); + cell.setStyleId(STYLE_ID_SEPARATOR); + cell.setFlex(1); + cells.add(cell); + } + TreeCell cell = new TreeCell(mainField, TreeCellChildPosition.ver); cell.setStyleId(STYLE_ID_FIELD); @@ -57,20 +67,20 @@ private void addField(ImportFieldModel mainField) { title.setStyleId(STYLE_ID_TITLE); cell.addChild(title); - cell.addChild(buildListCell(mainField.getFields(), mainField.isNoSeqCol())); + cell.addChild(buildListCell(mainField.getFields(), mainField.isNoSeqCol(), isSingleColLayout(mainField))); cells.add(cell); } else if (mainField.hasFields()) { for (ImportFieldModel field : mainField.getFields()) { - addField(field); + addField(field, singleColLayout || isSingleColLayout(field)); } } else { - addSimpleCell(mainField, isSingleRow(mainField)); + addSimpleCell(mainField, singleColLayout || isSingleColLayout(mainField)); } } - private boolean isSingleRow(ImportFieldModel field) { - return ConvertHelper.toPrimitiveBoolean(field.prop_get(XlsxConstants.EXT_PROP_XPT_SINGLE_ROW)); + private boolean isSingleColLayout(IExtensibleObject field) { + return ConvertHelper.toPrimitiveBoolean(field.prop_get(XlsxConstants.EXT_PROP_XPT_SINGLE_COL_LAYOUT)); } private boolean hasSubFields(List fields) { @@ -81,14 +91,17 @@ private boolean hasSubFields(List fields) { return false; } - public void addSimpleCell(Object value, boolean singleRow) { + public void addSimpleCell(Object value, boolean singleColLayout) { TreeCell labelCell = new TreeCell(value); labelCell.setStyleId(STYLE_ID_LABEL); + labelCell.setColSpan(2); TreeCell valueCell = new TreeCell(value); valueCell.setStyleId(STYLE_ID_VALUE); + valueCell.setColSpan(2); + valueCell.setFlex(1); - if (cells.isEmpty() || singleRow || (cells.get(cells.size()-1).getChildren().size()/2) % 2 == 1) { + if (cells.isEmpty() || singleColLayout || (cells.get(cells.size() - 1).getChildren().size() / 2) % 2 == 0) { TreeCell row = new TreeCell(null, TreeCellChildPosition.hor); row.setStyleId(STYLE_ID_ROW); row.addChild(labelCell); @@ -101,7 +114,7 @@ public void addSimpleCell(Object value, boolean singleRow) { } } - public TreeCell buildListCell(List fields, boolean noSeqCol) { + public TreeCell buildListCell(List fields, boolean noSeqCol, boolean singleColLayout) { TreeCell cell = new TreeCell(null); cell.setStyleId(STYLE_ID_LIST); cell.setChildPos(TreeCellChildPosition.hor); @@ -113,24 +126,28 @@ public TreeCell buildListCell(List fields, boolean noSeqCol) { cell.addChild(child); TreeCell child2 = new TreeCell(null); + child2.setFlex(1); child2.setChildPos(TreeCellChildPosition.ver); cell.addChild(child2); - TreeObjectLayout layout = new TreeObjectLayout(); - layout.addFields(fields); + ImportBeanLayout layout = new ImportBeanLayout(); + layout.addFields(fields, singleColLayout); child2.setChildren(layout.cells); } else { boolean addSeqCol = shouldAddSeqCol(noSeqCol, fields); + boolean hasSeqValue = false; if (addSeqCol) { TreeCell col = new TreeCell(null, TreeCellChildPosition.ver); col.setStyleId(STYLE_ID_COL); TreeCell labelCell = new TreeCell(null); labelCell.setStyleId(STYLE_ID_AUTO_SEQ); - TreeCell valueCell = new TreeCell(null); - valueCell.setStyleId(STYLE_ID_VALUE); + TreeCell valueCell = new TreeCell("1"); + valueCell.setStyleId(STYLE_ID_SEQ_VALUE); col.addChild(labelCell); col.addChild(valueCell); cell.addChild(col); + + hasSeqValue = true; } for (ImportFieldModel field : fields) { @@ -139,11 +156,17 @@ public TreeCell buildListCell(List fields, boolean noSeqCol) { TreeCell labelCell = new TreeCell(field); labelCell.setStyleId(STYLE_ID_HEADER); TreeCell valueCell = new TreeCell(field); - valueCell.setStyleId(STYLE_ID_VALUE); + if (!hasSeqValue) { + valueCell.setStyleId(STYLE_ID_SEQ_VALUE); + hasSeqValue = true; + } else { + valueCell.setStyleId(STYLE_ID_VALUE); + } col.addChild(labelCell); col.addChild(valueCell); cell.addChild(col); } + cell.getLastChild().setFlex(1); } return cell; } diff --git a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportModelToExportModel.java b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportModelToExportModel.java index a20bd065a..db19ea0ef 100644 --- a/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportModelToExportModel.java +++ b/nop-ooxml/nop-ooxml-xlsx/src/main/java/io/nop/ooxml/xlsx/imp/ImportModelToExportModel.java @@ -22,13 +22,15 @@ import java.util.List; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_AUTO_SEQ; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_COL; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_HEADER; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_LABEL; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_SEQ; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_TITLE; -import static io.nop.ooxml.xlsx.imp.TreeObjectLayout.STYLE_ID_VALUE; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_AUTO_SEQ; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_COL; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_HEADER; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_LABEL; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_SEPARATOR; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_SEQ; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_SEQ_VALUE; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_TITLE; +import static io.nop.ooxml.xlsx.imp.ImportBeanLayout.STYLE_ID_VALUE; public class ImportModelToExportModel { private ExcelWorkbook wk; @@ -36,6 +38,7 @@ public class ImportModelToExportModel { private String labelStyle; private String valueStyle; private String titleStyle; + private String seqStyle; private ICache cache = new MapCache<>("import", false); private IEvalScope scope = XLang.newEvalScope(); @@ -47,6 +50,7 @@ public ImportModelToExportModel() { labelStyle = this.getCellStyleId(0, 0); valueStyle = this.getCellStyleId(1, 0); titleStyle = this.getCellStyleId(0, 1); + seqStyle = this.getCellStyleId(0, 2); } String getCellStyleId(int row, int col) { @@ -67,7 +71,7 @@ ExcelSheet buildSheet(ImportSheetModel sheetModel) { sheet.setName(sheetModel.getName()); sheet.setLocation(sheetModel.getLocation()); - TreeObjectLayout layout = new TreeObjectLayout(); + ImportBeanLayout layout = new ImportBeanLayout(); TreeCell rootCell = layout.init(sheetModel); assignToTable(sheet.getTable(), rootCell.getChildren()); @@ -84,7 +88,11 @@ private void assignToTable(ExcelTable table, List cells) { continue; } - ExcelCell ec = (ExcelCell) table.makeCell(cell.getRowIndex(), cell.getColIndex()); + ExcelCell ec = new ExcelCell(); + ec.setMergeAcross(cell.getMergeAcross()); + ec.setMergeDown(cell.getMergeDown()); + table.setCell(cell.getRowIndex(), cell.getColIndex(), ec); + if (STYLE_ID_HEADER.equals(cell.getStyleId())) { ec.setStyleId(labelStyle); ImportFieldModel field = (ImportFieldModel) cell.getValue(); @@ -99,12 +107,17 @@ private void assignToTable(ExcelTable table, List cells) { ec.setStyleId(titleStyle); ImportFieldModel field = (ImportFieldModel) cell.getValue(); ec.setValue(field.getDisplayNameOrName()); - }else if(STYLE_ID_AUTO_SEQ.equals(cell.getStyleId())){ + } else if (STYLE_ID_AUTO_SEQ.equals(cell.getStyleId())) { ec.setStyleId(labelStyle); ec.setValue("序号"); - }else if(STYLE_ID_SEQ.equals(cell.getStyleId())){ + } else if (STYLE_ID_SEQ.equals(cell.getStyleId())) { + ec.setStyleId(seqStyle); + ec.setValue("1"); + } else if (STYLE_ID_SEQ_VALUE.equals(cell.getStyleId())) { ec.setStyleId(valueStyle); ec.setValue("1"); + } else if (STYLE_ID_SEPARATOR.equals(cell.getStyleId())) { + ec.setStyleId(valueStyle); } } } diff --git a/nop-ooxml/nop-ooxml-xlsx/src/main/resources/_vfs/nop/ooxml/templates/simple-data.xpt.xlsx b/nop-ooxml/nop-ooxml-xlsx/src/main/resources/_vfs/nop/ooxml/templates/simple-data.xpt.xlsx index a8d98c64e..6804e23fa 100644 Binary files a/nop-ooxml/nop-ooxml-xlsx/src/main/resources/_vfs/nop/ooxml/templates/simple-data.xpt.xlsx and b/nop-ooxml/nop-ooxml-xlsx/src/main/resources/_vfs/nop/ooxml/templates/simple-data.xpt.xlsx differ diff --git a/nop-ooxml/nop-ooxml-xlsx/src/test/resources/_vfs/test/test-imp-to-excel.imp.xml b/nop-ooxml/nop-ooxml-xlsx/src/test/resources/_vfs/test/test-imp-to-excel.imp.xml index 2598102bd..c86126e7b 100644 --- a/nop-ooxml/nop-ooxml-xlsx/src/test/resources/_vfs/test/test-imp-to-excel.imp.xml +++ b/nop-ooxml/nop-ooxml-xlsx/src/test/resources/_vfs/test/test-imp-to-excel.imp.xml @@ -75,12 +75,12 @@ - - + + - - + + diff --git a/nop-sys/model/nop-sys.orm.xlsx b/nop-sys/model/nop-sys.orm.xlsx index 207520df1..a831fd525 100644 Binary files a/nop-sys/model/nop-sys.orm.xlsx and b/nop-sys/model/nop-sys.orm.xlsx differ diff --git a/nop-xdefs/src/main/resources/_vfs/nop/schema/excel/imp.xdef b/nop-xdefs/src/main/resources/_vfs/nop/schema/excel/imp.xdef index 57774bccc..039634909 100644 --- a/nop-xdefs/src/main/resources/_vfs/nop/schema/excel/imp.xdef +++ b/nop-xdefs/src/main/resources/_vfs/nop/schema/excel/imp.xdef @@ -38,7 +38,7 @@ field="string" sheetVarName="string" keyProp="string" multipleAsMap="!boolean=false" imp:treeChildrenProp="string" imp:treeChildKeyProp="string" imp:treeLevelProp="string" xpt:defaultRowExtendForSibling="boolean" xpt:defaultColExtendForSibling="boolean" - headerRowCount="!int=0" noSeqCol="!boolean=false" + headerRowCount="!int=0" noSeqCol="!boolean=false" xpt:singleColLayout="boolean" > @@ -74,7 +74,7 @@ importDictLabel="!boolean=false" xpt:formatExpr="string" xpt:exportFormula="boolean" xpt:exportFormattedValue="boolean" xpt:rowExtendForSibling="boolean" xpt:colExtendForSibling="boolean" - xpt:labelColSize="int" xpt:valueColSize="int" xpt:singleRow="boolean" + xpt:labelColSize="int" xpt:valueColSize="int" xpt:singleColLayout="boolean" imp:treeChildrenProp="string" imp:treeChildKeyProp="string" imp:treeLevelProp="string" headerRowCount="!int=0" noSeqCol="!boolean=false" >