动态表单 基础功能完成

yun-zuoyi
wei.peng 7 years ago
parent 42b8443073
commit 0d7e773a49

@ -0,0 +1,29 @@
package cn.estsh.i3plus.pojo.model.dynamic.table;
import lombok.Data;
import java.util.Date;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2018-12-11 15:37
* @Modify:
* Table
**/
@Data
public class DynTableCell {
// 排序
private Integer cellSeq;
// 单元格名称
private String cellName;
// 单元格名称英文
private String cellNameEn;
// 单元格数据
private Object cellValue;
// 单元格数据
private Integer cellValueType;
}

@ -0,0 +1,82 @@
package cn.estsh.i3plus.pojo.model.dynamic.table;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2018-12-11 16:43
* @Modify:
*
**/
public class DynTablePackTool {
/**
* Table
* @return
*/
public static DynTableRow getTableRow(){
return new DynTableRow();
}
/**
* Table
* @return
*/
public static DynTableRow getTableRow(String rowKey){
DynTableRow row = getTableRow();
row.setKey(rowKey);
return row;
}
public static DynTableRow getDynTableRow(ImppDynTable table, String key){
if(table != null && key != null){
return table.getTable().get(key);
}
return null;
}
/**
*
* @param table
* @param row
* @return
*/
public static DynTableRow putDynTableRow(ImppDynTable table,DynTableRow row){
return table.getTable().put(row.getKey(),row);
}
/**
*
* @param seq
* @param name
* @param value
* @return
*/
public static DynTableCell getTableCell(Integer seq,String name,Object value) {
return getTableCell(seq, name, null, value,null);
}
public static DynTableCell getTableCell(Integer seq,String name,Object value,Integer valueType) {
return getTableCell(seq, name, null, value,valueType);
}
/**
*
* @param seq
* @param name
* @param nameEn En
* @param value
* @return
*/
public static DynTableCell getTableCell(Integer seq,String name,String nameEn,Object value,Integer valueType){
DynTableCell cell = new DynTableCell();
cell.setCellSeq(seq);
cell.setCellName(name);
cell.setCellNameEn(nameEn);
cell.setCellValue(value);
cell.setCellValueType(valueType);
return cell;
}
}

@ -0,0 +1,48 @@
package cn.estsh.i3plus.pojo.model.dynamic.table;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2018-12-11 15:37
* @Modify:
* Table Row
**/
@Data
public class DynTableRow {
private String key;
// 行号
private Integer index = 0;
// 行Size
private Integer cellSize = 0;
// 行数据
private List<DynTableCell> cellList = new ArrayList<>();
public DynTableRow addList(DynTableCell cell){
this.cellList.add(cell);
return this;
}
public Integer getCellSize() {
return cellList != null ? cellList.size() : 0;
}
/**
* Size
* @param cellSize
*/
private void setCellSize(Integer cellSize) { }
}

@ -0,0 +1,33 @@
package cn.estsh.i3plus.pojo.model.dynamic.table;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description :
* @Reference :
* @Author : Adair Peng
* @CreateDate : 2018-12-11 15:37
* @Modify:
* Table Row
**/
@Data
public class ImppDynTable {
// 行数据
private Map<String,DynTableRow> table = new HashMap<>();
// 表单标题
private String tableTitle;
public ImppDynTable() {
}
public ImppDynTable(String tableTitle) {
this.tableTitle = tableTitle;
}
}
Loading…
Cancel
Save