Compare commits
No commits in common. "a7bdd5093ff720f13add9ed736948f4713a99a13" and "52e6aed96e7cedf5f1d5c1c0f7c7515a7a6fe9e4" have entirely different histories.
a7bdd5093f
...
52e6aed96e
|
|
@ -1,85 +1,195 @@
|
|||
import React from 'react';
|
||||
import React, {useState, useEffect, useCallback, useRef} from 'react';
|
||||
import {Link, useLocation, useParams} from 'react-router-dom';
|
||||
|
||||
import {AiFillStar} from "react-icons/ai";
|
||||
import * as EgovNet from 'api/egovFetch';
|
||||
import URL from 'constants/url';
|
||||
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
|
||||
import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
||||
import StandardCodeSearchForm from "./StandardCodeSearchForm";
|
||||
import Col from "react-bootstrap/Col";
|
||||
import Row from "react-bootstrap/Row";
|
||||
import Loading from "../../../components/Loading";
|
||||
|
||||
function StandardCodeList({}) {
|
||||
const {listCode} = useParams();
|
||||
const [listData, setListData] = useState([])
|
||||
const [listLoading, setListLoading] = useState(true);
|
||||
const [filterData, setFilterData] = useState('');
|
||||
const [resultCnt, setResultCnt] = useState(0);
|
||||
const [remarkCnt, setRemarkCnt] = useState(0);
|
||||
const [groupSeq, setGroupSeq] = useState();
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
function close() {
|
||||
setShow(false);
|
||||
}
|
||||
|
||||
function showHandling(e) {
|
||||
const param = e.currentTarget.dataset;
|
||||
const groupSeq = param.groupSeq;
|
||||
console.log(groupSeq);
|
||||
EgovNet.requestFetch(
|
||||
'/standardCode/codeListModal.do',
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(
|
||||
groupSeq
|
||||
)
|
||||
}, (resp) => {
|
||||
console.log(resp + "------------------------resp")
|
||||
const body = [];
|
||||
const head = [];
|
||||
if (resp.length > 0) {
|
||||
resp.forEach(function (item, index) {
|
||||
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
|
||||
const url = "https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId;
|
||||
body.push(
|
||||
<tr>
|
||||
<td>{formattedDate}</td>
|
||||
<td><a href={url}><AiFillFileMarkdown/></a></td>
|
||||
<td></td>
|
||||
</tr>)
|
||||
})
|
||||
head.push(
|
||||
<tr>
|
||||
<td>년도</td>
|
||||
<td>기준코드</td>
|
||||
<td>신구건설기준비교</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
||||
setGroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
||||
}
|
||||
)
|
||||
setShow(true);
|
||||
}
|
||||
|
||||
const retrieveList = useCallback((searchCondition) => {
|
||||
setListLoading(true)
|
||||
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
}
|
||||
},
|
||||
(resp) => {
|
||||
setListData(resp.result.resultList);
|
||||
setResultCnt(resp.result.resultCnt.allCnt);
|
||||
setRemarkCnt(resp.result.resultCnt.remarkCnt);
|
||||
setListLoading(false)
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
|
||||
}, []);
|
||||
|
||||
function StandardCodeList({listData, filterData}) {
|
||||
|
||||
return (
|
||||
<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 className="StandardCodeList container">
|
||||
<div className="c_wrap codeListContent">
|
||||
<div className="layout">
|
||||
<div className="contents NOTICE_LIST listTableDiv">
|
||||
<StandardCodeSearchForm param={listCode?listCode:'10'} reloadFunction={retrieveList} resultCnt={resultCnt} remarkCnt={remarkCnt}/>
|
||||
<div className="board_list code_list">
|
||||
<div className="head">
|
||||
<span>대분류</span>
|
||||
<span>중분류</span>
|
||||
<span>코드번호</span>
|
||||
<span>코드명</span>
|
||||
<span className={"text-start"}>개정이력</span>
|
||||
<span className={"text-start"}>보기</span>
|
||||
<span>즐겨찾기</span>
|
||||
</div>
|
||||
{
|
||||
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>
|
||||
)
|
||||
}
|
||||
</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>
|
||||
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,124 +0,0 @@
|
|||
import React, {useState, useCallback} from 'react';
|
||||
import {useParams} from 'react-router-dom';
|
||||
|
||||
import * as EgovNet from 'api/egovFetch';
|
||||
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
|
||||
import {AiFillFileMarkdown} from "react-icons/ai";
|
||||
import StandardCodeSearchForm from "./StandardCodeSearchForm";
|
||||
import Loading from "../../../components/Loading";
|
||||
import StandardCodeList from "./StandardCodeList";
|
||||
|
||||
function StandardCodePage({}) {
|
||||
const {listCode} = useParams();
|
||||
const [listData, setListData] = useState([])
|
||||
const [listLoading, setListLoading] = useState(true);
|
||||
const [filterData, setFilterData] = useState('');
|
||||
const [resultCnt, setResultCnt] = useState(0);
|
||||
const [remarkCnt, setRemarkCnt] = useState(0);
|
||||
const [groupSeq, setGroupSeq] = useState();
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
function close() {
|
||||
setShow(false);
|
||||
}
|
||||
|
||||
function showHandling(e) {
|
||||
const param = e.currentTarget.dataset;
|
||||
const groupSeq = param.groupSeq;
|
||||
console.log(groupSeq);
|
||||
EgovNet.requestFetch(
|
||||
'/standardCode/codeListModal.do',
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(
|
||||
groupSeq
|
||||
)
|
||||
}, (resp) => {
|
||||
console.log(resp + "------------------------resp")
|
||||
const body = [];
|
||||
const head = [];
|
||||
if (resp.length > 0) {
|
||||
resp.forEach(function (item, index) {
|
||||
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
|
||||
const url = "https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId;
|
||||
body.push(
|
||||
<tr>
|
||||
<td>{formattedDate}</td>
|
||||
<td><a href={url}><AiFillFileMarkdown/></a></td>
|
||||
<td></td>
|
||||
</tr>)
|
||||
})
|
||||
head.push(
|
||||
<tr>
|
||||
<td>년도</td>
|
||||
<td>기준코드</td>
|
||||
<td>신구건설기준비교</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
||||
setGroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
||||
}
|
||||
)
|
||||
setShow(true);
|
||||
}
|
||||
|
||||
const retrieveList = useCallback((searchCondition) => {
|
||||
setListLoading(true)
|
||||
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
}
|
||||
},
|
||||
(resp) => {
|
||||
setListData(resp.result.resultList);
|
||||
setResultCnt(resp.result.resultCnt.allCnt);
|
||||
setRemarkCnt(resp.result.resultCnt.remarkCnt);
|
||||
setListLoading(false)
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<div className="StandardCodeList container">
|
||||
<div className="c_wrap codeListContent">
|
||||
<div className="layout">
|
||||
<div className="contents NOTICE_LIST listTableDiv">
|
||||
<StandardCodeSearchForm param={listCode?listCode:'10'} reloadFunction={retrieveList} resultCnt={resultCnt} remarkCnt={remarkCnt}/>
|
||||
<div className="board_list code_list">
|
||||
<div className="head">
|
||||
<span>대분류</span>
|
||||
<span>중분류</span>
|
||||
<span>코드번호</span>
|
||||
<span>코드명</span>
|
||||
<span className={"text-start"}>개정이력</span>
|
||||
<span className={"text-start"}>보기</span>
|
||||
<span>즐겨찾기</span>
|
||||
</div>
|
||||
{
|
||||
listLoading?(<Loading/>):(
|
||||
<StandardCodeList listData={listData} filterData={filterData}/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default StandardCodePage;
|
||||
|
||||
|
|
@ -16,10 +16,6 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
|||
});
|
||||
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
||||
|
||||
const [cat1SelectOption, setCat1SelectOption] = useState([])
|
||||
const [cat2SelectOption, setCat2SelectOption] = useState([])
|
||||
const [cat3SelectOption, setCat3SelectOption] = useState([])
|
||||
|
||||
function getSelectBoxOption(groupCd, handler){
|
||||
EgovNet.requestFetch(
|
||||
'/standardCode/category-option?listCode='+groupCd,
|
||||
|
|
@ -48,39 +44,19 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
|||
}, [searchCondition]);
|
||||
|
||||
useEffect(() => {
|
||||
setSearchCondition({...searchCondition, category1: '', category2: '', category3: ''})
|
||||
const groupCd = searchCondition.tab;
|
||||
getSelectBoxOption(groupCd, (resp)=>{
|
||||
const options = [];
|
||||
resp.result.groupList.forEach(function (item, index){
|
||||
options.push(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||
if(searchCondition.tab){
|
||||
getSelectBoxOption(searchCondition.tab, (resp)=>{
|
||||
debugger
|
||||
})
|
||||
setCat1SelectOption(options)
|
||||
})
|
||||
}
|
||||
}, [searchCondition.tab]);
|
||||
|
||||
useEffect(() => {
|
||||
setSearchCondition({...searchCondition, category2: '', category3: ''})
|
||||
const groupCd = searchCondition.tab+searchCondition.category1;
|
||||
getSelectBoxOption(groupCd, (resp)=>{
|
||||
const options = [];
|
||||
resp.result.groupList.forEach(function (item, index){
|
||||
options.push(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||
})
|
||||
setCat2SelectOption(options)
|
||||
})
|
||||
|
||||
}, [searchCondition.category1]);
|
||||
|
||||
useEffect(() => {
|
||||
setSearchCondition({...searchCondition, category3: ''})
|
||||
const groupCd = searchCondition.tab+searchCondition.category1+searchCondition.category2;
|
||||
getSelectBoxOption(groupCd, (resp)=>{
|
||||
const options = [];
|
||||
resp.result.groupList.forEach(function (item, index){
|
||||
options.push(<option value={item.groupCurCd}>{item.groupNm}</option>)
|
||||
})
|
||||
setCat3SelectOption(options)
|
||||
})
|
||||
|
||||
}, [searchCondition.category2]);
|
||||
|
||||
|
||||
|
|
@ -102,28 +78,23 @@ function StandardCodeSearchForm({param, reloadFunction, resultCnt, remarkCnt}){
|
|||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" value={searchCondition.category1}
|
||||
onChange={(e)=>{setSearchCondition({...searchCondition, category1: e.target.value})}}>
|
||||
<select id="sel1" title="조건" value={searchCondition.category1}>
|
||||
<option value="">전체</option>
|
||||
{cat1SelectOption}
|
||||
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel2" title="조건" value={searchCondition.category2}
|
||||
onChange={(e)=>{setSearchCondition({...searchCondition, category2: e.target.value})}}>
|
||||
<select id="sel2" title="조건" value={searchCondition.category2}>
|
||||
<option value="">전체</option>
|
||||
{cat2SelectOption}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel3" title="조건" value={searchCondition.category3}
|
||||
onChange={(e)=>{setSearchCondition({...searchCondition, category3: e.target.value})}}>
|
||||
<select id="sel3" title="조건" value={searchCondition.category3} >
|
||||
<option value="">전체</option>
|
||||
{cat3SelectOption}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -111,11 +111,10 @@ import AdminLogsFileDownloadStatus from 'pages/admin/logs/FileDownloadStatus';
|
|||
|
||||
//건설기준코드
|
||||
import CodeViewer from 'pages/standardCode/viewer/viewer';
|
||||
import StandardCodePage from "../pages/standardCode/list/StandardCodePage";
|
||||
|
||||
|
||||
import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가
|
||||
import initPage from 'js/ui';
|
||||
import StandardCodeList from "../pages/standardCode/list/StandardCodeList";
|
||||
|
||||
const RootRoutes = () => {
|
||||
//useLocation객체를 이용하여 정규표현식을 사용한 /admin/~ 으로 시작하는 경로와 비교에 사용(아래 1줄) */}
|
||||
|
|
@ -331,8 +330,8 @@ const SecondRoutes = () => {
|
|||
<Route path={URL.STANDARD_CODE_VIEWER_LINK} element={<CodeViewer mode={CODE.MODE_READ} />} />
|
||||
|
||||
{/*기준코드리스트*/}
|
||||
<Route path={URL.STANDARD_CODE_LIST} element={<StandardCodePage />} />
|
||||
<Route path={URL.STANDARD_CODE_LIST_LINK} element={<StandardCodePage />} />
|
||||
<Route path={URL.STANDARD_CODE_LIST} element={<StandardCodeList />} />
|
||||
<Route path={URL.STANDARD_CODE_LIST_LINK} element={<StandardCodeList />} />
|
||||
|
||||
</Routes>
|
||||
<EgovFooter />
|
||||
|
|
|
|||
Loading…
Reference in New Issue