|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
@@ -279,10 +280,13 @@ public class SysPermissionController {
|
|
|
List<Map<String,Object>> mapListChild=new ArrayList<>();
|
|
|
|
|
|
if(menujsonArray.getJSONObject(i).getJSONArray("children")!=null){
|
|
|
- getChildList(mapListChild,menujsonArray.getJSONObject(i).getJSONArray("children"));
|
|
|
+ getChildList(name,mapListChild,menujsonArray.getJSONObject(i).getJSONArray("children"));
|
|
|
}
|
|
|
map.put("childList",mapListChild);
|
|
|
- mapList.add(map);
|
|
|
+
|
|
|
+ if(mapListChild!=null&&mapListChild.size()>0){
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -297,17 +301,25 @@ public class SysPermissionController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void getChildList(List<Map<String,Object>> mapListChild,JSONArray jsonArray){
|
|
|
+ public void getChildList(String name,List<Map<String,Object>> mapListChild,JSONArray jsonArray){
|
|
|
for(int i=0;i<jsonArray.size();i++){
|
|
|
if(jsonArray.getJSONObject(i).getJSONArray("children")!=null){
|
|
|
- getChildList(mapListChild,jsonArray.getJSONObject(i).getJSONArray("children"));
|
|
|
+ getChildList(name,mapListChild,jsonArray.getJSONObject(i).getJSONArray("children"));
|
|
|
}else{
|
|
|
+ String titleName=jsonArray.getJSONObject(i).getJSONObject("meta").get("title").toString();
|
|
|
Map<String,Object> map=new LinkedHashMap<>();
|
|
|
map.put("name",jsonArray.getJSONObject(i).getJSONObject("meta").get("title"));
|
|
|
map.put("sysPermissionId",jsonArray.getJSONObject(i).get("id"));
|
|
|
map.put("path",jsonArray.getJSONObject(i).get("path"));
|
|
|
map.put("id",jsonArray.getJSONObject(i).get("id"));
|
|
|
- mapListChild.add(map);
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(name)){
|
|
|
+ if(StringUtils.isNotBlank(titleName)&&titleName.indexOf(name)!=-1){
|
|
|
+ mapListChild.add(map);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ mapListChild.add(map);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|