import React, { useState, useEffect, useCallback } from 'react'; import { Link, useLocation } from 'react-router-dom'; import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; import Button from 'react-bootstrap/Button'; import * as EgovNet from 'api/egovFetch'; import URL from 'constants/url'; function EgovMain(props) { console.group("EgovMain"); console.log("[Start] EgovMain ------------------------------"); console.log("EgovMain [props] : ", props); const location = useLocation(); console.log("EgovMain [location] : ", location); // eslint-disable-next-line no-unused-vars const [noticeBoard, setNoticeBoard] = useState(); // eslint-disable-next-line no-unused-vars const [gallaryBoard, setGallaryBoard] = useState(); const [noticeListTag, setNoticeListTag] = useState(); const [gallaryListTag, setGallaryListTag] = useState(); const retrieveList = useCallback(() => { console.groupCollapsed("EgovMain.retrieveList()"); const retrieveListURL = '/cmm/main/mainPageAPI.do'; const requestOptions = { method: "POST", headers: { 'Content-type': 'application/json' }, body: JSON.stringify() } EgovNet.requestFetch(retrieveListURL, requestOptions, (resp) => { setNoticeBoard(resp.result.notiList); setGallaryBoard(resp.result.galList); let mutNotiListTag = []; mutNotiListTag.push(
  • 검색된 결과가 없습니다.
  • ); // 게시판 목록 초기값 // 리스트 항목 구성 resp.result.notiList.forEach(function (item, index) { if (index === 0) mutNotiListTag = []; // 목록 초기화 mutNotiListTag.push(
  • {item.nttSj} {item.frstRegisterPnttm}
  • ); }); setNoticeListTag(mutNotiListTag); let mutGallaryListTag = []; mutGallaryListTag.push(
  • 검색된 결과가 없습니다.
  • ); // 게시판 목록 초기값 // 리스트 항목 구성 resp.result.galList.forEach(function (item, index) { if (index === 0) mutGallaryListTag = []; // 목록 초기화 mutGallaryListTag.push(
  • {item.nttSj} {item.frstRegisterPnttm}
  • ); }); setGallaryListTag(mutGallaryListTag); }, function (resp) { console.log("err response : ", resp); } ); console.groupEnd("EgovMain.retrieveList()"); },[]); useEffect(() => { retrieveList(); }, [retrieveList]); console.log("------------------------------EgovMain [End]"); console.groupEnd("EgovMain"); return (
    {/* container */}
    훈령/예규/지침
    영문건설기준
    건설기준용어
    주요행사
    수요조사
    API 서비스
    관련사이트
    ); } export default EgovMain;