parent
5bafa8f96e
commit
16100e6b7b
|
|
@ -335,5 +335,6 @@
|
|||
|
||||
/*기준코드 뷰어*/
|
||||
.titleCheckBox ~ p {display: inline}
|
||||
.errorCnt{display: inline; color:red;}
|
||||
.errorText{display: inline; cursor: pointer}
|
||||
.detailInfoDiv > div > input {margin-right: 5px;}
|
||||
|
|
@ -37,12 +37,19 @@ const SbItem = ({item, openDocCode, updateDocCode}) => {
|
|||
)
|
||||
}else{
|
||||
const icon = <FcFile />;
|
||||
let errorCnt = null;
|
||||
if(item.error_cnt != null && item.error_cnt >0){
|
||||
errorCnt = <blockquote className="errorCnt">({item.error_cnt})</blockquote>;
|
||||
}
|
||||
return (
|
||||
<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)
|
||||
}}>{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</a>
|
||||
}}>
|
||||
{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}
|
||||
{errorCnt}
|
||||
</a>
|
||||
</SbTitle>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ function CodeViewer(props) {
|
|||
const [codeTree, setCodeTree] = useState();
|
||||
const [docSummary, setDocSummary] = useState();
|
||||
const [docDetail, setDocDetail] = useState();
|
||||
const [errorSelector, setErrorSelector] = useState();
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
const [bookMarkModal, setBookMarkModal] = useState();
|
||||
|
|
@ -143,7 +144,9 @@ function CodeViewer(props) {
|
|||
let summaryTag = [];
|
||||
// 문서 전문 구성
|
||||
let detailTag = [];
|
||||
|
||||
// 문서 오류 선택 구성
|
||||
let errorTag = [];
|
||||
let optionTag = [];
|
||||
if(resp.result.document.length>0){
|
||||
const docLinkReg = /([A-Z]{3,5}(\s[0-9]{2}){3,4})/g
|
||||
const docPartReg = /\((?:표|그림|부록)?\s*([A-Z]\.)?(?!\d\))\d+(\.\d+)*(\s?\(\d\))?(-\d+)?(?:\s*[A-Z])?\)/g // /(\((?:표|그림|부록)?\s*([A-Z]\.)?\d+(\.\d+)*(\s?\(\d\))?(-\d+)?(?:\s*[A-Z])?\))/g
|
||||
|
|
@ -222,7 +225,7 @@ function CodeViewer(props) {
|
|||
}
|
||||
if(item.error_cd !== null){
|
||||
if(sessionUserSe === "ADM"){
|
||||
item.full_content = "<p class='errorText'>"+item.error_cd+"</p><br>"+
|
||||
item.full_content = "<p class='errorText' id='error"+item.cont_type_cd+"'>"+item.error_cd+"</p><br>"+
|
||||
"<div class='input-group w-25 d-none errorEditDiv'>" +
|
||||
"<input type='hidden' class='contTypeCd' value='"+item.cont_type_cd+"' />"+
|
||||
"<input type='text' class='form-control form-control-sm errorCd' value='"+item.error_cd+"'/>"+
|
||||
|
|
@ -231,8 +234,9 @@ function CodeViewer(props) {
|
|||
"</div>"+
|
||||
item.full_content;
|
||||
}else{
|
||||
item.full_content = "<p class='errorText'>"+item.error_cd+"</p><br>"+item.full_content;
|
||||
item.full_content = "<p class='errorText' id='error"+item.cont_type_cd+"'>"+item.error_cd+"</p><br>"+item.full_content;
|
||||
}
|
||||
optionTag.push(<option value={item.cont_type_cd}>{item.error_cd}</option>)
|
||||
}
|
||||
item.full_content = item.full_content+"<hr>"
|
||||
detailTag.push(
|
||||
|
|
@ -244,6 +248,10 @@ function CodeViewer(props) {
|
|||
}
|
||||
setDocSummary(summaryTag);
|
||||
setDocDetail(detailTag);
|
||||
if(optionTag.length>0){
|
||||
errorTag.push(<Form.Select size="sm" onChange={errorSelectorChange}><option value="">선택</option>{optionTag}</Form.Select>)
|
||||
setErrorSelector(errorTag);
|
||||
}
|
||||
setDocLoading(false);
|
||||
setSelectFlag(false);
|
||||
},
|
||||
|
|
@ -338,6 +346,10 @@ function CodeViewer(props) {
|
|||
contentDiv.querySelector(".errorCd").value = contentDiv.querySelector(".errorText").innerText;
|
||||
}
|
||||
|
||||
function errorSelectorChange(e){
|
||||
window.location.href = window.location.origin+window.location.pathname+"#error"+e.target.value
|
||||
}
|
||||
|
||||
function saveErrorCd(content){
|
||||
EgovNet.requestFetch(
|
||||
'/standardCode/saveErrorCd.do',
|
||||
|
|
@ -374,6 +386,7 @@ function CodeViewer(props) {
|
|||
<Row>
|
||||
<Col xs={3}></Col>
|
||||
<Col xs={"auto"}>{docInfo}</Col>
|
||||
<Col xs={"auto"}>{errorSelector}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
<Col xs={3} className="border-end viewerDiv">
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@ public interface StandardCodeTreeInterface {
|
|||
String getDoc_code();
|
||||
String getDoc_code_ver();
|
||||
String getDoc_code_name();
|
||||
Integer getError_cnt();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue