|
@@ -358,10 +358,29 @@ public class TableServiceCmdService {
|
|
// 默认查所有字段,不支持自定义
|
|
// 默认查所有字段,不支持自定义
|
|
JSONObject json = selectService.selectById(tableName, pkName, id);
|
|
JSONObject json = selectService.selectById(tableName, pkName, id);
|
|
|
|
|
|
- handler(Collections.singletonList(json), columns);
|
|
|
|
|
|
+ List<GenTableColumn> parentColumns = filter(columns, col -> HR.equalsIgnoreCase(col.getHtmlType()));
|
|
|
|
+ // 处理成hr的形式
|
|
|
|
+ for (GenTableColumn hrColumn : parentColumns) {
|
|
|
|
+ List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
|
|
|
|
+ for (GenTableColumn column : columns) {
|
|
|
|
+ if (hrColumn.getColumnId().equals(column.getHrParentId())) {
|
|
|
|
+ // handler column
|
|
|
|
+ if (json.containsKey(column.getColumnName())) {
|
|
|
|
+ handlerSysDictData(Collections.singletonList(json), Collections.singletonList(column));
|
|
|
|
+ handlerDate(Collections.singletonList(json), Collections.singletonList(column));
|
|
|
|
+ handlerForeignKey(Collections.singletonList(json), Collections.singletonList(column));
|
|
|
|
+ column.setColumnValue(json.get(column.getColumnName()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ children.add(column);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ hrColumn.setHrChildren(children);
|
|
|
|
+ }
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
- result.put(SHOW_DATA, packSingleObj(json, columns));
|
|
|
|
|
|
+// result.put(SHOW_DATA, packSingleObj(json, columns));
|
|
|
|
+ result.put(SHOW_DATA, parentColumns);
|
|
result.put(BUTTON_LIST, getButton(tableName));
|
|
result.put(BUTTON_LIST, getButton(tableName));
|
|
return AjaxResult.success(result);
|
|
return AjaxResult.success(result);
|
|
}
|
|
}
|