건설기준코드리스트모달창구현
parent
3aaa157dde
commit
6423d6e908
|
|
@ -5,11 +5,11 @@ import * as EgovNet from 'api/egovFetch';
|
|||
import URL from 'constants/url';
|
||||
import { NOTICE_BBS_ID } from 'config';
|
||||
|
||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavInform';
|
||||
|
||||
import EgovPaging from 'components/EgovPaging';
|
||||
import { itemIdxByPage } from 'utils/calc';
|
||||
|
||||
import StandardCodeListModal from './StandardCodeListModal'
|
||||
import {StandardCodeListModal,TestTable} from './StandardCodeListModal'
|
||||
|
||||
function StandardCodeList(props) {
|
||||
const {listCode} = useParams();
|
||||
|
|
@ -17,8 +17,40 @@ function StandardCodeList(props) {
|
|||
const [groupseq,setgroupseq] = useState();
|
||||
function showhandling(e){
|
||||
const param = e.currentTarget.dataset;
|
||||
const groupseq = param.groupseq;
|
||||
console.log(groupseq);
|
||||
EgovNet.requestFetch(
|
||||
'/standardCode/testCodeList.do',
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(
|
||||
groupseq
|
||||
)
|
||||
},(resp) =>{
|
||||
console.log(resp+"------------------------resp")
|
||||
const body =[];
|
||||
|
||||
if(resp.length>0){
|
||||
|
||||
resp.forEach(function (item,index){
|
||||
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
|
||||
body.push(
|
||||
<tr>
|
||||
<td>{formattedDate}</td>
|
||||
<td>{item.docFileGrpId}</td>
|
||||
<td></td>
|
||||
</tr>)
|
||||
})
|
||||
}
|
||||
|
||||
setgroupseq(<TestTable content={body}/>);
|
||||
}
|
||||
)
|
||||
setshow(true);
|
||||
setgroupseq(param.groupseq);
|
||||
|
||||
}
|
||||
function close () {
|
||||
setshow(false);
|
||||
|
|
@ -75,15 +107,8 @@ function StandardCodeList(props) {
|
|||
|
||||
mutListTag.push(
|
||||
<Link
|
||||
to={"#"}
|
||||
state={{
|
||||
docInfoSeq: item.docInfoSeq,
|
||||
docNm: item.docNm,
|
||||
kcscCd: item.kcscCd,
|
||||
searchCondition: searchCondition
|
||||
}}
|
||||
key={listIdx}
|
||||
className="list_item" >
|
||||
className="list_item List_Codes" >
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div>{item.kcscCd}</div>
|
||||
|
|
@ -134,14 +159,14 @@ function StandardCodeList(props) {
|
|||
|
||||
<div className="layout">
|
||||
{/* <!-- Navigation --> */}
|
||||
<EgovLeftNav/>
|
||||
|
||||
{/* <!--// Navigation --> */}
|
||||
|
||||
<div className="contents NOTICE_LIST" id="contents">
|
||||
{/* <!-- 본문 --> */}
|
||||
|
||||
<div className="top_tit">
|
||||
<h1 className="tit_1">건설기준코드</h1>
|
||||
<h2 className="tit_1">건설기준코드</h2>
|
||||
</div>
|
||||
|
||||
<h2 className="tit_2">설계기준, 표준시방서 내용을 열람할 수 있습니다.</h2>
|
||||
|
|
@ -206,7 +231,8 @@ function StandardCodeList(props) {
|
|||
retrieveList({ ...searchCondition, pageIndex: passedPage, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value })
|
||||
}} />
|
||||
{/* <!--/ Paging --> */}
|
||||
<StandardCodeListModal show ={show} groupseq ={groupseq} onClose = {close}/>
|
||||
<StandardCodeListModal size={"lg"} show ={show} content ={groupseq} onClose = {close} title={"개정이력"}/>
|
||||
|
||||
</div>
|
||||
|
||||
{/* <!--// 본문 --> */}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,35 @@
|
|||
import {Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalTitle} from "react-bootstrap";
|
||||
|
||||
|
||||
function StandardCodeListModal({show,groupseq,onClose}){
|
||||
//todo 로직추가구현필요
|
||||
function StandardCodeListModal({show,content,onClose,title,size}){
|
||||
return(
|
||||
<Modal show={show}>
|
||||
<Modal size={size} show={show} aria-labelledby="example-modal-sizes-title-lg">
|
||||
<ModalHeader>
|
||||
<ModalTitle>개정이력</ModalTitle>
|
||||
<ModalTitle id="example-modal-sizes-title-lg">{title}</ModalTitle>
|
||||
</ModalHeader>
|
||||
<ModalBody>
|
||||
{groupseq}
|
||||
{content}
|
||||
</ModalBody>
|
||||
<ModalFooter><Button onClick={onClose}>닫기</Button></ModalFooter>
|
||||
</Modal>)
|
||||
}
|
||||
export default StandardCodeListModal;
|
||||
|
||||
function TestTable({content}){
|
||||
|
||||
|
||||
return(
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>년도</td>
|
||||
<td>기준코드</td>
|
||||
<td>신구건설기준비교</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{content}
|
||||
</tbody>
|
||||
</table>
|
||||
)
|
||||
}
|
||||
export {StandardCodeListModal,TestTable};
|
||||
Loading…
Reference in New Issue