mirror of
https://gitee.com/freshday/radar.git
synced 2025-12-26 07:16:26 +08:00
fix:前端未同步.
feihu.wang
This commit is contained in:
parent
5ec348d37b
commit
7422031b19
@ -83,11 +83,13 @@ public class ActivationApiController {
|
|||||||
if (StringUtils.isNotEmpty(pt.getType()) && pt.getType().equals("JSON")) {
|
if (StringUtils.isNotEmpty(pt.getType()) && pt.getType().equals("JSON")) {
|
||||||
//load http request data
|
//load http request data
|
||||||
JsonNode json = preItem.getConfigJson();
|
JsonNode json = preItem.getConfigJson();
|
||||||
extractMetaColumn(ds, preItem, json.toString());
|
List<DataColumnInfo> children = new ArrayList<>();
|
||||||
|
extractMetaColumn(ds, preItem, json.toString(), children);
|
||||||
} else if (StringUtils.isNotEmpty(pt.getType())) {
|
} else if (StringUtils.isNotEmpty(pt.getType())) {
|
||||||
ds.addChildren(preItem.getLabel(), preItem.getDestField(), pt.getType());
|
ds.addChildren(preItem.getLabel(), preItem.getDestField(), pt.getType());
|
||||||
} else {
|
} else {
|
||||||
extractMetaColumn(ds, preItem, pt.getMeta());
|
List<DataColumnInfo> children = new ArrayList<>();
|
||||||
|
extractMetaColumn(ds, preItem, pt.getMeta(), children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list.add(ds);
|
list.add(ds);
|
||||||
@ -161,23 +163,14 @@ public class ActivationApiController {
|
|||||||
return activationService.updateOrder(activationId,ruleOrder);
|
return activationService.updateOrder(activationId,ruleOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void extractMetaColumn(DataColumnInfo ds, PreItemVO preItem, String jsonStr) {
|
private void extractMetaColumn(DataColumnInfo ds, PreItemVO preItem, String jsonStr, List<DataColumnInfo> children) {
|
||||||
JSONArray jsonArray = JSONArray.parseArray(jsonStr);
|
JSONArray array = JSONArray.parseArray(jsonStr);
|
||||||
List<DataColumnInfo> children = getColumnInfos(jsonArray);
|
|
||||||
ds.addChildren(preItem.getLabel(), preItem.getDestField(), children);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<DataColumnInfo> getColumnInfos(JSONArray array) {
|
|
||||||
if(array == null){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
List<DataColumnInfo> children = new ArrayList<>();
|
|
||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject obj = array.getJSONObject(i);
|
JSONObject obj = array.getJSONObject(i);
|
||||||
children.add(new DataColumnInfo(obj.getString("title"), obj.getString("column"), obj
|
children.add(new DataColumnInfo(obj.getString("title"), obj.getString("column"), obj
|
||||||
.getString("type"), getColumnInfos((JSONArray)obj.get("children"))));
|
.getString("type")));
|
||||||
}
|
}
|
||||||
return children;
|
ds.addChildren(preItem.getLabel(), preItem.getDestField(), children);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/disable/{activationId}")
|
@PostMapping("/disable/{activationId}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user