feat: (feature/REQ-3167) 修改端的排序
This commit is contained in:
parent
7ac8b298e3
commit
e51fa809a5
@ -83,7 +83,6 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@ -225,7 +224,12 @@ public class SaasFeatureResourceServiceImpl extends ServiceImpl<SaasFeatureResou
|
||||
// 非分组和页面的菜单资源应该都能看到,所以只有有配置应用范围的菜单资源才进行过滤
|
||||
.filter(e -> filterWorkspaceType(req, e))
|
||||
.map(this::featureResource2Node)
|
||||
.sorted(Comparator.comparing(FeatureResourceDTO::getDisplayOrder))
|
||||
.sorted(Comparator.comparing(e -> {
|
||||
if (Objects.equals(e.getFeatureType(), FeatureResourceType.ROOT.getCode())) {
|
||||
return e.getId();
|
||||
}
|
||||
return e.getDisplayOrder().longValue();
|
||||
}))
|
||||
.collect(Collectors.toList()))
|
||||
.stream()
|
||||
// 因为存在tree中某个节点被隐藏,导致它的子节点构建在tree的root上,应该排除掉,root节点一定是parentId == 0的
|
||||
|
||||
Loading…
Reference in New Issue
Block a user