新增菜单tab页
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
FROM
|
||||
sys_function
|
||||
WHERE
|
||||
STATE = 1 AND Type IN(0,1)
|
||||
STATE = 1 AND Type IN(0,1,4)
|
||||
</select>
|
||||
|
||||
<select id="getFunctionsByList" resultType="FunctionVO">
|
||||
@@ -29,7 +29,7 @@
|
||||
FROM
|
||||
sys_function
|
||||
WHERE
|
||||
STATE = 1 AND Type = 0
|
||||
STATE = 1 AND Type IN (0,4)
|
||||
AND
|
||||
Id in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
|
||||
@@ -165,7 +165,8 @@ public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function> i
|
||||
|
||||
@Override
|
||||
public List<Function> getButtonsById(String id) {
|
||||
return this.lambdaQuery().eq(Function::getPid,id).eq(Function::getType,FunctionState.BUTTON).eq(Function::getState,FunctionState.ENABLE).list();
|
||||
List<Integer> typeList = Arrays.asList(FunctionState.BUTTON,FunctionState.PUBLIC,FunctionState.TAB);
|
||||
return this.lambdaQuery().eq(Function::getPid,id).in(Function::getType,typeList).eq(Function::getState,FunctionState.ENABLE).orderByAsc(Function::getType).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,6 +191,8 @@ public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function> i
|
||||
.collect(Collectors.toList());
|
||||
//组装驾驶舱
|
||||
setDriverChildren(result);
|
||||
//处理tab页
|
||||
setTab(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -278,6 +281,29 @@ public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function> i
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理tab页
|
||||
*/
|
||||
private void setTab(List<FunctionVO> list) {
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item->{
|
||||
List<FunctionVO> children = item.getChildren();
|
||||
if (!CollectionUtils.isEmpty(children)){
|
||||
for (FunctionVO child : children) {
|
||||
List<FunctionVO> children2 = child.getChildren();
|
||||
if (!CollectionUtils.isEmpty(children2)){
|
||||
setTab(children2);
|
||||
} else if (Objects.equals(child.getType(),4)){
|
||||
item.setUserTab(item.getChildren());
|
||||
item.setChildren(new ArrayList<>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,
|
||||
* 1.检查是否存在相同名称的菜单
|
||||
|
||||
Reference in New Issue
Block a user