2023-12-01 07:14:01 +00:00
|
|
|
import React, {useState, useEffect, useCallback, useRef} from 'react';
|
2023-11-03 01:04:51 +00:00
|
|
|
import {Link, useLocation, useParams} from 'react-router-dom';
|
2023-10-26 02:30:13 +00:00
|
|
|
|
|
|
|
|
import * as EgovNet from 'api/egovFetch';
|
|
|
|
|
import URL from 'constants/url';
|
2023-11-08 02:30:04 +00:00
|
|
|
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
|
2023-11-08 05:09:43 +00:00
|
|
|
import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
2024-01-29 09:01:11 +00:00
|
|
|
import StandardCodeSearchForm from "./StandardCodeSearchForm";
|
2024-01-31 09:00:33 +00:00
|
|
|
import Col from "react-bootstrap/Col";
|
|
|
|
|
import Row from "react-bootstrap/Row";
|
|
|
|
|
import Loading from "../../../components/Loading";
|
2023-11-03 07:09:59 +00:00
|
|
|
|
2024-01-29 09:01:11 +00:00
|
|
|
function StandardCodeList({}) {
|
2023-11-03 01:04:51 +00:00
|
|
|
const {listCode} = useParams();
|
2024-01-29 09:01:11 +00:00
|
|
|
const [listData, setListData] = useState([])
|
2024-01-31 09:00:33 +00:00
|
|
|
const [listLoading, setListLoading] = useState(true);
|
2024-01-26 08:53:28 +00:00
|
|
|
const [filterData, setFilterData] = useState('');
|
|
|
|
|
const [resultCnt, setResultCnt] = useState(0);
|
2024-01-30 08:59:30 +00:00
|
|
|
const [remarkCnt, setRemarkCnt] = useState(0);
|
2024-01-29 09:01:11 +00:00
|
|
|
const [groupSeq, setGroupSeq] = useState();
|
2024-01-26 08:53:28 +00:00
|
|
|
|
2024-01-29 09:01:11 +00:00
|
|
|
const [show, setShow] = useState(false);
|
2024-01-26 08:53:28 +00:00
|
|
|
function close() {
|
|
|
|
|
setShow(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showHandling(e) {
|
2023-11-03 07:09:59 +00:00
|
|
|
const param = e.currentTarget.dataset;
|
2024-01-26 08:53:28 +00:00
|
|
|
const groupSeq = param.groupSeq;
|
|
|
|
|
console.log(groupSeq);
|
2023-11-07 04:11:22 +00:00
|
|
|
EgovNet.requestFetch(
|
2023-11-15 02:06:23 +00:00
|
|
|
'/standardCode/codeListModal.do',
|
2023-12-01 07:14:01 +00:00
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify(
|
2024-01-26 08:53:28 +00:00
|
|
|
groupSeq
|
2023-12-01 07:14:01 +00:00
|
|
|
)
|
|
|
|
|
}, (resp) => {
|
|
|
|
|
console.log(resp + "------------------------resp")
|
|
|
|
|
const body = [];
|
|
|
|
|
const head = [];
|
|
|
|
|
if (resp.length > 0) {
|
|
|
|
|
resp.forEach(function (item, index) {
|
2023-11-07 04:11:22 +00:00
|
|
|
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
|
2023-12-01 07:14:01 +00:00
|
|
|
const url = "https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId;
|
2023-11-07 04:11:22 +00:00
|
|
|
body.push(
|
|
|
|
|
<tr>
|
2023-12-01 07:14:01 +00:00
|
|
|
<td>{formattedDate}</td>
|
|
|
|
|
<td><a href={url}><AiFillFileMarkdown/></a></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
</tr>)
|
2023-11-07 04:11:22 +00:00
|
|
|
})
|
2023-11-08 02:30:04 +00:00
|
|
|
head.push(
|
|
|
|
|
<tr>
|
|
|
|
|
<td>년도</td>
|
|
|
|
|
<td>기준코드</td>
|
|
|
|
|
<td>신구건설기준비교</td>
|
|
|
|
|
</tr>
|
|
|
|
|
)
|
2023-11-07 04:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
2024-01-29 09:01:11 +00:00
|
|
|
setGroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
2023-11-07 04:11:22 +00:00
|
|
|
}
|
|
|
|
|
)
|
2024-01-26 08:53:28 +00:00
|
|
|
setShow(true);
|
2023-11-03 07:09:59 +00:00
|
|
|
}
|
2023-12-01 07:14:01 +00:00
|
|
|
|
2023-10-26 02:30:13 +00:00
|
|
|
const retrieveList = useCallback((searchCondition) => {
|
2024-01-31 09:00:33 +00:00
|
|
|
setListLoading(true)
|
|
|
|
|
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
|
|
|
|
|
{
|
|
|
|
|
method: "GET",
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-type': 'application/json',
|
2024-01-29 09:01:11 +00:00
|
|
|
}
|
2024-01-31 09:00:33 +00:00
|
|
|
},
|
|
|
|
|
(resp) => {
|
|
|
|
|
setListData(resp.result.resultList);
|
|
|
|
|
setResultCnt(resp.result.resultCnt.allCnt);
|
|
|
|
|
setRemarkCnt(resp.result.resultCnt.remarkCnt);
|
|
|
|
|
setListLoading(false)
|
|
|
|
|
},
|
|
|
|
|
function (resp) {
|
|
|
|
|
console.log("err response : ", resp);
|
|
|
|
|
}
|
|
|
|
|
);
|
2023-10-26 02:30:13 +00:00
|
|
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
2024-01-31 09:00:33 +00:00
|
|
|
|
2023-10-26 02:30:13 +00:00
|
|
|
return (
|
2023-11-03 01:04:51 +00:00
|
|
|
<div className="StandardCodeList container">
|
2024-01-30 08:59:30 +00:00
|
|
|
<div className="c_wrap codeListContent">
|
2023-10-26 02:30:13 +00:00
|
|
|
<div className="layout">
|
2024-01-30 08:59:30 +00:00
|
|
|
<div className="contents NOTICE_LIST listTableDiv">
|
2024-01-31 09:00:33 +00:00
|
|
|
<StandardCodeSearchForm param={listCode?listCode:'10'} reloadFunction={retrieveList} resultCnt={resultCnt} remarkCnt={remarkCnt}/>
|
2024-01-29 09:01:11 +00:00
|
|
|
<div className="board_list code_list">
|
2023-10-26 02:30:13 +00:00
|
|
|
<div className="head">
|
2023-10-31 01:41:21 +00:00
|
|
|
<span>대분류</span>
|
|
|
|
|
<span>중분류</span>
|
|
|
|
|
<span>코드번호</span>
|
|
|
|
|
<span>코드명</span>
|
2024-01-31 09:00:33 +00:00
|
|
|
<span className={"text-start"}>개정이력</span>
|
|
|
|
|
<span className={"text-start"}>보기</span>
|
2023-10-31 01:41:21 +00:00
|
|
|
<span>즐겨찾기</span>
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
2024-01-31 09:00:33 +00:00
|
|
|
{
|
|
|
|
|
listLoading?(<Loading/>):(
|
|
|
|
|
<div className="result">
|
|
|
|
|
{listData.filter(item => {
|
|
|
|
|
if (item.groupNm.includes(filterData)) {
|
|
|
|
|
return item
|
|
|
|
|
}
|
|
|
|
|
return null
|
|
|
|
|
}).map(item => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="list_item List_Codes">
|
|
|
|
|
<div className="mainCategory">{item.mainCategory}</div>
|
|
|
|
|
<div className="middleCategory">{item.middleCategory}</div>
|
|
|
|
|
<div className="kcscCd">{item.kcscCd}</div>
|
|
|
|
|
<div className="groupNm">{item.groupNm}<br/><span className={"text-danger"}>{item.rvsnRemark}</span></div>
|
|
|
|
|
<div className="Revisionhistory">
|
|
|
|
|
<Row className={"justify-content-start"}>
|
|
|
|
|
{item.historyList.filter(history => {
|
|
|
|
|
return history;
|
|
|
|
|
}).map(history => {
|
|
|
|
|
let buttonClass = "btn btn-sm docInfoBtn docInfoActive "
|
|
|
|
|
let pClass = "yearInfo yearInfoActive";
|
|
|
|
|
if(history.docEr === 'E'){
|
|
|
|
|
buttonClass += "btn-success "
|
|
|
|
|
}else{
|
|
|
|
|
buttonClass += "btn-primary "
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<Col xs={"auto"} className={"px-1"}>
|
|
|
|
|
<input type="button"
|
|
|
|
|
className={buttonClass}
|
|
|
|
|
value={history.docEr==='E'?'제':'개'}
|
|
|
|
|
onClick={()=>{
|
|
|
|
|
/*window.open("/standardCode/viewer/"+history.kcscCd+":"+history.rvsnYmd.split('T')[0]);*/
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<br/>
|
|
|
|
|
<p className={pClass}>{history.docYr}</p>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="fille">
|
|
|
|
|
<Row className={"justify-content-start"}>
|
|
|
|
|
{item.historyList.filter(history => {
|
|
|
|
|
return history;
|
|
|
|
|
}).map(history => {
|
|
|
|
|
let buttonClass = "btn btn-sm docInfoBtn docInfoActive "
|
|
|
|
|
let pClass = "yearInfo yearInfoActive";
|
|
|
|
|
if(history.docEr === 'E'){
|
|
|
|
|
buttonClass += "btn-success "
|
|
|
|
|
}else{
|
|
|
|
|
buttonClass += "btn-primary "
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<Col xs={"auto"} className={"px-1"}>
|
|
|
|
|
<input type="button"
|
|
|
|
|
className={buttonClass}
|
|
|
|
|
value={history.docEr==='E'?'제':'개'}
|
|
|
|
|
onClick={()=>{
|
|
|
|
|
window.open("/standardCode/viewer/"+history.kcscCd+":"+history.rvsnYmd.split('T')[0]);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<br/>
|
|
|
|
|
<p className={pClass}>{history.docYr}</p>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="star"><AiFillStar/></div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
2024-01-26 08:53:28 +00:00
|
|
|
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default StandardCodeList;
|
|
|
|
|
|