表单字段类型
This commit is contained in:
parent
90d677e863
commit
2787bae3cf
|
@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.snow.common.core.domain.AjaxResult;
|
||||
import com.snow.common.enums.FormFieldTypeEnums;
|
||||
import com.snow.common.utils.StringUtils;
|
||||
|
@ -142,6 +143,7 @@ public class FormController {
|
|||
@RequestParam String formField){
|
||||
|
||||
|
||||
JSONObject formFieldObject = JSON.parseObject(formField);
|
||||
//解析前端传过来的数据
|
||||
JSONArray formDataArray = JSON.parseArray(formData);
|
||||
for(int i=0;i<formDataArray.size();i++){
|
||||
|
@ -152,12 +154,20 @@ public class FormController {
|
|||
List<Columns> columnsList=gridField.getColumns();
|
||||
if(CollUtil.isNotEmpty(columnsList)){
|
||||
columnsList.forEach(t->{
|
||||
List<BaseField> list = t.getList();
|
||||
for(int j=0;j<list.size();j++){
|
||||
if(list.get(j).getTag().equals(FormFieldTypeEnums.INPUT.getCode())){
|
||||
|
||||
JSONArray newColumnsArray=
|
||||
JSONArray columnsArray = JSON.parseArray(t.getList());
|
||||
for(int j=0;j<columnsArray.size();j++){
|
||||
//获取组件类型
|
||||
String tag= JSON.parseObject(columnsArray.getString(j)).getString("tag");
|
||||
if(tag.equals(FormFieldTypeEnums.INPUT.getCode())){
|
||||
InputField inputField = columnsArray.getObject(j, InputField.class);
|
||||
String value = formFieldObject.getString(inputField.getId());
|
||||
inputField.setDefaultValue(value);
|
||||
inputField.setDocument("这个是帮助文档");
|
||||
columnsArray.add(inputField);
|
||||
}
|
||||
}
|
||||
System.out.println("----------");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,5 +17,8 @@ public class Columns implements Serializable {
|
|||
|
||||
private int span;
|
||||
|
||||
private List<BaseField> list;
|
||||
/**
|
||||
* list字符串
|
||||
*/
|
||||
private String list;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue