메뉴권한관리 작업중.

thkim
강석 최 2024-01-19 17:59:57 +09:00
parent cc718b8df3
commit 1a18729a54
6 changed files with 84 additions and 35 deletions

View File

@ -187,25 +187,25 @@
.menuList .result .list_item > div:nth-child(7) {width: 100px;} .menuList .result .list_item > div:nth-child(7) {width: 100px;}
.menuList .result .list_item > div:nth-child(8) {width: 100px;} .menuList .result .list_item > div:nth-child(8) {width: 100px;}
/* 사이트관리 > 환경설정 > 메뉴관리 */ /* 사이트관리 > 환경설정 > 메뉴권한관리 */
.menuList .head > span:nth-child(1) {width: 100px;} .roleList .head > span:nth-child(1) {width: 120px;}
.menuList .head > span:nth-child(2) {width: 150px;} .roleList .head > span:nth-child(2) {width: 180px;}
.menuList .head > span:nth-child(3) {width: 100px;} .roleList .head > span:nth-child(3) {width: 120px;}
.menuList .head > span:nth-child(4) {width: 60px;} .roleList .head > span:nth-child(4) {width: 60px;}
.menuList .head > span:nth-child(5) {width: 60px;} .roleList .head > span:nth-child(5) {width: 60px;}
.menuList .head > span:nth-child(6) {width: 60px;} .roleList .head > span:nth-child(6) {width: 60px;}
.menuList .head > span:nth-child(7) {width: 60px;} .roleList .head > span:nth-child(7) {width: 60px;}
.menuList .head > span:nth-child(8) {width: 60px;} .roleList .head > span:nth-child(8) {width: 60px;}
.menuList .head > span:nth-child(9) {width: 100px;} .roleList .head > span:nth-child(9) {width: 100px;}
.menuList .result .list_item > div:nth-child(1) {width: 100px;} .roleList .result .list_item > div:nth-child(1) {width: 120px;}
.menuList .result .list_item > div:nth-child(2) {width: 150px;} .roleList .result .list_item > div:nth-child(2) {width: 180px;}
.menuList .result .list_item > div:nth-child(3) {width: 100px;} .roleList .result .list_item > div:nth-child(3) {width: 120px;}
.menuList .result .list_item > div:nth-child(4) {width: 60px;} .roleList .result .list_item > div:nth-child(4) {width: 60px;}
.menuList .result .list_item > div:nth-child(5) {width: 60px;} .roleList .result .list_item > div:nth-child(5) {width: 60px;}
.menuList .result .list_item > div:nth-child(6) {width: 60px;} .roleList .result .list_item > div:nth-child(6) {width: 60px;}
.menuList .result .list_item > div:nth-child(7) {width: 60px;} .roleList .result .list_item > div:nth-child(7) {width: 60px;}
.menuList .result .list_item > div:nth-child(8) {width: 60px;} .roleList .result .list_item > div:nth-child(8) {width: 60px;}
.menuList .result .list_item > div:nth-child(9) {width: 100px;} .roleList .result .list_item > div:nth-child(9) {width: 100px;}
/* 사이트소개 */ /* 사이트소개 */
.SITE_INTRO .ds_1 .t_1 {margin-top: 52px; color: #000; font-size: 26px; font-weight: 500; text-align: center;} .SITE_INTRO .ds_1 .t_1 {margin-top: 52px; color: #000; font-size: 26px; font-weight: 500; text-align: center;}

View File

@ -3,10 +3,12 @@ import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import URL from "constants/url"; import URL from "constants/url";
import * as EgovNet from "api/egovFetch"; import * as EgovNet from "api/egovFetch";
import Form from "react-bootstrap/Form";
function MenuAuthMgt(props) { function MenuAuthMgt(props) {
const [listTag, setListTag] = useState([]); const [listTag, setListTag] = useState([]);
const [roleHeader, setRoleHeader] = useState([]);
const retrieveList = useCallback(() => { const retrieveList = useCallback(() => {
EgovNet.requestFetch( EgovNet.requestFetch(
@ -15,28 +17,40 @@ function MenuAuthMgt(props) {
method: "GET" method: "GET"
}, },
(resp) => { (resp) => {
const menuList = resp.result.menuList;
const roleList = resp.result.roleList
let mutListTag = []; let mutListTag = [];
let headerTag = [];
setListTag([]); setListTag([]);
setRoleHeader([]);
// //
resp.result.menuList.forEach(function (item, index) { menuList.forEach(function (item, index) {
const checkboxs = [];
roleList.forEach(function (item, index) {
checkboxs.push(<div><Form.Check /></div>)
});
mutListTag.push( mutListTag.push(
<div className={"list_item"} key={"userListDiv_"+index}> <div className={"list_item"} key={"userListDiv_"+index}>
<div>{item.menuId}</div> <div>{item.menuId}</div>
<div>{item.menuTitle}</div> <div>{item.menuTitle}</div>
<div>{item.menuGroup}</div> <div>{item.menuGroup}</div>
<div>{item.menuLevel}</div> {checkboxs}
<div>{item.menuSort}</div>
<div>{item.menuUrl}</div>
<div>{item.menuTypeValue}</div>
<div> <div>
<button className={"btn btn_blue_h31 px-1"} onClick={()=>{editMenu(item)}}>수정</button> <button className={"btn btn_blue_h31 px-1"} onClick={()=>{editMenu(item)}}>저장</button>
</div> </div>
</div> </div>
); );
}); });
if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); //
roleList.forEach(function (item, index) {
headerTag.push(<span>{item.itemNm}</span>)
});
setListTag(mutListTag); setListTag(mutListTag);
setRoleHeader(headerTag)
}, },
function (resp) { function (resp) {
console.log("err response : ", resp); console.log("err response : ", resp);
@ -49,7 +63,7 @@ function MenuAuthMgt(props) {
} }
useEffect(()=>{ useEffect(()=>{
/*retrieveList();*/ retrieveList();
}, []) }, [])
return ( return (
@ -70,20 +84,16 @@ function MenuAuthMgt(props) {
{/* <!-- 본문 --> */} {/* <!-- 본문 --> */}
<div className="top_tit"> <div className="top_tit">
<h1 className="tit_1">메뉴 관리</h1> <h1 className="tit_1">메뉴 권한 관리</h1>
</div> </div>
<h2 className="tit_2"></h2> <h2 className="tit_2"></h2>
<div className="board_list menuList"> <div className="board_list roleList">
<div className="head"> <div className="head">
<span>메뉴 코드</span> <span>메뉴 코드</span>
<span>메뉴 이름</span> <span>메뉴 이름</span>
<span>부모 메뉴</span> <span>부모 메뉴</span>
<span>레벨1</span> {roleHeader}
<span>레벨2</span>
<span>레벨3</span>
<span>레벨4</span>
<span>레벨5</span>
<span></span> <span></span>
</div> </div>
<div className="result"> <div className="result">

View File

@ -20,6 +20,8 @@ function List({}) {
}); });
const [listTag, setListTag] = useState([]); const [listTag, setListTag] = useState([]);
const [userSeOption, setUserSeOption] = useState([]);
const [paginationInfo, setPaginationInfo] = useState({}); const [paginationInfo, setPaginationInfo] = useState({});
const [show, setShow] = useState(false); const [show, setShow] = useState(false);
@ -38,8 +40,10 @@ function List({}) {
(resp) => { (resp) => {
setPaginationInfo(resp.result.paginationInfo); setPaginationInfo(resp.result.paginationInfo);
let mutListTag = []; let mutListTag = [];
let userSeTag = [];
setListTag([]); setListTag([]);
setUserSeOption([]);
// //
resp.result.userList.forEach(function (item, index) { resp.result.userList.forEach(function (item, index) {
mutListTag.push( mutListTag.push(
@ -55,7 +59,13 @@ function List({}) {
); );
}); });
if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // if(!mutListTag.length) mutListTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); //
resp.result.userSeOption.forEach(function (item, index){
userSeTag.push(<option value={item.itemCd}>{item.itemNm}</option>)
})
setListTag(mutListTag); setListTag(mutListTag);
setUserSeOption(userSeTag);
}, },
function (resp) { function (resp) {
console.log("err response : ", resp); console.log("err response : ", resp);
@ -133,8 +143,7 @@ function List({}) {
<select id="sel1" title="구분" defaultValue={searchCondition.userSe} <select id="sel1" title="구분" defaultValue={searchCondition.userSe}
onChange={(e) => {setSearchCondition({...searchCondition, userSe: e.target.value})}}> onChange={(e) => {setSearchCondition({...searchCondition, userSe: e.target.value})}}>
<option value="">전체</option> <option value="">전체</option>
<option value="ACC_TP01">관리자</option> {userSeOption}
<option value="ACC_TP02">일반사용자</option>
</select> </select>
</label> </label>
</li> </li>

View File

@ -8203,6 +8203,11 @@ react-bootstrap@^2.9.0:
uncontrollable "^7.2.1" uncontrollable "^7.2.1"
warning "^4.0.3" warning "^4.0.3"
react-csv@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/react-csv/-/react-csv-2.2.2.tgz#5bbf0d72a846412221a14880f294da9d6def9bfb"
integrity sha512-RG5hOcZKZFigIGE8LxIEV/OgS1vigFQT4EkaHeKgyuCbUAu9Nbd/1RYq++bJcJJ9VOqO/n9TZRADsXNDR4VEpw==
react-datepicker@^4.8.0: react-datepicker@^4.8.0:
version "4.10.0" version "4.10.0"
resolved "https://registry.npmjs.org/react-datepicker/-/react-datepicker-4.10.0.tgz" resolved "https://registry.npmjs.org/react-datepicker/-/react-datepicker-4.10.0.tgz"

View File

@ -5,6 +5,7 @@ import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem; import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService; import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
import com.dbnt.kcscbackend.auth.entity.LoginVO; import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
import com.dbnt.kcscbackend.config.common.BaseController; import com.dbnt.kcscbackend.config.common.BaseController;
import com.dbnt.kcscbackend.config.common.ResponseCode; import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO; import com.dbnt.kcscbackend.config.common.ResultVO;
@ -34,6 +35,7 @@ import java.util.Map;
public class AdminConfigController extends BaseController { public class AdminConfigController extends BaseController {
private final AdminConfigService adminConfigService; private final AdminConfigService adminConfigService;
private final CommonCodeService commonCodeService;
@Operation( @Operation(
summary = "기본코드 그룹 조회", summary = "기본코드 그룹 조회",
@ -302,4 +304,24 @@ public class AdminConfigController extends BaseController {
} }
return resultVO; return resultVO;
} }
@Operation(
summary = "메뉴 권한 조회",
description = "메뉴 권한 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/menu-auth-mgt")
public ResultVO getMenuAuthMgt(){
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("menuList", adminConfigService.selectMenuList());
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
resultVO.setResult(resultMap);
return resultVO;
}
} }

View File

@ -4,6 +4,7 @@ package com.dbnt.kcscbackend.admin.users;
import com.dbnt.kcscbackend.admin.users.service.AdminUsersService; import com.dbnt.kcscbackend.admin.users.service.AdminUsersService;
import com.dbnt.kcscbackend.auth.entity.LoginVO; import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.auth.entity.UserInfo; import com.dbnt.kcscbackend.auth.entity.UserInfo;
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
import com.dbnt.kcscbackend.config.common.BaseController; import com.dbnt.kcscbackend.config.common.BaseController;
import com.dbnt.kcscbackend.config.common.ResponseCode; import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO; import com.dbnt.kcscbackend.config.common.ResultVO;
@ -32,6 +33,7 @@ import java.util.Map;
public class AdminUsersController extends BaseController { public class AdminUsersController extends BaseController {
private final AdminUsersService adminUsersService; private final AdminUsersService adminUsersService;
private final CommonCodeService commonCodeService;
@Operation( @Operation(
summary = "사용자 목록 조회", summary = "사용자 목록 조회",
@ -47,6 +49,7 @@ public class AdminUsersController extends BaseController {
ResultVO resultVO = new ResultVO(); ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
params.setQueryInfo(); params.setQueryInfo();
resultMap.put("userSeOption", commonCodeService.selectCodeItemList("ACC_TYPE"));
resultMap.put("userList", adminUsersService.selectUserList(params)); resultMap.put("userList", adminUsersService.selectUserList(params));
params.setContentCnt(adminUsersService.selectUserListCnt(params)); params.setContentCnt(adminUsersService.selectUserListCnt(params));
params.setPaginationInfo(); params.setPaginationInfo();