动态 Table 功能优化

yun-zuoyi
wei.peng 7 years ago
parent 22c9a7cc20
commit adbcbb16a0

@ -15,6 +15,8 @@ import java.util.Date;
@Data @Data
public class DynTableCell { public class DynTableCell {
// 单元格名称
private String cellKey;
// 排序 // 排序
private Integer cellSeq; private Integer cellSeq;
// 单元格名称 // 单元格名称

@ -54,23 +54,25 @@ public class DynTablePackTool {
* @return * @return
*/ */
public static DynTableCell getTableCell(Integer seq,String name,Object value) { public static DynTableCell getTableCell(Integer seq,String name,Object value) {
return getTableCell(seq, name, null, value,null); return getTableCell(seq,seq.toString(), name, null, value,null);
} }
public static DynTableCell getTableCell(Integer seq,String name,Object value,Integer valueType) { public static DynTableCell getTableCell(Integer seq,String name,Object value,Integer valueType) {
return getTableCell(seq, name, null, value,valueType); return getTableCell(seq,seq.toString(), name, null, value,valueType);
} }
/** /**
* *
* @param seq * @param seq
* @param key Key
* @param name * @param name
* @param nameEn En * @param nameEn En
* @param value * @param value
* @return * @return
*/ */
public static DynTableCell getTableCell(Integer seq,String name,String nameEn,Object value,Integer valueType){ public static DynTableCell getTableCell(Integer seq,String key,String name,String nameEn,Object value,Integer valueType){
DynTableCell cell = new DynTableCell(); DynTableCell cell = new DynTableCell();
cell.setCellKey(key);
cell.setCellSeq(seq); cell.setCellSeq(seq);
cell.setCellName(name); cell.setCellName(name);
cell.setCellNameEn(nameEn); cell.setCellNameEn(nameEn);

@ -27,16 +27,16 @@ public class DynTableRow {
private Integer cellSize = 0; private Integer cellSize = 0;
// 行数据 // 行数据
private List<DynTableCell> cellList = new ArrayList<>(); private Map<String,DynTableCell> cellMap = new HashMap<>();
public DynTableRow addList(DynTableCell cell){ public DynTableRow putCell(DynTableCell cell){
this.cellList.add(cell); this.cellMap.put(cell.getCellKey(),cell);
return this; return this;
} }
public Integer getCellSize() { public Integer getCellSize() {
return cellList != null ? cellList.size() : 0; return cellMap != null ? cellMap.size() : 0;
} }
/** /**

Loading…
Cancel
Save