在预览返回的数据中增加header的mapList信息
This commit is contained in:
parent
f3cd640ab3
commit
4bdc4237d6
|
@ -108,6 +108,7 @@ public abstract class BaseExcelFileController extends BaseFileController {
|
|||
}
|
||||
// 绑定属性到model
|
||||
dataMap.put("header", listener.getHeadMap());
|
||||
dataMap.put("fieldHeaders", listener.getFieldHeaders());
|
||||
dataMap.put(ORIGIN_FILE_NAME, fileName);
|
||||
dataMap.put(PREVIEW_FILE_NAME, newFileName);
|
||||
List dataList = listener.getDataList();
|
||||
|
|
|
@ -186,6 +186,20 @@ public abstract class FixedHeadExcelListener<T extends BaseExcelModel> extends A
|
|||
return this.fieldHeadMap;
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getFieldHeaders(){
|
||||
if (V.isEmpty(this.fieldHeadMap)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Map<String, String>> fieldHeaders = new ArrayList<>();
|
||||
for (Map.Entry<String, String> fieldHead : this.fieldHeadMap.entrySet()) {
|
||||
fieldHeaders.add(new HashMap<String, String>(){{
|
||||
put("key", fieldHead.getKey());
|
||||
put("title", fieldHead.getValue());
|
||||
}});
|
||||
}
|
||||
return fieldHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
* @return
|
||||
|
|
Loading…
Reference in New Issue