페이지네이션 주석 삭제.

관리자 좌측 메뉴 자동화.
thkim
강석 최 2024-01-05 18:00:00 +09:00
parent 5cd1c3148d
commit a839bd5708
4 changed files with 34 additions and 57 deletions

View File

@ -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");

View File

@ -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">

View File

@ -30,7 +30,7 @@ function BaseCodeMgt(props) {
</div>
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav activeKey={"0"}></EgovLeftNav>
<EgovLeftNav />
<div className="contents NOTICE_LIST" id="contents">
{/* <!-- 본문 --> */}

View File

@ -99,7 +99,7 @@ function List(props) {
</div>
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav activeKey={"1"}></EgovLeftNav>
<EgovLeftNav/>
<div className="contents NOTICE_LIST" id="contents">
{/* <!-- 본문 --> */}