From a839bd570886b80b403dfc9d00524986b4f56012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Fri, 5 Jan 2024 18:00:00 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=A3=BC=EC=84=9D=20=EC=82=AD=EC=A0=9C.=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=EC=A2=8C=EC=B8=A1=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=EC=9E=90=EB=8F=99=ED=99=94.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/EgovPaging.jsx | 53 ------------------- .../components/leftmenu/EgovLeftNavAdmin.jsx | 34 +++++++++++- .../src/pages/admin/config/BaseCodeMgt.jsx | 2 +- .../src/pages/admin/users/List.jsx | 2 +- 4 files changed, 34 insertions(+), 57 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/components/EgovPaging.jsx b/egovframe-template-simple-react-contribution/src/components/EgovPaging.jsx index 9fffccf..b16e8c6 100644 --- a/egovframe-template-simple-react-contribution/src/components/EgovPaging.jsx +++ b/egovframe-template-simple-react-contribution/src/components/EgovPaging.jsx @@ -46,59 +46,6 @@ function EgovPaging({pagination, moveToPage}) { ); } - /*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 =
  • -
  • ; - paginationTag.push(firstPageTag); - - // 이전 페이지 이동 - const prevPageIndex = (currentPageNo - 1 > 0) ? currentPageNo - 1 : 1; - const previousPageTag =
  • -
  • ; - paginationTag.push(previousPageTag); - } - - for (let i = currentFirstPage; i <= currentLastPage; i++) { - if (i === currentPageNo) { - // 현재 페이지 - const currentPage =
  • - -
  • ; - paginationTag.push(currentPage); - } else { - // 다른 페이지 - const otherPage =
  • - -
  • ; - console.log("@@@ otherpage : " + otherPage); - paginationTag.push(otherPage); - } - } - - if (totalPageCount > pageSize) { - // 다음 페이지 이동 - const nextPageIndex = (currentLastPage + 1 < totalPageCount) ? currentLastPage + 1 : totalPageCount; - const nextPageTag =
  • - -
  • ; - paginationTag.push(nextPageTag); - - // 마지막 페이지 이동 - const lastPageTag =
  • -
  • ; - paginationTag.push(lastPageTag); - }*/ } console.log("paginationTag", paginationTag); console.groupEnd("EgovPaging"); diff --git a/egovframe-template-simple-react-contribution/src/components/leftmenu/EgovLeftNavAdmin.jsx b/egovframe-template-simple-react-contribution/src/components/leftmenu/EgovLeftNavAdmin.jsx index c1b6fe7..03edf31 100644 --- a/egovframe-template-simple-react-contribution/src/components/leftmenu/EgovLeftNavAdmin.jsx +++ b/egovframe-template-simple-react-contribution/src/components/leftmenu/EgovLeftNavAdmin.jsx @@ -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 (
    diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/config/BaseCodeMgt.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/config/BaseCodeMgt.jsx index c15c435..54d6306 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/config/BaseCodeMgt.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/config/BaseCodeMgt.jsx @@ -30,7 +30,7 @@ function BaseCodeMgt(props) {
    {/* */} - +
    {/* */} diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx index 33b1ceb..725e63e 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/users/List.jsx @@ -99,7 +99,7 @@ function List(props) {
    {/* */} - +
    {/* */}