diff --git a/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css b/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css index 2df0b34..971fd2d 100644 --- a/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css +++ b/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css @@ -46,6 +46,11 @@ .code_list .result .List_Codes >div:nth-child(7){ font-size: 14px; } + +.standard_code_modal .head >span:nth-child(1),.standard_code_modal .result .list_item >div:nth-child(1){width: 12%;} +.standard_code_modal .head >span:nth-child(2),.standard_code_modal .result .list_item >div:nth-child(2){width: 15%;} +.standard_code_modal .head >span:nth-child(3),.standard_code_modal .result .list_item >div:nth-child(3){width: 10%;} + .standard_code_result{ max-height: 520px; overflow-y: auto; diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/DownloadModal.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/DownloadModal.jsx index eeef8ab..76877e3 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/DownloadModal.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/DownloadModal.jsx @@ -5,7 +5,7 @@ import Row from "react-bootstrap/Row"; import * as EgovNet from "api/egovFetch"; -function DownloadModal({size, show, onHide,}){ +function DownloadModal({closeFn}){ const [tab, setTab] = useState(10); const [subTabsVisible, setSubTabsVisible] = useState(false); const [listData, setListData] = useState([]); @@ -28,7 +28,7 @@ function DownloadModal({size, show, onHide,}){ }, [tab]); return( - + <> 통합다운로드 @@ -57,18 +57,18 @@ function DownloadModal({size, show, onHide,}){ {setTab(90)}}>K-Water )} -
+
구분 코드 다운로드
-
+
{listData.filter(item => { return item; }).map(item => { return ( -
+
{item.groupNm}
{item.groupCurCd}
@@ -80,8 +80,8 @@ function DownloadModal({size, show, onHide,}){
- - + + ) } diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/HistoryModal.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/HistoryModal.jsx new file mode 100644 index 0000000..77d4e0b --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/HistoryModal.jsx @@ -0,0 +1,47 @@ +import React, {useEffect, useState} from "react"; +import {Button, Modal, Nav} from "react-bootstrap"; +import Col from "react-bootstrap/Col"; +import Row from "react-bootstrap/Row"; +import * as EgovNet from "api/egovFetch"; + + +function HistoryModal({closeFn, standardCode}){ + + return( + <> + + 개정이력 + + +
코드 : {standardCode.kcscCd}
+
+
+ 고시일 + 기준코드 + 신구건설기준비교 +
+
+ {standardCode.historyList.filter(history => { + return history; + }).map(history => { + return ( +
+
{history.rvsnYmd.split('T')[0]}
+
+ +
+
+ +
+
+ ) + })} +
+
+
+ + + ) +} + +export default HistoryModal; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx index e6902b3..87b4998 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx @@ -4,7 +4,11 @@ import Row from "react-bootstrap/Row"; import FavoriteIcon from "./FavoriteIcon"; import Button from "react-bootstrap/Button"; -function StandardCodeList({listData, filterData}) { +function StandardCodeList({listData, filterData, getHistoryModal}) { + + function historyBtn(item){ + getHistoryModal(item); + } return (
@@ -21,7 +25,7 @@ function StandardCodeList({listData, filterData}) {
{item.kcscCd}
{item.groupNm}
{item.rvsnRemark}
- +
@@ -41,7 +45,9 @@ function StandardCodeList({listData, filterData}) { className={buttonClass} value={history.docEr==='E'?'제':'개'} onClick={()=>{ - window.open("/standardCode/viewer/"+history.kcscCd+":"+history.rvsnYmd.split('T')[0]); + const rvsnYmd = new Date(history.rvsnYmd) + rvsnYmd.setHours(rvsnYmd.getHours()+9) + window.open("/standardCode/viewer/"+history.kcscCd+":"+rvsnYmd.toISOString().split('T')[0]); }} />
diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodePage.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodePage.jsx index 23990d4..f2c018d 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodePage.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodePage.jsx @@ -7,6 +7,8 @@ import StandardCodeSearchForm from "./StandardCodeSearchForm"; import Loading from "components/Loading"; import StandardCodeList from "./StandardCodeList"; import URL from "constants/url"; +import Modal from "react-bootstrap/Modal"; +import HistoryModal from "./HistoryModal"; function StandardCodePage({}) { const {listCode} = useParams(); @@ -15,6 +17,7 @@ function StandardCodePage({}) { const [filterData, setFilterData] = useState(''); const [resultCnt, setResultCnt] = useState(0); const [remarkCnt, setRemarkCnt] = useState(0); + const [modalContent, setModalContent] = useState([]); const [show, setShow] = useState(false); function close() { @@ -45,8 +48,13 @@ function StandardCodePage({}) { function downloadModal(){ setShow(true); + setModalContent() } + function historyModal(item){ + setShow(true); + setModalContent() + } return (
@@ -80,11 +88,13 @@ function StandardCodePage({}) {
{ listLoading?():( - + ) }
- + + {modalContent} +
diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.jsx similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/BookmarkModal.jsx diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/CodeViewer.jsx similarity index 98% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/CodeViewer.jsx index 7645660..76e26be 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viewer.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/CodeViewer.jsx @@ -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); @@ -94,15 +94,12 @@ function CodeViewer(props) { const getCodeInfo = useCallback((docCode) => { console.groupCollapsed("EgovMain.getCodeInfo()"); EgovNet.requestFetch( - '/standardCode/getCodeInfo.do', + '/standardCode/code-info?docCode='+docCode, { - method: "POST", + method: "GET", headers: { 'Content-type': 'application/json' - }, - body: JSON.stringify({ - docCode: docCode - }) + } }, (resp) => { const docInfo = resp.result.docInfo; diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.jsx similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Sb.style.jsx diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.jsx similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/SbItem.jsx diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viwerComponents.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/ViwerComponents.jsx similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/viwerComponents.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/ViwerComponents.jsx diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.jsx similarity index 100% rename from egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.js rename to egovframe-template-simple-react-contribution/src/pages/standardCode/viewer/Vw.style.jsx diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index 827c085..2f69395 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -110,7 +110,7 @@ import AdminLogsFileDownloadStatus from 'pages/admin/logs/FileDownloadStatus'; //건설기준코드 -import CodeViewer from 'pages/standardCode/viewer/viewer'; +import CodeViewer from 'pages/standardCode/viewer/CodeViewer'; import StandardCodePage from "../pages/standardCode/list/StandardCodePage"; import StandardCodeInfo from "../pages/standardCode/info/StandardCodeInfo"; diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java index 1f22d8b..cecf673 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java @@ -99,8 +99,8 @@ public class StandardCodeController extends BaseController { @ApiResponse(responseCode = "200", description = "조회 성공"), @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") }) - @PostMapping(value = "/getCodeInfo.do", consumes = MediaType.APPLICATION_JSON_VALUE) - public ResultVO getCodeInfo(@RequestBody StandardCodeVO param, @AuthenticationPrincipal LoginVO user) + @GetMapping(value = "/code-info", consumes = MediaType.APPLICATION_JSON_VALUE) + public ResultVO getCodeInfo(StandardCodeVO param, @AuthenticationPrincipal LoginVO user) throws Exception { ResultVO resultVO = new ResultVO(); Map resultMap = new HashMap<>();