문서명 갱신 오류 수정

문서 연도 정보 갱신 오류 수정.
연혁, 비교 버튼 추가
오류 선택지 위치 수정
cks
강석 최 2023-12-13 16:00:32 +09:00
parent 03d9a596cb
commit d09142ef72
3 changed files with 27 additions and 14 deletions

View File

@ -343,4 +343,5 @@
.modalDocInfoBtn{--bs-btn-padding-y: 0.1rem;--bs-btn-padding-x: 0.25rem;--bs-btn-font-size: 0.7rem; filter: grayscale(100%);}
.modalDocInfoActive{filter: grayscale(0%);}
.docInfoRow > .col{--bs-gutter-x: 0.5rem;}
.bookmarkModalHeader{--bs-modal-title-line-height:1;}
.bookmarkModalHeader{--bs-modal-title-line-height:1;}
.optionBtn{--bs-btn-padding-y: 0.1rem;--bs-btn-padding-x: 0.25rem;--bs-btn-font-size: 0.7rem; margin-right: 7px;}

View File

@ -45,7 +45,7 @@ const SbItem = ({item, openDocCode, updateDocCode}) => {
<SbTitle depth={item.doc_level} id={`doc${item.seq}`} className={item.doc_code === openDocCode?'openDoc':''}>
<a onClick={()=>{
changeOpenDoc(item.seq)
updateDocCode(item.doc_code, item.doc_code_name)
updateDocCode(item.doc_code)
}}>
{icon}&nbsp;{(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}
{errorCnt}

View File

@ -19,7 +19,6 @@ function CodeViewer(props) {
const {linkedDocCode} = useParams();
const [docCode, setDocCode] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[0]:props.docCode);
const [ymd, setYmd] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[1]:props.ymd);
const [docName, setDocName] = useState(props.docName);
const [docInfo, setDocInfo] = useState();
const [codeTree, setCodeTree] = useState();
const [docSummary, setDocSummary] = useState();
@ -43,11 +42,11 @@ function CodeViewer(props) {
console.log("viewer [location] : ", location);
console.log("viewer [docCode] : ", docCode);
const updateDocCode = (docCode, docName)=>{
const updateDocCode = (docCode)=>{
setDocSummary([<div></div>])
setDocDetail([<div>불러오는중</div>])
setDocInfo([])
setDocCode(docCode);
setDocName(docName);
getCodeInfo(docCode);
setErrorSelector([])
getCodeDetailInfo(docCode);
@ -112,41 +111,42 @@ function CodeViewer(props) {
if(docInfo.length>0){
let optionTag = [];
let activeIndex = 0;
let docTitle = "";
if(ymd===undefined){
activeIndex = docInfo.length-1
docTitle = docInfo[docInfo.length-1].doc_nm
}else{
docInfo.forEach(function (item, index){
if(new Date(item.estb_ymd) <= new Date(ymd)){
activeIndex = index;
docTitle = item.doc_nm
}
})
}
debugger
docInfo.forEach(function (item, index){
let buttonClass = "btn btn-sm docInfoBtn "
let pClass = "yearInfo ";
if(item.doc_er === 'E'){
buttonClass += "btn-outline-success "
buttonClass += "btn-success "
}else{
buttonClass += "btn-outline-primary "
buttonClass += "btn-primary "
}
if(index === activeIndex){
pClass += "yearInfoActive"
buttonClass += "docInfoActive"
pClass += "yearInfoActive"
}
optionTag.push(
<Col>
<input type="button"
className={buttonClass}
value={item.doc_er==='E'?'':'개'}
value={item.doc_er==='E'?'':'개'}
onClick={docInfoSelectorChange}
data-ymd={item.estb_ymd}/>
<br/>
<p className={pClass}>{item.doc_yr}</p>
</Col>)
})
headTag.push(<Row className="docInfoRow"><Col className="docInfoTitle">{docCode} {docName}</Col>{optionTag}</Row>)
headTag.push(<Row className="docInfoRow"><Col className="docInfoTitle">{docCode} {docTitle}</Col>{optionTag}</Row>)
}else{
headTag.push(<div>검색된 결과가 없습니다.</div>); // 코드 목록 초기값
}
@ -432,8 +432,20 @@ function CodeViewer(props) {
<Col xs={12} className="border-bottom">
<Row>
<Col xs={3}></Col>
<Col xs={"auto"}>{docInfo}</Col>
<Col xs={"auto"}>{errorSelector}</Col>
<Col xs={9}>
<Row className="justify-content-between">
<Col xs={"auto"}>
<Row>
<Col xs={"auto"}>{docInfo}</Col>
<Col>
<input type="button" className="btn btn-sm btn-primary optionBtn" value="연혁"/>
<input type="button" className="btn btn-sm btn-primary optionBtn" value="비교"/>
</Col>
</Row>
</Col>
<Col xs={"auto"}>{errorSelector}</Col>
</Row>
</Col>
</Row>
</Col>
<Col xs={3} className="border-end viewerDiv">