指标库新增web页面树形接口

This commit is contained in:
ly19960718 2021-04-13 17:45:53 +08:00
parent ce016b07ff
commit 83d7a7bdee
5 changed files with 26 additions and 20 deletions

View File

@ -56,14 +56,6 @@ public class IndexLibController extends DefaultBaseController {
@ApiOperation(value = "修改指标状态", notes = "修改指标状态接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "indexLibId", value = "ID", paramType = "path"),

View File

@ -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<IndexLibZTreeDTO> childrens;
public static long getSerialVersionUID() {
@ -61,4 +65,11 @@ public class IndexLibZTreeDTO {
}
public List<IndexLibZTreeDTO> getChildrens() {
return childrens;
}
public void setChildrens(List<IndexLibZTreeDTO> childrens) {
this.childrens = childrens;
}
}

View File

@ -21,7 +21,7 @@ import java.util.Map;
public interface IIndexLibService {
/**
* web页面树形列表
* web页面树形列表递归处理
* @param params
* @return
* @throws Exception

View File

@ -38,13 +38,16 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
List<IndexLibZTreeDTO> list = indexLibDao.listZTreeWeb(params);
for (IndexLibZTreeDTO indexLibZTreeDTO : list) {
Map<String,Object> 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<String,Object> data = new HashMap<>();
//// data.put("parentId",indexLibZTreeDTO.getId());
//// Integer count = countByParentIdWeb(data);
//// if (count > 0){
//// indexLibZTreeDTO.setIsParent(true);
//// }else{
//// indexLibZTreeDTO.setIsParent(false);
//// }
}
return list;
}

View File

@ -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)
});
}
},