링크 기능 작업중.

cks
강석 최 2023-10-19 14:53:40 +09:00
parent f73efb133c
commit 4e58a20acf
2 changed files with 9 additions and 1 deletions

View File

@ -308,3 +308,5 @@
.viewerDiv{height: calc(100vh - 180px); overflow-y: auto;} .viewerDiv{height: calc(100vh - 180px); overflow-y: auto;}
.openDoc{background-color: bisque;} .openDoc{background-color: bisque;}
.docLink{background-color: aquamarine}
.docLink:hover{cursor: pointer}

View File

@ -83,6 +83,7 @@ function CodeViewer(props) {
// 문서 전문 구성 // 문서 전문 구성
let detailTag = []; let detailTag = [];
if(resp.result.document.length>0){ if(resp.result.document.length>0){
const reg = /([A-Z]{3,5}(\s[0-9]{2}){3,4})/g
resp.result.document.forEach(function (item, index){ resp.result.document.forEach(function (item, index){
const isTitle = item.full_content.includes(item.group_title); const isTitle = item.full_content.includes(item.group_title);
if(isTitle){ if(isTitle){
@ -96,6 +97,11 @@ function CodeViewer(props) {
</VwDiv> </VwDiv>
) )
} }
if(reg.test(item.full_content)){
const docCode = item.full_content.match(reg)[0]
const fullContent = item.full_content.split(docCode);
item.full_content = fullContent[0]+'<key class="docLink">'+docCode+'</key>'+fullContent[1];
}
detailTag.push( detailTag.push(
<VwDiv depth={item.cont_level} isTitle={isTitle} id={item.cont_type_cd} dangerouslySetInnerHTML={ {__html: item.full_content} }></VwDiv> <VwDiv depth={item.cont_level} isTitle={isTitle} id={item.cont_type_cd} dangerouslySetInnerHTML={ {__html: item.full_content} }></VwDiv>
) )