From 83d7a7bdeed1fa80f1d9397c3c1c81a6a28385d7 Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Tue, 13 Apr 2021 17:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=BA=93=E6=96=B0=E5=A2=9Ewe?= =?UTF-8?q?b=E9=A1=B5=E9=9D=A2=E6=A0=91=E5=BD=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/indexlib/IndexLibController.java | 8 -------- .../pojo/dtos/indexlib/IndexLibZTreeDTO.java | 11 +++++++++++ .../service/indexlib/IIndexLibService.java | 2 +- .../indexlib/impl/IndexLibServiceImpl.java | 17 ++++++++++------- .../resources/static/route/web/assessment.html | 8 ++++---- 5 files changed, 26 insertions(+), 20 deletions(-) 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) }); } },