diff --git a/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java b/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java index ed08edb..7253939 100644 --- a/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java +++ b/src/main/java/com/tenlion/twoduty/controller/api/indexlib/IndexLibController.java @@ -56,14 +56,6 @@ public class IndexLibController extends DefaultBaseController { - - - - - - - - @ApiOperation(value = "修改指标状态", notes = "修改指标状态接口") @ApiImplicitParams({ @ApiImplicitParam(name = "indexLibId", value = "ID", paramType = "path"), diff --git a/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibZTreeDTO.java b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibZTreeDTO.java index 804139e..4dd72d9 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibZTreeDTO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/dtos/indexlib/IndexLibZTreeDTO.java @@ -9,6 +9,8 @@ package com.tenlion.twoduty.pojo.dtos.indexlib; */ import io.swagger.annotations.ApiModelProperty; +import java.util.List; + public class IndexLibZTreeDTO { @@ -22,6 +24,8 @@ public class IndexLibZTreeDTO { private String name; @ApiModelProperty(name = "isParent",value = "是否父节点") private Boolean isParent; + @ApiModelProperty(name = "childrens",value = "子集节点列表") + private List childrens; public static long getSerialVersionUID() { @@ -61,4 +65,11 @@ public class IndexLibZTreeDTO { } + public List getChildrens() { + return childrens; + } + + public void setChildrens(List childrens) { + this.childrens = childrens; + } } diff --git a/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java b/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java index 26ebe48..8507b6a 100644 --- a/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java +++ b/src/main/java/com/tenlion/twoduty/service/indexlib/IIndexLibService.java @@ -21,7 +21,7 @@ import java.util.Map; public interface IIndexLibService { /** - * web页面树形列表 + * web页面树形列表(递归处理) * @param params * @return * @throws Exception diff --git a/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java b/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java index becd848..6af318a 100644 --- a/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java +++ b/src/main/java/com/tenlion/twoduty/service/indexlib/impl/IndexLibServiceImpl.java @@ -38,13 +38,16 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib List list = indexLibDao.listZTreeWeb(params); for (IndexLibZTreeDTO indexLibZTreeDTO : list) { Map data = new HashMap<>(); - data.put("parentId",indexLibZTreeDTO.getId()); - Integer count = countByParentIdWeb(data); - if (count > 0){ - indexLibZTreeDTO.setIsParent(true); - }else{ - indexLibZTreeDTO.setIsParent(false); - } + data.put("indexLibParentId",indexLibZTreeDTO.getId()); + indexLibZTreeDTO.setChildrens(this.listZTreeWeb(data)); +// Map data = new HashMap<>(); +//// data.put("parentId",indexLibZTreeDTO.getId()); +//// Integer count = countByParentIdWeb(data); +//// if (count > 0){ +//// indexLibZTreeDTO.setIsParent(true); +//// }else{ +//// indexLibZTreeDTO.setIsParent(false); +//// } } return list; } diff --git a/src/main/resources/static/route/web/assessment.html b/src/main/resources/static/route/web/assessment.html index 3bc620f..238b32e 100644 --- a/src/main/resources/static/route/web/assessment.html +++ b/src/main/resources/static/route/web/assessment.html @@ -365,16 +365,16 @@ }, // 获取左侧菜单 getNav: function () { - var self = this + var self = this; var loadLayerIndex; top.restAjax.get(top.restAjax.path('api/indexlib/listztreeweb', []), {}, null, function(code, data) { console.log(data) }, function(code, data) { - top.dialog.msg(data.msg); + dialog.msg(data.msg); }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3}); + loadLayerIndex = dialog.msg('加载中', {icon: 16, time: 0, shade: 0.3}); }, function() { - top.dialog.close(loadLayerIndex); + dialog.close(loadLayerIndex) }); } },