2024-02-01 02:42:49 +00:00
|
|
|
import React from 'react';
|
2024-01-31 09:00:33 +00:00
|
|
|
import Col from "react-bootstrap/Col";
|
|
|
|
|
import Row from "react-bootstrap/Row";
|
2024-02-02 07:50:54 +00:00
|
|
|
import FavoriteIcon from "./FavoriteIcon";
|
2023-10-26 02:30:13 +00:00
|
|
|
|
2024-02-01 02:42:49 +00:00
|
|
|
function StandardCodeList({listData, filterData}) {
|
2024-01-31 09:00:33 +00:00
|
|
|
|
2023-10-26 02:30:13 +00:00
|
|
|
return (
|
2024-02-01 02:42:49 +00:00
|
|
|
<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>
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
2024-02-01 02:42:49 +00:00
|
|
|
<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>
|
2024-02-02 07:50:54 +00:00
|
|
|
<FavoriteIcon item={item}/>
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
2024-02-01 02:42:49 +00:00
|
|
|
)
|
|
|
|
|
})}
|
2023-10-26 02:30:13 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default StandardCodeList;
|
|
|
|
|
|