parent
5cd1c3148d
commit
a839bd5708
|
|
@ -46,59 +46,6 @@ function EgovPaging({pagination, moveToPage}) {
|
|||
<button onClick={e => {moveToPage(pagination.maxNum)}} className="last"></button>
|
||||
</li>);
|
||||
}
|
||||
/*const currentPageNo = pagination.currentPageNo;
|
||||
const pageSize = pagination.pageSize;
|
||||
const totalRecordCount = pagination.contentCnt;
|
||||
const recordCountPerPage = pagination.rowCnt;
|
||||
|
||||
const totalPageCount = Math.ceil(totalRecordCount / recordCountPerPage);
|
||||
const currentFirstPage = Math.floor((currentPageNo - 1) / pageSize) * pageSize + 1;
|
||||
let currentLastPage = currentFirstPage + pageSize - 1;
|
||||
currentLastPage = (currentLastPage > totalPageCount) ? totalPageCount : currentLastPage;
|
||||
|
||||
if (totalPageCount > pageSize) {
|
||||
// 첫 페이지 이동
|
||||
const firstPageTag = <li key="fp" className="btn">
|
||||
<button onClick={e => {moveToPage(1)}} className="first">처음</button></li>;
|
||||
paginationTag.push(firstPageTag);
|
||||
|
||||
// 이전 페이지 이동
|
||||
const prevPageIndex = (currentPageNo - 1 > 0) ? currentPageNo - 1 : 1;
|
||||
const previousPageTag = <li key="pp" className="btn">
|
||||
<button onClick={e => {moveToPage(prevPageIndex)}} className="prev">이전</button></li>;
|
||||
paginationTag.push(previousPageTag);
|
||||
}
|
||||
|
||||
for (let i = currentFirstPage; i <= currentLastPage; i++) {
|
||||
if (i === currentPageNo) {
|
||||
// 현재 페이지
|
||||
const currentPage = <li key={i}>
|
||||
<button className="cur">{i}</button>
|
||||
</li>;
|
||||
paginationTag.push(currentPage);
|
||||
} else {
|
||||
// 다른 페이지
|
||||
const otherPage = <li key={i}>
|
||||
<button onClick={e => {moveToPage(i)}}>{i}</button>
|
||||
</li>;
|
||||
console.log("@@@ otherpage : " + otherPage);
|
||||
paginationTag.push(otherPage);
|
||||
}
|
||||
}
|
||||
|
||||
if (totalPageCount > pageSize) {
|
||||
// 다음 페이지 이동
|
||||
const nextPageIndex = (currentLastPage + 1 < totalPageCount) ? currentLastPage + 1 : totalPageCount;
|
||||
const nextPageTag = <li key="np" className="btn">
|
||||
<button onClick={e => {moveToPage(nextPageIndex)}} className="next">다음</button>
|
||||
</li>;
|
||||
paginationTag.push(nextPageTag);
|
||||
|
||||
// 마지막 페이지 이동
|
||||
const lastPageTag = <li key="lp" className="btn">
|
||||
<button onClick={e => {moveToPage(totalPageCount)}} className="last"></button></li>;
|
||||
paginationTag.push(lastPageTag);
|
||||
}*/
|
||||
}
|
||||
console.log("paginationTag", paginationTag);
|
||||
console.groupEnd("EgovPaging");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,40 @@
|
|||
import React from 'react';
|
||||
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import URL from 'constants/url';
|
||||
import {Accordion} from "react-bootstrap";
|
||||
|
||||
function EgovLeftNavAdmin({activeKey}) {
|
||||
function EgovLeftNavAdmin(props) {
|
||||
const location = useLocation();
|
||||
|
||||
const getMiddleFolder = (url) => { // 중간 폴더를 가져오는 로직 추가
|
||||
const parts = url.split('/').filter(Boolean); // '/'로 분할하고 빈 문자열을 필터링
|
||||
if (parts.length >= 2) {
|
||||
return parts[1]; // 중간 폴더 반환
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const activeFolder = getMiddleFolder(location.pathname);
|
||||
|
||||
let activeKey;
|
||||
if (activeFolder === "config") {
|
||||
activeKey = "0";
|
||||
} else if (activeFolder === "users") {
|
||||
activeKey = "1";
|
||||
} else if (activeFolder === "boards") {
|
||||
activeKey = "2";
|
||||
} else if (activeFolder === "standards") {
|
||||
activeKey = "3";
|
||||
} else if (activeFolder === "contents") {
|
||||
activeKey = "4";
|
||||
} else if (activeFolder === "committee") {
|
||||
activeKey = "5";
|
||||
} else if (activeFolder === "logs") {
|
||||
activeKey = "6";
|
||||
} else {
|
||||
activeKey = "7";
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="nav">
|
||||
<div className="inner">
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function BaseCodeMgt(props) {
|
|||
</div>
|
||||
<div className="layout">
|
||||
{/* <!-- Navigation --> */}
|
||||
<EgovLeftNav activeKey={"0"}></EgovLeftNav>
|
||||
<EgovLeftNav />
|
||||
<div className="contents NOTICE_LIST" id="contents">
|
||||
{/* <!-- 본문 --> */}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ function List(props) {
|
|||
</div>
|
||||
<div className="layout">
|
||||
{/* <!-- Navigation --> */}
|
||||
<EgovLeftNav activeKey={"1"}></EgovLeftNav>
|
||||
<EgovLeftNav/>
|
||||
<div className="contents NOTICE_LIST" id="contents">
|
||||
{/* <!-- 본문 --> */}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue