thkim 2024-01-22 14:01:00 +09:00
commit 8013ce1456
6 changed files with 28 additions and 3 deletions

View File

@ -28,8 +28,8 @@ function MenuAuthMgt(props) {
// //
menuList.forEach(function (item, index) { menuList.forEach(function (item, index) {
const checkboxs = []; const checkboxs = [];
roleList.forEach(function (item, index) { roleList.forEach(function (role) {
checkboxs.push(<div><Form.Check /></div>) checkboxs.push(<div><Form.Check checked={item.menuAuth.includes(role.itemCd)}/></div>)
}); });
mutListTag.push( mutListTag.push(
<div className={"list_item"} key={"userListDiv_"+index}> <div className={"list_item"} key={"userListDiv_"+index}>

View File

@ -318,7 +318,7 @@ public class AdminConfigController extends BaseController {
public ResultVO getMenuAuthMgt(){ public ResultVO getMenuAuthMgt(){
ResultVO resultVO = new ResultVO(); ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("menuList", adminConfigService.selectMenuList()); resultMap.put("menuList", adminConfigService.selectMenuAuthList());
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE")); resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
resultVO.setResult(resultMap); resultVO.setResult(resultMap);
return resultVO; return resultVO;

View File

@ -55,4 +55,7 @@ public class TcMenu {
@Transient @Transient
private String menuTypeValue; private String menuTypeValue;
@Transient
private String menuAuth;
} }

View File

@ -10,4 +10,5 @@ public interface TcMenuMapper {
List<TcMenu> selectMenuList(); List<TcMenu> selectMenuList();
List<TcMenu> selectMenuAuthList();
} }

View File

@ -140,4 +140,8 @@ public class AdminConfigService extends EgovAbstractServiceImpl {
return null; return null;
} }
} }
public List<TcMenu> selectMenuAuthList(){
return menuMapper.selectMenuAuthList();
}
} }

View File

@ -24,4 +24,21 @@
order by menu_id asc order by menu_id asc
</select> </select>
<select id="selectMenuAuthList" resultType="TcMenu">
select a.menu_id ,
a.menu_title ,
a.menu_group ,
coalesce(b.role_cd, '') as menu_auth
from tc_menu a
left outer join (
select menu_id , string_agg(role_id, ',') as role_cd
from (
select distinct *
from tb_menu_role
) aa
group by menu_id
) b on a.menu_id = b.menu_id
where a.use_yn = 'Y'
order by a.menu_id asc
</select>
</mapper> </mapper>