Commit eeb29b0e authored by 邢磊's avatar 邢磊

*)附件如重复,增加分组名称

parent 447e4254
......@@ -326,7 +326,7 @@ public class DPSubServiceImpl {
mergedArray.stream().forEach(x -> {
Object fieldKey = JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.fieldKey");
if (!ValidationUtil.isEmpty(fieldKey)) {
this.processWidgets(tab, datas, x, fieldKey.toString(), result, matinfo);
this.processWidgets(tab, datas, x, null, fieldKey.toString(), result, matinfo);
}
});
map.put("datas", datas);
......@@ -343,7 +343,8 @@ public class DPSubServiceImpl {
JSONObject subObj = new JSONObject();
subObj.put("key", "key" + i);
subObj.put("displayName", JsonValueUtils.getValueByKey(yObj, "visualParams", "visualParams.title"));
Object displayName = JsonValueUtils.getValueByKey(yObj, "visualParams", "visualParams.title");
subObj.put("displayName", displayName);
subObj.put("renderType", "basic");
subObj.put("columns", columnsArray.size());
......@@ -351,7 +352,7 @@ public class DPSubServiceImpl {
mergedArray.stream().forEach(x -> {
Object fieldKey = JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.fieldKey");
if (!ValidationUtil.isEmpty(fieldKey)) {
this.processWidgets(tab, datas, x, fieldKey.toString(), JSONObject.parseObject(apiResult.toString()), matinfo);
this.processWidgets(tab, datas, x, displayName, fieldKey.toString(), JSONObject.parseObject(apiResult.toString()), matinfo);
subObj.put("datas", datas);
}
});
......@@ -368,7 +369,7 @@ public class DPSubServiceImpl {
* @param apiResult
* @return
*/
public JSONArray processWidgets(JSONObject tab, JSONArray datas, Object x, String fieldKey, JSONObject apiResult, JSONObject matinfo) {
public JSONArray processWidgets(JSONObject tab, JSONArray datas, Object x, Object displayName, String fieldKey, JSONObject apiResult, JSONObject matinfo) {
JSONObject jsonObject = new JSONObject();
JSONObject xObj = (JSONObject) x;
......@@ -394,7 +395,11 @@ public class DPSubServiceImpl {
JSONObject attachmentUploadDatasObj = new JSONObject();
attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept");
attachmentUploadDatasObj.put("label", visualParams.getString("label"));
String label = visualParams.getString("label");
if (!ValidationUtil.isEmpty(displayName) && ("附件".equals(label) || "其他附件".equals(label))){
label = label + "(" + displayName + ")";
}
attachmentUploadDatasObj.put("label", label);
if (accept.equals(".*") || accept.contains("doc") || accept.contains("docx") || accept.contains("pdf") || accept.contains("xls") || accept.contains("xlsx")){
attachmentUploadDatasObj.put("type", "file");
} else if(accept.contains("png") || accept.contains("img")){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment