From 903ef68f86948ca589cb499c2da41458a1f50611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Fri, 26 Jan 2024 17:53:28 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B1=B4=EC=84=A4=EA=B8=B0=EC=A4=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B2=80=EC=83=89=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=EC=A4=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/EgovHeader.jsx | 26 ++- .../src/constants/url.js | 4 +- .../src/css/component.css | 4 +- .../{ => list}/StandardCodeList.jsx | 154 ++++++++---------- .../{ => list}/StandardCodeListModal.js | 0 .../{ => viewer}/BookmarkModal.js | 2 +- .../standardCode/{ => viewer}/Sb.style.js | 0 .../pages/standardCode/{ => viewer}/SbItem.js | 0 .../standardCode/{ => viewer}/Vw.style.js | 0 .../pages/standardCode/{ => viewer}/viewer.js | 8 +- .../{ => viewer}/viwerComponents.js | 2 +- .../src/routes/index.jsx | 5 +- 12 files changed, 100 insertions(+), 105 deletions(-) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => list}/StandardCodeList.jsx (85%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => list}/StandardCodeListModal.js (100%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/BookmarkModal.js (98%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/Sb.style.js (100%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/SbItem.js (100%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/Vw.style.js (100%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/viewer.js (99%) rename egovframe-template-simple-react-contribution/src/pages/standardCode/{ => viewer}/viwerComponents.js (99%) diff --git a/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx b/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx index 41f7132..a1b898f 100644 --- a/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx +++ b/egovframe-template-simple-react-contribution/src/components/EgovHeader.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useState} from 'react'; import { Link, NavLink, useNavigate } from 'react-router-dom'; import * as EgovNet from 'api/egovFetch'; @@ -13,6 +13,7 @@ function EgovHeader({ loginUser, onChangeLogin }) { console.group("EgovHeader"); console.log("[Start] EgovHeader ------------------------------"); + const [menuDiv, setMenuDiv] = useState(false); const accessToken = getLocalItem('accessToken'); const userInfo = parseJwt(accessToken); const sessionUserId = userInfo?.id; @@ -56,9 +57,15 @@ function EgovHeader({ loginUser, onChangeLogin }) { ); } + function allMenuControl(){ + setMenuDiv(!menuDiv); + } + console.log("------------------------------EgovHeader [End]"); console.groupEnd("EgovHeader"); + + return ( //
@@ -71,7 +78,8 @@ function EgovHeader({ loginUser, onChangeLogin }) {

주메뉴

    -
  • (isActive ? "cur" : "")}>사이트소개
  • +
  • (isActive ? "cur" : "")}>건설기준코드
  • + {/*
  • (isActive ? "cur" : "")}>사이트소개
  • */}
  • (isActive ? "cur" : "")}>정보마당
  • (isActive ? "cur" : "")}>고객지원
  • (isActive ? "cur" : "")}>알림마당
  • @@ -98,17 +106,24 @@ function EgovHeader({ loginUser, onChangeLogin }) { {/* */} {/* */} -
    +
    {/* */} -
    +

    전체메뉴

    +

    건설기준코드

    +
      +
    • (isActive ? "cur" : "")}>건설기준코드 안내
    • +
    • (isActive ? "cur" : "")}>건설기준코드 검색
    • +
    +
    + {/*

    사이트소개

    • (isActive ? "cur" : "")}>소개
    • @@ -116,7 +131,8 @@ function EgovHeader({ loginUser, onChangeLogin }) {
    • (isActive ? "cur" : "")}>조직소개
    • (isActive ? "cur" : "")}>찾아오시는 길
    -
    +
    */} +

    정보마당

      diff --git a/egovframe-template-simple-react-contribution/src/constants/url.js b/egovframe-template-simple-react-contribution/src/constants/url.js index d36fd9e..8597ffd 100644 --- a/egovframe-template-simple-react-contribution/src/constants/url.js +++ b/egovframe-template-simple-react-contribution/src/constants/url.js @@ -119,7 +119,9 @@ const URL = { ADMIN__LOGS__FILE_DOWNLOAD_STATUS : "/admin/logs/file-download-status", // 위원회 관리/파일 다운현황 //기준코드 - STANDARD_CODE_LIST : "/standardCode/list/:listCode", //건설기준코드/리스트 + STANDARD_CODE_INFO : "/standardCode/info", + STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트 + STANDARD_CODE_LIST_LINK : "/standardCode/list/:listCode", //건설기준코드/리스트 STANDARD_CODE_DETAIL : "/standardCode/detail", //건설기준코드/리스트 STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어 STANDARD_CODE_VIEWER_LINK : "/standardCode/viewer/:linkedDocCode", //건설기준코드/뷰어/새 창 링크 diff --git a/egovframe-template-simple-react-contribution/src/css/component.css b/egovframe-template-simple-react-contribution/src/css/component.css index dd27ca4..1dc342c 100644 --- a/egovframe-template-simple-react-contribution/src/css/component.css +++ b/egovframe-template-simple-react-contribution/src/css/component.css @@ -187,7 +187,7 @@ /* Condition */ -.condition {padding: 10px; border: 1px solid #dde2e5; border-radius: 10px; font-size: 0; text-align: center;} /* changed by lim padding: 26px;*/ +.condition {padding: 10px; border: 1px solid #dde2e5; border-radius: 10px; text-align: center;} /* changed by lim padding: 26px;*/ .condition > ul, .condition > ul li {display: inline-block; vertical-align: top;} .condition > ul li + li {margin-left: 20px;} @@ -246,7 +246,7 @@ select::-ms-expand {display:none;} /* 건설기준코드list 설계기준 표준시방서 전문시방서 통합 다운로드 탭 */ .right_col {display: flex; justify-content: space-between; align-items: center;} .mini_board ul {display: flex; list-style: none; padding: 0; margin: 0;} -.tab {padding: 10px; margin-right: 10px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; transition: background-color 0.3s;} +.tab {padding: 5px 10px; margin-right: 10px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; transition: background-color 0.3s;} .tab:hover {background-color: #f0f0f0;} .active {background-color: #007bff; color: #fff;} diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx similarity index 85% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx rename to egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx index b80f276..d742d88 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx @@ -8,13 +8,52 @@ import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai"; function StandardCodeList(props) { const {listCode} = useParams(); - const [show, setshow] = useState(false); - const [groupseq, setgroupseq] = useState(); + const [show, setShow] = useState(false); + const [groupSeq, setgroupSeq] = useState(); - function showhandling(e) { + console.group("StandardCodeList"); + console.log("[Start] StandardCodeList ------------------------------"); + console.log("StandardCodeList [props] : ", props); + console.log("listcode----------------------------" + listCode); + + const location = useLocation(); + console.log("StandardCodeList [location] : ", location); + + const category1Ref = useRef(); + const category2Ref = useRef(); + const category3Ref = useRef(); + const wrdRef = useRef(); + + // eslint-disable-next-line no-unused-vars + const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { + pageIndex: 1, + tab: listCode?.substring(0, 2), + category1: listCode?.substring(2, 4), + category2: listCode?.substring(4, 6), + searchWrd: '' + });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시 + const [masterBoard, setMasterBoard] = useState({}); + + /* 검색기능 추가 변수*/ + const [listData, setlistData] = useState([]); + const [filterData, setFilterData] = useState(''); + const [category1List, setCategory1List] = useState([]); + const [category2List, setCategory2List] = useState([]); + const [category3List, setCategory3List] = useState([]); + const [resultCnt, setResultCnt] = useState(0); + + /* 탭 */ + const [activeTab, setActiveTab] = useState(10); + const [subTabsVisible, setSubTabsVisible] = useState(false); + + function close() { + setShow(false); + } + + function showHandling(e) { const param = e.currentTarget.dataset; - const groupseq = param.groupseq; - console.log(groupseq); + const groupSeq = param.groupSeq; + console.log(groupSeq); EgovNet.requestFetch( '/standardCode/codeListModal.do', { @@ -23,7 +62,7 @@ function StandardCodeList(props) { 'Content-type': 'application/json' }, body: JSON.stringify( - groupseq + groupSeq ) }, (resp) => { console.log(resp + "------------------------resp") @@ -50,52 +89,14 @@ function StandardCodeList(props) { ) } - setgroupseq(); + setgroupSeq(); } ) - setshow(true); + setShow(true); } - function close() { - setshow(false); - } - - console.group("StandardCodeList"); - console.log("[Start] StandardCodeList ------------------------------"); - console.log("StandardCodeList [props] : ", props); - console.log("listcode----------------------------" + listCode); - - const location = useLocation(); - console.log("StandardCodeList [location] : ", location); - - const category1Ref = useRef(); - const category2Ref = useRef(); - const category3Ref = useRef(); - const wrdRef = useRef(); - - // eslint-disable-next-line no-unused-vars - const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { - pageIndex: 1, - tab: listCode.substring(0, 2), - category1: listCode.substring(2, 4), - category2: listCode.substring(4, 6), - searchWrd: '' - });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시 - const [masterBoard, setMasterBoard] = useState({}); - - /* 검색기능 추가 변수*/ - const [listdata, setlistdata] = useState([]); - const [filterData, setfilterData] = useState(''); - const [category1List, setCategory1List] = useState([]); - const [category2List, setCategory2List] = useState([]); - const [category3List, setCategory3List] = useState([]); - const [resultCnt, setResultCnt] = useState(0); - - /* 탭 */ - const [activeTab, setActiveTab] = useState(10); - const [subTabsVisible, setSubTabsVisible] = useState(false); - + const handleTabClick = (tabName) => { setActiveTab(tabName); @@ -135,7 +136,7 @@ function StandardCodeList(props) { (resp) => { setMasterBoard(resp.result.tnDocumentInfo); /*검색을 위한 리스트 state에 저장*/ - setlistdata(resp.result.resultList); + setlistData(resp.result.resultList); setCategory1List(resp.result.category1List); setCategory2List(resp.result.category2List); setCategory3List(resp.result.category3List); @@ -159,49 +160,31 @@ function StandardCodeList(props) { return (
      - {/* */}
      • Home
      • 건설기준코드
      • -
      • {masterBoard && masterBoard.bbsNm}
      • +
      • 건설기준코드 검색
      - {/* */} -
      - {/* */} - - {/* */} -
      - {/* */} -
      -

      건설기준코드

      +

      건설기준코드 검색

      - -

      설계기준, 표준시방서 내용을 열람할 수 있습니다.

      - - {/* */}
        -
      • - - { - setfilterData(e.target.value); - }} - /> - - +
      • +
        handleTabClick(10)}>설계기준
        +
      • +
      • +
        handleTabClick(20)}>표준시방서
        +
      • +
      • +
        handleTabClick(40)}>전문시방서
      • +
      • +
        통합 다운로드
        +
      {/* */} -
      -
      -
        -
        handleTabClick(10)}>설계기준
        -
        handleTabClick(20)}>표준시방서
        -
        handleTabClick(40)}>전문시방서
        -
        통합 다운로드
        -
      -
      -
      {subTabsVisible && (
      @@ -315,7 +291,7 @@ function StandardCodeList(props) {
      {/*검색기능 filterData가 없는경우 모든 데이터 출력*/} - {listdata.filter(item => { + {listData.filter(item => { if (item.groupNm.includes(filterData)) { return item } @@ -327,7 +303,7 @@ function StandardCodeList(props) {
      {item.middleCategory}
      {item.kcscCd}
      {item.groupNm}
      - +
      {item.contentcount > 0 ? 내용보기 : null}
      {item.docFileGrpId == null ? null : }
      @@ -343,7 +319,7 @@ function StandardCodeList(props) { {/* */} {/* */} - + {/* */} diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeListModal.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeListModal.js similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeListModal.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeListModal.js diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/BookmarkModal.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.js similarity index 98% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/BookmarkModal.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.js index cb66c8c..38b8add 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/BookmarkModal.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.js @@ -1,6 +1,6 @@ import {React, useCallback, useEffect, useState} from "react"; import Modal from "react-bootstrap/Modal"; -import * as EgovNet from "../../api/egovFetch"; +import * as EgovNet from "../../../api/egovFetch"; import {VwDiv} from "./Vw.style"; import Col from "react-bootstrap/Col"; import Row from "react-bootstrap/Row"; diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.js similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.js diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/SbItem.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.js similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/SbItem.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.js diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/Vw.style.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.js similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/Vw.style.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.js diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js similarity index 99% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js index 312283c..7645660 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js @@ -1,7 +1,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { useLocation, useParams } from 'react-router-dom'; import SbItem from './SbItem' -import Loading from '../../components/Loading' +import Loading from '../../../components/Loading' import BookmarkModal from './BookmarkModal'; import {SbContainer} from './Sb.style' import {VwDiv, VwPtag} from './Vw.style' @@ -10,9 +10,9 @@ import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; import Modal from 'react-bootstrap/Modal'; import * as EgovNet from 'api/egovFetch'; -import {getLocalItem} from "../../utils/storage"; -import CODE from "../../constants/code"; -import {parseJwt} from "../../utils/parseJwt"; +import {getLocalItem} from "../../../utils/storage"; +import CODE from "../../../constants/code"; +import {parseJwt} from "../../../utils/parseJwt"; function CodeViewer(props) { const [treeLoading, setTreeLoading] = useState(true); diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viwerComponents.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viwerComponents.js similarity index 99% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viwerComponents.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viwerComponents.js index df95218..1f986fb 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viwerComponents.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viwerComponents.js @@ -1,4 +1,4 @@ -import * as EgovNet from "../../api/egovFetch"; +import * as EgovNet from "../../../api/egovFetch"; import React, {useEffect, useState} from "react"; import SbItem from "./SbItem"; import {Col, Row} from "react-bootstrap"; diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index 27837f7..f5cb5a0 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -109,11 +109,11 @@ import AdminLogsFileDownloadStatus from 'pages/admin/logs/FileDownloadStatus'; //건설기준코드 -import CodeViewer from 'pages/standardCode/viewer'; +import CodeViewer from 'pages/standardCode/viewer/viewer'; import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가 import initPage from 'js/ui'; -import StandardCodeList from "../pages/standardCode/StandardCodeList"; +import StandardCodeList from "../pages/standardCode/list/StandardCodeList"; const RootRoutes = () => { //useLocation객체를 이용하여 정규표현식을 사용한 /admin/~ 으로 시작하는 경로와 비교에 사용(아래 1줄) */} @@ -326,6 +326,7 @@ const SecondRoutes = () => { {/*기준코드리스트*/} } /> + } />